Saturday, September 17, 2011

xmacrorec2

install from ubuntu repository xmacro

//record it
xmacrorec2 > xmacro_v2.log
//hit home key, so don't ever press home key while recording
//saver.log is in top level of root directory

//replay it
cat xmacro_v2.log | xmacroplay ":0.0"

don't use the delay optino in xmacroplay...
hard code it in saver.log other keypresses will last 5 seconds, including control keys!!


Here is an example log file

Delay 3
MotionNotify 306 797
ButtonPress 1
ButtonRelease 1
Delay 1
MotionNotify 861 92
ButtonPress 1
ButtonRelease 1
Delay 1
MotionNotify 966 187
KeyStrPress Control_L
KeyStrRelease Control_L
KeyStrPress Control_L
KeyStrRelease Control_L
KeyStrPress Control_L
KeyStrRelease Control_L
KeyStrPress Control_L
KeyStrPress k
KeyStrRelease k
KeyStrRelease Control_L
KeyStrPress Control_L
KeyStrPress c
KeyStrRelease c
KeyStrRelease Control_L
KeyStrPress Control_L
KeyStrPress l
KeyStrRelease l
KeyStrRelease Control_L
KeyStrPress Control_L
KeyStrPress v
KeyStrRelease Control_L
KeyStrRelease v
KeyStrPress Return
KeyStrRelease Return
Delay 5
KeyStrPress c
KeyStrRelease c
MotionNotify 121 786
ButtonPress 1
ButtonRelease 1
Delay 5
KeyStrPress Control_L
KeyStrPress c
KeyStrRelease Control_L
KeyStrRelease c
MotionNotify 323 799
KeyStrPress Down
KeyStrRelease Down
MotionNotify 289 787
ButtonPress 1
ButtonRelease 1
Delay 5
KeyStrPress Control_L
KeyStrPress v
KeyStrRelease Control_L
KeyStrRelease v
KeyStrPress Tab
KeyStrRelease Tab
KeyStrPress Tab
KeyStrRelease Tab
KeyStrPress Tab
KeyStrRelease Tab
KeyStrPress Down
KeyStrRelease Down
MotionNotify 270 249
ButtonPress 1
ButtonRelease 1
Delay 5
MotionNotify 1091 237
ButtonPress 1
ButtonRelease 1
Delay 5


To run xmacro in a loop

create a bash file with executable permissions
such as bash-xmacro.sh then run it
bash bash-xmacro.sh


#!/bin/bash
for (( i=0; i<5; i++ ))
do
cat xmacro_v2.log | xmacroplay ":0.0"
done

No comments:

Post a Comment