summaryrefslogtreecommitdiff
path: root/.local/bin/layouthandler
blob: 9b7e27d1fdef09e55dc71733361e7938622c1d66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

layout="$(setxkbmap -query | awk '$1 ~ /layout/ { print $2 }')"
alt_layout="${ALT_KB_LAYOUT?Alternative layout not set!}"

echo "$layout"

case $layout in
us)
	setxkbmap -layout "$alt_layout"
	notify-send "Layout Changed." "Keyboard set to $alt_layout."
	;;
*)
	setxkbmap -layout us
	notify-send "Layout Changed." "Keyboard set to us."
	;;
esac