sudo wget https://gist.githubusercontent.com/matasarei/579991cfab9f5e7f966c7a424e5fa4c3/raw/87037b9776a86ffd3dd2b32432bed9d5509da2d8/switch-layout.sh -O /usr/bin/switch-layoutsudo chmod +x /usr/bin/switch-layout- Go to keyboard settings
- Add custom keyboard shortcut
switch-layoutand set any combination, like Super + Spase.
Last active
April 24, 2019 21:11
-
-
Save matasarei/579991cfab9f5e7f966c7a424e5fa4c3 to your computer and use it in GitHub Desktop.
Switch layout with Super + Space and fix keyboard layout lag on elementaryOS Juno
This file contains hidden or 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/sh | |
| LAYOUT_COUNT=$(gsettings get org.gnome.desktop.input-sources sources | grep -oE "'[a-z]{2}'" | wc -l) | |
| 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 ] || [ '--set-default' = "$1" ] || [ '-d' = "$1" ] | |
| 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