9

I'm looking for a good keyboard macro program for Ubuntu Linux? I want to easily be able to "start recording" have it record all keys pressed. Then when I stop recording save it. then I want to be able to call the macro by hitting a special key and selecting the sequence. having to open a text file and program the macro will create too much overhead.

  • 2
    This question was on topic when written, and should be preserved for historical reasons. Just as an update, a new tool xdotool is a very good answer to this question. – Arthur Ulfeldt Oct 24 '16 at 22:18
9

The program that comes closest to this that I know of is XMacro:

The XMacro package contains two simple, C++ programs (xmacrorec and xmacroplay) for recording and replaying keyboard and mouse events on an X server.

This is available in the Ubuntu repository as the xmacro package.

  • 3
    After sudo apt-get install -y xmacro, go to Keyboard > Shortcuts > Custom Shortcuts and create e.g. F9 as timeout 120 bash -c 'notify-send "Recording macro; press ESC to stop" ; xmacrorec2 -k 9 > /tmp/macro ; notify-send "Recording macro finished; use F10 to play it"' and F10 as bash -c 'notify-send "Playing back macro on $DISPLAY" ; xmacroplay "$DISPLAY" < /tmp/macro'. Now you can record with F9, stop with ESC and playback with F10. It stops after 120s (in case you forget it). – Mark Dec 30 '15 at 16:21
  • @Mark your comment deserves a separate answer linked to this one. We could then upvote it could be properly formatted – Boris Pavlović Apr 20 '17 at 9:41
  • 1
    @BorisPavlović Added it to this answer since it's a follow-up on it. – Mark Apr 20 '17 at 19:57
5

autokeys is a good option though it is more heavy weight than i am looking for

Not the answer you're looking for? Browse other questions tagged or ask your own question.