xdotool
works with Xorg only. There is an alternate tool, ydotool
that works at a lower level and thus functions in both Xorg an Wayland. ydotool
does not have the window manipulation options that xdotool
has, but supports simulating keyboard and mouse actions.
You can move to an Xorg session to continue working with xdotool
. If you prefer to stay on Wayland, you may want to move to ydotool
to preserve the functionality.
ydotool
is available in the repositories of Ubuntu. However, even on 22.20, an old version is shipped that, for me, did not work. I therefore compiled it from source, and that is actually not so difficult. I documented the procedure on Ubuntu 22.04 here on the site.
Note that the new version is a very slimmed down version, reduced to core functionality. The new version also requires the daemon to be running. A drawback of the new version is that symbolic key presses do not work: you explicitly have to "press" and "release" keys yourself using numerical codes. As such, simulating Alt+Tab in ydotool
translates to:
ydotool key 56:1 15:1 15:0 56:0
(We press Alt, then Tab, then release Tab and Alt.)