Created
January 31, 2022 21:51
-
-
Save kopp/60fed56e84582df4442e9129798ae9c8 to your computer and use it in GitHub Desktop.
toggle-keyboard-layout-on-any-desktop
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
toggle_keyboard_layout.sh | |
Mod4+I |
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
#!/usr/bin/bash | |
# toggle keyboard layout using setxkbmap in between de and us | |
current=$(setxkbmap -query | grep layout | awk '{print $2}') | |
case $current in | |
(us) new=de | |
;; | |
(de) new=us | |
;; | |
esac | |
setxkbmap $new && notify-send "Using $new as new keyboard layout." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment