layouttoggle (370B) - raw


      1 #!/bin/sh
      2 
      3 layout=$(cat $HOME/.cache/layout)
      4 
      5 case "$layout" in
      6 	ca) setxkbmap -model pc104 -layout us -variant ,,
      7 			echo us > $HOME/.cache/layout
      8 			;;
      9 	us) setxkbmap -model pc104 -layout ca -variant ,,
     10 			echo ca > $HOME/.cache/layout
     11 			;;
     12 		*) setxkbmap -model pc104 -layout us -variant ,,
     13 			echo us > $HOME/.cache/layout
     14 			;;
     15 	esac
     16 
     17 kill -38 $(pidof dwmblocks)
     18