Comment 21 for bug 367685

Revision history for this message
Zurd (zurd3) wrote :

Last comment from theLured explains very well the situation we are facing. But I've found a workaround to make xmacro works. The only problem with it is to record, but it can play a script file. So just open up your favorite text editor and create a script file! It's not user-friendly but it's very simple. Here's a few tips to get you starting :

- All the commands that can be entered in a script file can be found at http://xmacro.sourceforge.net/
- To play a macro : xmacroplay $DISPLAY < your_script_file.txt
- To know what command is used for a key or a mouse button, call xmacrorec $DISPLAY and type the key or press the mouse button, it will show up many times but quit it and you'll have the command to insert into your script file.
- To know the position of your mouse install xdotool : sudo apt-get install xdotool
and use it like so in a console : xdotool getmouselocation
With the position you can call the MotionNotify command of xmacro to position your mouse where you want it to be.
For example in a script file :
MotionNotify 57 10
ButtonPress 1
ButtonRelease 1
This will open up your Applications menu of Ubuntu at the top left.
- To make a return key both pressed and released use "KeyStr Return"
- Use the Delay commands if your actions are too fast for the computer to handle or the computer is waiting for an input (like a network connection).

This is just a work-around that I've used and it's working and in my opinion the only way to automate stuff on linux right now.
I found xmacro to be even better than xnee, less complicated. And don't try the same work-around with xnee, the script file is way too complicated.