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.
Asked
Active
Viewed 4,622 times
2 Answers
11
For the above symbol, there are two options:
Xdotool generates the character and types it:
xdotool key U2200The shell (Bash) generates the character, and Xdotool types it:
xdotool type $'\u2200'
wjandrea
- 14,109
- 4
- 48
- 98
-
Also `ctrl+shift+u` then `2200` will input a unicode symbol. Or in [KDE set a compose sequence](https://userbase.kde.org/Tutorials/ComposeKey) to do it. – pbhj Feb 27 '19 at 20:17
-
@pbhj How would you do that in Xdotool though? – wjandrea May 06 '20 at 16:59
0
What I ended up doing is:
echo -n "${TEXT}"|xsel -b
xdotool key ctrl+v
This fills the mouse buffer, then pastes it.
Nmath
- 12,105
- 8
- 25
- 54
Rich Graham
- 1
- 1
-
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. – wjandrea Nov 30 '22 at 17:19
-
Minor thing, but avoid using `echo` on arbitrary text; use `printf '%s'` instead. If for example, `TEXT='-e'`, you won't get anything printed since `-e` is a flag to `echo` and there's no way to escape it properly. – wjandrea Nov 30 '22 at 17:20