This is my first day after upgrading from 17.04 to 17.10. I've noticed that xdotool is not working as it used to. For example:

xdotool type "Lorem ipsum" types nothing.

xdotool key ctrl+shift+t doesn't open a new tab in gnome-terminal.

xdotool mousemove 0 0 doesn't move the mouse.

xdotool click 1 doesn't click on the stuff under the mouse.

xdotool getactivewindow windowmove 100 100 doesn't move the active window and returns an error:

XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1)
xdo_get_active_window reported an error

What I found is still working:

xdotool search --classname Navigator windowactivate does activate the browser.

xdotool getmouselocation --shell returns info about mouse position.

xdotool selectwindow does allow me to click on a window to get its id.

I have some scripts that rely on this tool. Any suggestion how to fix this?

UPDATE: I'm using Wayland display manager. Switching to Xorg makes it work again. Is it possible to make xdotool work again while still using Wayland?

  • 5
    Wayland? Try to switch back to Xorg. – pomsky Oct 27 '17 at 12:42
  • Yeah... Following your suggestion, it works. Thanks! – Baumann Oct 27 '17 at 12:51
  • No workaround for wayland? I've read it is better than xorg – Baumann Oct 27 '17 at 12:53
  • 4
    You want a workaround to get xdotool to work in Wayland? AFAIK, that won't be possible. man xdotool has this: xdotool lets you programatically (or manually) simulate keyboard input and mouse activity, move and resize windows, etc. It does this using X11's XTEST extension and other Xlib functions. – Justice for Monica Oct 27 '17 at 13:02

Do you have a discrete graphics card? if so, try using a different graphics driver.

I recently had a similar error on a clean install of Ubuntu. xdotool didn't seem to work, when it was definitely working on previous installations (They had been upgrades - but I wanted a fresh, clean install.)

I found that switching to the latest proprietary graphics drivers fixed my issue. The open source driver might handle synthesised input in a different way to the proprietary one.

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