grizzly
November 14th, 2006, 04:41 PM
Yup, its indeed possible to have system-wide application independent macros in unix! thanks to xmacros and whoever who wrote a guide somehere i don't remember.
Step 1. Install the app
aptitude install xmacro
Step 2. Record the macro:
xmacrorec -d 1400 > ~/quote wait...
Step 3. xmacro isn't perfect so open ~/quote for editing, as many lines are repeated and need to be removed.
Step 4. Replay the macro
cat ~/quote | xmacroplay ":0.0"
Basically xmacroplay plays the commands from a text file.The text file can be written manually or by the above recording method. Reading the examplbelow should make it all very easy.
EXAMPLE
Delay 1 # Always add this!!
KeyStrPress bracketleft
KeyStrRelease bracketleft
String quote
KeyStrPress bracketright
KeyStrRelease bracketright
KeyStrPress bracketleft
KeyStrRelease bracketleft
KeyStrPress slash
KeyStrRelease slash
String quote
KeyStrPress bracketright
KeyStrRelease bracketright
Delay 1 #delay
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Lef
The above types [ q u o t e ] [ / q u o t e ] followed by 8 'left arrow' keys so that the cursor is between [qote] & [/quote] priceless..
Example 2
Delay 1 #delay
Sending a hotkey - Ctrl + g
KeyStrPress Control_R
KeyStrPress g KeyStrRelease g
KeyStrRelease Control_R
=== Problems?
1. Read the last 4 topics on http://xmacro.sourceforge.net/ for a better understanfing of the macro file. its simple btw
2. try adding a lil delay (look in above example for how)
3. How to play the macro?? You can use xbindkeys/khotkeys(kdeonly) to assign a shortcut for the macro.
Step 1. Install the app
aptitude install xmacro
Step 2. Record the macro:
xmacrorec -d 1400 > ~/quote wait...
Step 3. xmacro isn't perfect so open ~/quote for editing, as many lines are repeated and need to be removed.
Step 4. Replay the macro
cat ~/quote | xmacroplay ":0.0"
Basically xmacroplay plays the commands from a text file.The text file can be written manually or by the above recording method. Reading the examplbelow should make it all very easy.
EXAMPLE
Delay 1 # Always add this!!
KeyStrPress bracketleft
KeyStrRelease bracketleft
String quote
KeyStrPress bracketright
KeyStrRelease bracketright
KeyStrPress bracketleft
KeyStrRelease bracketleft
KeyStrPress slash
KeyStrRelease slash
String quote
KeyStrPress bracketright
KeyStrRelease bracketright
Delay 1 #delay
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Left
KeyStrRelease Left
KeyStrPress Lef
The above types [ q u o t e ] [ / q u o t e ] followed by 8 'left arrow' keys so that the cursor is between [qote] & [/quote] priceless..
Example 2
Delay 1 #delay
Sending a hotkey - Ctrl + g
KeyStrPress Control_R
KeyStrPress g KeyStrRelease g
KeyStrRelease Control_R
=== Problems?
1. Read the last 4 topics on http://xmacro.sourceforge.net/ for a better understanfing of the macro file. its simple btw
2. try adding a lil delay (look in above example for how)
3. How to play the macro?? You can use xbindkeys/khotkeys(kdeonly) to assign a shortcut for the macro.