langselect (works with dwmblocks "language" module)

This script uses dmenu and xorg-setxkbmap to switch between keyboard layouts
This commit is contained in:
BertramMiller 2020-05-15 21:48:44 -04:00 committed by GitHub
parent b8b9b420f9
commit 6e476c459b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

7
.local/bin/langselect Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# requirements: dmenu, xorg-setxkbmap
choices="us\\nfr\\nua\\nru"
chosen=$(echo -e "$choices" | dmenu -i )
s=$(echo "$chosen" | sed "s/.*; //")
setxkbmap $s
notify-send "Keyboard layout:" "$(setxkbmap -query | grep "layout" | awk '{print $2}')"