summaryrefslogtreecommitdiff
path: root/.local/bin/layouttoggle
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2020-10-03 19:27:15 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2020-10-03 19:27:15 -0400
commite371d9edd474bcf89cf5d462eaccb8638900b390 (patch)
treeed07118f5c514a55f23a779a1507640e46fd9ed2 /.local/bin/layouttoggle
Initial commit
Diffstat (limited to '.local/bin/layouttoggle')
-rwxr-xr-x.local/bin/layouttoggle24
1 files changed, 24 insertions, 0 deletions
diff --git a/.local/bin/layouttoggle b/.local/bin/layouttoggle
new file mode 100755
index 0000000..4742080
--- /dev/null
+++ b/.local/bin/layouttoggle
@@ -0,0 +1,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