xte stopped working after upgrading to ubuntu 21.04
To check whether your Ubuntu session is Xorg or Wayland:
$ echo $XDG_SESSION_TYPE
wayland
You can either:
- try to replace tools relying on GUI with tools that write input events directly to
/dev/uinput
, e.g.xdotool
withydotool
etc, - or you can switch back to Xorg.
To set Xorg as default:
$ sudo gedit /etc/gdm3/custom.conf
Uncomment (remove #
) the following line:
#WaylandEnable=false
Save the file, reboot and try something like xdotool mousemove 50 20
in terminal, it should teleport your mouse pointer near the upper left corner of the screen.
Very simple. After installing Ubuntu 21.04, you are now on the more modern Wayland graphical system rather than the venerable Xorg server. Extremely usefull automation tools such as xbindkeys
, xvt
, wmctrl
, xdotool
, ... do not work on Wayland.
In addition, many screen recording programs do not work on Wayland, although major player OBS Studio now supports Wayland.
Why does it work on some applications? Probably because these applications run on XWayland, an Xorg emulation layer for Wayland to support applications that do not run on native Wayland.
What to do? Switch back to Xorg for the time being, or attempt to get the very young replacing tools for Wayland to work.