summaryrefslogtreecommitdiff
path: root/layout-switch
blob: 256eeb2138c1cc1c7c5e3c8a725e63406b13d9a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/zsh -x

CUR_US=$(setxkbmap -print | grep xkb_symbols | grep -o "+us+")
CUR_RU=$(setxkbmap -print | grep xkb_symbols | grep -o "+ru+")
CUR_DE=$(setxkbmap -print | grep xkb_symbols | grep -o "+de+")

# us > de > ru
if [[ $CUR_US == "+us+" ]]; then
  setxkbmap de
  ratpoison -c "echo keyboard map DE"
elif [[ $CUR_DE == "+de+" ]]; then
  setxkbmap ru
  ratpoison -c "echo keyboard map RU"
elif [[ $CUR_RU == "+ru+" ]]; then
  setxkbmap us
  ratpoison -c "echo keyboard map US"
fi

setxkbmap -option
xmodmap ~/.Xmodmap