I have some old shell functions that use xte to fake some keyboard input. For example, this is a function to run its argument(s) in a new gnome-terminal tab.
run_in_tab () { xte 'keydown Control_L' 'keydown Shift_L' 'key t' 'keyup Control_L' 'keyup Shift_L' 'sleep 1' "str exec $*" 'key Return' }
Is there a tool packaged in new Fedora versions that's like xte, but for Wayland?
On Apr 16, 2024, at 15:22, Don Marti dmarti@zgp.org wrote:
I have some old shell functions that use xte to fake some keyboard input. For example, this is a function to run its argument(s) in a new gnome-terminal tab.
run_in_tab () { xte 'keydown Control_L' 'keydown Shift_L' 'key t' 'keyup Control_L' 'keyup Shift_L' 'sleep 1' "str exec $*" 'key Return' }
Is there a tool packaged in new Fedora versions that's like xte, but for Wayland?
One of the security measures a that Wayland gives you is the limitations on the ability of other apps sending (or reading) key press events in other apps (including the desktop). This means that tools like xte and xdotool won’t work except in XWayland apps.
There are tools like ydotool (https://github.com/ReimuNotMoe/ydotool) but they need direct access to /dev/input, which generally need root access (and if every app can read it, it’s just as bad as X).
I suspect this is something a GNOME extension would replace, and not by sending key presses but replicating the results.