Is there any macro recorders for ubuntu? I want a program that i could assign a key to do a recorded mouse movement and keyboard typing. Thanks


6 Answers 6


Take a look at Gnu - Xnee

Link: http://www.gnu.org/software/xnee/

For the command line application on ubuntu:

sudo apt-get install cnee

N.B: xnee is a meta package in ubuntu and installing that will also install cnee. gnee is the package you should install if you want a gui.

Example usage:

cnee --record -o events.xnr --mouse --events-to-record 100 --time 2

This records 100 mouse events after a delay of 2 seconds.

cnee --replay -f events.xnr --time 2

This playbacks the events after a delay of 2 seconds.

I would look at the man page for cnee for more details about how to use it.

Also more details about xnee can be found here https://xnee.wordpress.com/

  • After installation the ubuntu 15 give me an system error. Mar 31, 2016 at 15:21
  • @TaraNickos : I updated the answer with some more details which might help Mar 31, 2016 at 16:38
  • 2
    tried everything you wrote. It does not works. Thanks so much for your time but i really cannot understand why there is not any alternatine program. There are so many for windows. Why only 1 for ubuntu? Apr 1, 2016 at 17:21
  • 1
    Ironically enough, gnee doesn't seem to install a .desktop file lol.
    – wheeler
    Jun 1, 2018 at 18:29

Actiona is not a recorder, it's a task automation tool. After getting errors with gnee I tried it and I think it's a great tool and easy to use.

sudo apt install actiona
  • I had issues with getting Actiona to press on launcher icons on the side dock in Ubuntu.
    – wheeler
    Jun 1, 2018 at 19:00

Instead of recording a macro, it might be more useful to script it from scratch with xdotool. It gives you far more control over the process.

From your description, I assume that you need something more permanent and not a macro that is only used a few times after recording it. I know this may not be what you are wishing for but it may be the best solution.

A recorded macro would fail with missing windows, different window sizes etc. as it is blind to its environment. I doubt that is acceptable in your case.

With xdotool could identify windows and manipulate them to your parameters, and then program clicks relative to them, ignoring their position.

You can even execute commands from within a pure xdotool script and close their window after the job is done.

sudo apt install xdotool

To get the right position for your clicks you can move your window into the top left corner and use:

xterm -hold -e /usr/bin/xdotool getmouselocation

Keep in mind that on Ubuntu you usually cannot move your window to the coordinates 0,0. You would have to calculate the offset.

Create a text file for your xdotool script. Let's call it xdoscript.

This is a sample script for xdotool:

search --name xdowindow
windowsize 1000 800
mousemove --window %@ 200 100
click 3
sleep 2
mousemove --window %@ 400 200
click 1
sleep 1
click 3
mousemove_relative --polar 140 5
sleep 1
click 1
sleep 1
type "man xdotool"
sleep 2
key Return
sleep 2
key Next
sleep 1
key Next
sleep 1
key Next
sleep 1
key q

I tried to get this working with gnome-terminal but gnome-terminal has been a major failure for some time and since then its window title cannot be changed, so I used Sakura for testing instead. The sleep commands are just to slow it down to a watchable speed.

sudo apt install sakura

Start Sakura with the custom name xdowindow and start the xdotool script in it:

sakura -t xdowindow
xdotool xdoscript   

For your own script you would need the following:

  • the window title
  • the window id (only if your window title is not unique)
  • a defined window size (if click points change with different sizes)

Of course, although such scripts are much more robust than recorded macros, they are by no means portable. If you change your desktop settings such as font size or reinstall your system, they might stop working and would require adjustment.

PS: The windowfocus command is required for most other commands to work.

  • 1
    it will be perfect if there's a tool to generate the xdotool_script from mouse/keyboard events.
    – recolic
    Aug 13, 2019 at 3:15

You can use X-Macro.

To install x-Macro use this command:

sudo apt-get install xmacro

For record use xmacrorec2 command:

xmacrorec2 > test.file

for play recorded macro use xmacroplay

xmacroplay "$DISPLAY" < test.file

The best out there is Sikuli

sudo apt-get install sikulix

One more option, dedicated to recording and playing back demos: atbswp.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .