index.md (1095B)
1 setxkbgroup 2 =========== 3 4 Description 5 ----------- 6 The patch adds a new `setxkbgroup` function to be used inside 7 `keys[]`. It allows idempotent keyboard layout switching from dwm 8 itself. 9 10 Suppose you've configured keyboard layouts in X server like this: 11 12 `setxkbmap -option 'grp:rctrl_toggle' -layout 'us,ru,epo,gr(bare)'` 13 14 And then have defined a few key bindings in the `keys[]` array in dwm 15 `config.h` like this: 16 17 ... 18 { MODKEY, XK_u, setxkbgroup, {.ui = 0 } }, 19 { MODKEY, XK_r, setxkbgroup, {.ui = 1 } }, 20 { MODKEY, XK_e, setxkbgroup, {.ui = 2 } }, 21 { MODKEY, XK_g, setxkbgroup, {.ui = 3 } }, 22 ... 23 24 Configured like this, `MOD+r` in dwm immediately activates Russian 25 layout, `MOD+g` switches to Greek and `MOD+u` gets the US layout. You 26 don't need to track how many times to press Right Ctrl (or whatever) 27 key to use a desired layout. 28 29 Download 30 -------- 31 * [dwm-setxkbgroup-6.4.diff](dwm-setxkbgroup-6.4.diff) 32 33 Author 34 ------ 35 * Anton Yabchinskiy <arn+53a4f52@bestmx.net>