Skip to content

Instantly share code, notes, and snippets.

@konchunas
Created February 8, 2019 01:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konchunas/ab805f7ce8d883ac5befc7edc9b333e7 to your computer and use it in GitHub Desktop.
Save konchunas/ab805f7ce8d883ac5befc7edc9b333e7 to your computer and use it in GitHub Desktop.
#!/bin/sh
LAYOUT_COUNT=2
CURRENT_LAYOUT=$(gsettings get org.gnome.desktop.input-sources current)
CURRENT_LAYOUT_NUMBER=$(echo -n $CURRENT_LAYOUT | tail -c 1)
DESIRED_LAYOUT=$(expr $CURRENT_LAYOUT_NUMBER + 1)
if [ `expr $DESIRED_LAYOUT % $LAYOUT_COUNT` -eq 0 ]
then
DESIRED_LAYOUT="0"
fi
gsettings set org.gnome.desktop.input-sources current $DESIRED_LAYOUT
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment