Recently, I wanted to use Xnee (http://www.sandklef.com/xnee/) to automate some GUI application actions on an Ubuntu Lucid 10.04 installation, but I found that the version of Xnee available from the Lucid repositories still has some problems. Specifically, this older Xnee version, 3.02-2ubuntu2, still contains workarounds for some previously existing Xorg RECORD extension problems which have themselves now been fixed in Lucid. The outcome of this mismatch is that recording fails with any of cnee, gnee or pnee. This is resolved in the next release of Ubuntu, 10.10 "Maverick", which includes Xnee 3.06, but I preferred not to upgrade the entire system to a pre-release state just to get this one application working.
Therefore, desiring to build the latest Xnee release from source and resolve the recording problem, I used a trial and error process involving the output of the configure script, along with a good deal of web searching, to come up with a list of required packages to support building Xnee 3.06 from the GNU FTP tarball. On a fresh Ubuntu 10.04 installation, patched up to date but otherwise untouched, the build dependencies can be obtained as such (approximately 100MB in total):
sudo aptitude install build-essential libxtst-dev libpanel-applet2-dev autoconf automake libtool libgnomeui-dev
If building package documentation is desired:
sudo aptitude install dia texi2html texinfo texlive-font-utils texlive-latex-base texlive-generic-recommended
Now we can get the latest tarball from the GNU FTP site and install it. Include the --disable-doc flag (recommended) if you don't want to spend the time building the package documentation:
cd ~/
wget http://ftp.gnu.org/gnu/xnee/xnee-3.06.tar.gz
tar xzvf xnee-3.06.tar.gz
cd xnee-3.06
./configure [--disable-doc]
make
sudo make install
I found that gnee, the graphical interface for Xnee, would launch and seemed usable enough (though a bit unstable when poked the wrong way) but I wanted to start by learning the basics of its command line interface, and so I haven't messed around with 3.06's gnee quite as much yet. Here are a few working examples using cnee, the Xnee CLI tool:
Recording both mouse and keyboard, storing mouse starting position, using F12 for the "stop recording" key, a countdown timer of 10 to begin and a maximum number of 1000 events to record, storing the results to a new file cnee_test.xnl:
cnee --record --mouse --keyboard -o cnee_test.xnl --store-mouse-position --stop-key F12 --time 10 --events-to-record 1000 &
Playback of mouse and keyboard events, recalling window position from the recording, with a countdown of 10 seconds to begin playback:
cnee --replay --mouse --keyboard -f cnee_test.xnl --recall-window-position --time 10
Notes:
1) Recording segfaults after the starting timer completes if F5 is the stop key... I haven't experimented further to see exactly which keys cause this.
Found your post through http://itupw056.itu.chalmers.se/xnee-live/
ReplyDeleteWhen you try to use F5 (and Xnee seg faults (never ok!)) did you get any warning from Xnee looking like this:
Error number: 24
Error: Bad grab data
Solution: You have requested to grab the same key more than once or one already grabbed
regards, hesa
Henrik, I did get an error that looked like that. I'll try to copy it over here next time I am using that system and can reproduce it. Thanks for reading and thanks for the app :)
ReplyDeleteHenrik, I tried reproducing the problem and unfortunately it was not a success; well I did manage to reproduce a problem.
ReplyDeleteI followed my directions again, but this time I am on Ubuntu 10.10. I used the same source tarball. When I ran cnee with F5 as the stop key, the entire system locked up shortly after recording started. I had to force reboot with the button on the box.
The following message did appear before the freeze: "Workaround: Adding your device events as delivered events to get them recorded." Let me know if there's other information I can provide. In the meantime I will try rebuilding with your latest source.
Building 3.0.9 on Maverick worked great (readers can just change the "3.06" to "3.09" in the download URL in the directions). Running cnee to record worked perfectly. Playback was smooth and fairly accurate (I didn't mess with command line parameters to fine tune things.) No crashes at all. I was never able to get cnee to playback properly using 3.0.6 so this is very nice.
ReplyDeleteHowever, I still couldn't get the stop keys to function (neither F5 or F12). I suspect Gnome is trapping them, but I'm not sure. In any case, great progress in stability and functionality here!
Note that 3.0.6 is still the version in the Maverick repos. Building 3.0.9 is probably recommended, based on what I just saw with 3.0.6 on Maverick.
Added some comments here : http://sandklef.wordpress.com/2011/02/26/gnu-xnee-3-09-moore-released/#comment-110
ReplyDeletesorry for cross-blogging
Not a problem at all; checking out your comments there.
ReplyDelete