dotfiles/config/.scripts/language_switch.sh

20 lines
351 B
Bash
Raw Normal View History

2019-08-14 22:05:24 +02:00
#!/bin/bash
KBD="";
oldKBD="";
while :
do
oldKBD="$KBD";
case "$(xset -q | grep -A 0 'LED' | cut -c59-67)" in
"00000000")
KBD="English (US)" ;;
"00001000")
KBD="Deutsch" ;;
*) KBD="unknown" ;;
esac
if [ "$KBD" != "$oldKBD" ]; then
notify-send "$KBD";
fi
sleep 1;
done