Celeb Glow
updates | March 14, 2026

How can I simulate pressing `{` with xte?

How can I signal a { using ste? I have tried the following but none of these seem to work:

xte 'key {' # Outputs: Unable to resolve keysym for '{'
xte 'key \{' # Outputs: Unable to resolve keysym for '\{'
xte 'str {' # Outputs: 7
xte 'str \{' # Outputs -7
xte "str {" # Outputs: 7

I have the same problem with }, [ and ].


UPDATE: I found this post where somebody referenced this same issue. It is still unclear to me how they solved it though.


UPDATE 2: I found out here that you can also use ASCII codes. Unfortunately, it didn't work for {:

xte 'key 0x7b' # Outputs: [

UPDATE 3: Extra information required to debug the problem:

Output of $ xmodmap:

xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)

Keyboard layout: United States-International

United States-International keyboard layout

3

1 Answer

First approach

Look up the X keysyms. You can find them using xev and pressing the keys you are interested it, xmodmap -pke to print out your current table, or have a look at /usr/include/X11/XF86keysym.h.

Using one of these, you'll find that the keysym for { is braceleft.

However, there's a gotcha: key, keydown, and keyup produce actual key presses. If on your keyboard, like on my keyboard, the braces need the shift key, you need to press this as well:

xte 'keydown Shift_L' 'key braceleft' 'keyup Shift_L'

produces { on my machine.

Second approach

Don't both with keysyms, use xte str instead:

xte 'str {'
5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy