Skip to content

Instantly share code, notes, and snippets.

@hudvin
Created March 2, 2018 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hudvin/ee8278d04bde0f220a05c4eecb2e63fa to your computer and use it in GitHub Desktop.
Save hudvin/ee8278d04bde0f220a05c4eecb2e63fa to your computer and use it in GitHub Desktop.
keyboard switcher EN<>RU and DE
#!/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
@hudvin
Copy link
Author

hudvin commented Mar 2, 2018

  1. Download to some place
  2. Install xkb-switch
  3. Create some hotkey for DE for "switch.sh de"
  4. Create some hotkey for EN<>RU for "switch.sh us_ru"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment