Created
March 2, 2018 20:54
-
-
Save hudvin/28719a05b273f82edf0cb3d996798d4f to your computer and use it in GitHub Desktop.
keyboard switcher EN<>RU and DE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mode=$1 | |
echo $mode | |
if [ "$mode" == "de" ]; then | |
echo "switching to DE layout" | |
xkb-switch -s de | |
elif [ "$mode" == "us_ru" ]; then | |
current_layout=$(xkb-switch) | |
echo $current_layout | |
if [ "$current_layout" == "de" ]; then | |
xkb-switch -s us | |
fi | |
if [ "$current_layout" == "us" ]; then | |
xkb-switch -s ru | |
fi | |
if [ "$current_layout" == "ru" ]; then | |
xkb-switch -s us | |
fi | |
else | |
echo "incorrect params" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment