summaryrefslogtreecommitdiff
path: root/.local/bin/layouttoggle
blob: 4742080b16528fd9155655966c9ca096fd477bd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

layout=$(cat $HOME/.cache/layout)

case "$layout" in
	ca) setxkbmap -model pc104 -layout us -variant ,,
			echo us > $HOME/.cache/layout
			# pkill -RTMIN+46 dwmblocks
			$SCRIPTS/cron/dwmbar
			;;
	us) setxkbmap -model pc104 -layout ca -variant ,,
			echo ca > $HOME/.cache/layout
			# pkill -RTMIN+46 dwmblocks
			$SCRIPTS/cron/dwmbar
			;;
		*) setxkbmap -model pc104 -layout us -variant ,,
			echo us > $HOME/.cache/layout
			# pkill -RTMIN+46 dwmblocks
			$SCRIPTS/cron/dwmbar
			;;
	esac

# 	[[ "$layout" == "us" ]] && setxkbmap -model pc104 -layout ca -variant ,, ; echo ca > $HOME/.cache/layout && $SCRIPTS/cron/dwmbar
# 	[[ "$layout" == "us" ]] || setxkbmap -model pc104 -layout ca -variant ,, ; echo ca > $HOME/.cache/layout && $SCRIPTS/cron/dwmbar