xdotool Does Not Work With Gnome Keyboard Shortcuts

I created a custom keyboard shortcut, <ctrl> + <alt> + <shift> + T that would call the command xdotool key --clearmodifiers ctrl+F10 e; however, it does not work. I know that the shortcut is being recognized properly because if I change the command to just gnome-terminal, a terminal window will open as expected. So for some reason xdotool is just not running as a command. I know that the command works on its own because if I run the command in the terminal myself, it works just fine.

The purpose for this is that I want to open a terminal in the current nautilus working directory which you can do by pressing ctrl_F10 and then e, but I wanted to use another keyboard shortcut for that with the gnome keyboard shortcuts.


Check whether your Ubuntu session is Xorg or Wayland. Tools like xdotool aren't compatible with Wayland and Wayland became default in newer Ubuntu versions so it switches on upgrade.

$ echo $XDG_SESSION_TYPE 
wayland

You can switch back to Xorg by editing config file:

$ sudo gedit /etc/gdm3/custom.conf

Uncomment (i.e. remove # from the beginning of) 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.