I seem to be unable to make xdotool
work. I'm trying to emulate keyboard shortcuts as Super+Left via external output. I looked it up and xdotool
seems to do exactly that, emulate keyboard strokes. But when I run my script I get this error:
Qt: failed to retrieve the virtual modifier names from XKB
when running something like this from my code:
xdotool key super+Left
But if I do the same, and others shortcuts as (Ctrl+Alt+T), from a common terminal I get nothing at all as output, the process just finishes.
Obviously I have no expirience with this tool so probably I'm missing something but I can't figure out why and I don't see this error replicated anywhere.
Edit:
My "external output" is a python script that given circumstances executes different commands like this:
process = subprocess.Popen(command)
output, error = process.communicate()
I'm using Ubuntu 21.04.
XKB
I guess X11 but ... https://unix.stackexchange.com/q/202891/140633 – And do you meanctrl+alt+t
? (as in+
betweenalt
andt
). Without it you should end up with at
in your terminal ~ before new prompt. It could also be useful if you include distribution and desktop you use. – ibuprofen Jun 27 '21 at 05:51xdotool
is made for X11. I am not updated on the status of similar tools on Wayland, but from the design choices it is (was?) not possible. It is a security measure, and for me one of the reasons I stick with X11 (screen sharing, screenshots, UI automation, automated input, scripted window management, ...). IIRC there are some tools that do some things - but require root access, which, well, is not something I want to do. Try searching the web for things likeWayland xdotool
and similar. – ibuprofen Jun 27 '21 at 15:42