From dcab8f4a4bd154c708faaeed75a2c23727cae2cc Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sun, 28 Jul 2019 16:45:22 +0200 Subject: layout-switch: toggle between us de and ru --- layout-switch | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'layout-switch') diff --git a/layout-switch b/layout-switch index fdc6b65..256eeb2 100755 --- a/layout-switch +++ b/layout-switch @@ -2,13 +2,18 @@ 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+") -if [[ $CUR_US == "" ]]; then - setxkbmap us -fi - -if [[ $CUR_RU == "" ]]; then +# 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 -- cgit v1.2.3