I'm trying to make a shortcut to send, for example, the universal quantifier symbol, ∀ (U+2200). Xdotool's own documentation doesn't really explain this.
2 Answers
For the above symbol, there are two options:
Xdotool generates the character and types it:
xdotool key U2200
The shell (Bash) generates the character, and Xdotool types it:
xdotool type $'\u2200'
-
Also
ctrl+shift+u
then2200
will input a unicode symbol. Or in KDE set a compose sequence to do it.– pbhjFeb 27, 2019 at 20:17 -
What I ended up doing is:
echo -n "${TEXT}"|xsel -b
xdotool key ctrl+v
This fills the mouse buffer, then pastes it.
-
Why not just
xdotool type "$TEXT"
? And how do you generate the Unicode character in the first place? It's usually a good idea to avoid non-ASCII text in source code.– wjandreaNov 30, 2022 at 17:19 -
Minor thing, but avoid using
echo
on arbitrary text; useprintf '%s'
instead. If for example,TEXT='-e'
, you won't get anything printed since-e
is a flag toecho
and there's no way to escape it properly.– wjandreaNov 30, 2022 at 17:20