10

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 2

11

For the above symbol, there are two options:

  1. Xdotool generates the character and types it:

    xdotool key U2200
    
  2. The shell (Bash) generates the character, and Xdotool types it:

    xdotool type $'\u2200'
    
2
  • Also ctrl+shift+u then 2200 will input a unicode symbol. Or in KDE set a compose sequence to do it.
    – pbhj
    Feb 27, 2019 at 20:17
  • @pbhj How would you do that in Xdotool though?
    – wjandrea
    May 6, 2020 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.

2
  • 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, 2022 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, 2022 at 17:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .