3

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?

Baumann
  • 221
  • 2
  • 7
  • 5
    Wayland? Try to [switch back to Xorg](https://askubuntu.com/questions/961304/how-do-you-switch-from-wayland-back-to-xorg-in-ubuntu-17-10). – 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](https://askubuntu.com/questions/11537/why-is-wayland-better) – 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. – DK Bose Oct 27 '17 at 13:02

1 Answers1

1

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.

SonOfLars
  • 11
  • 1