dotfiles/.config/wm_scripts/layout.sh
2021-12-19 20:52:26 +08:00

35 lines
559 B
Bash
Executable File

#!/bin/bash
#
# Script to change keyboard layout.
#
# dmenu
#option=$(echo -e $options | dmenu -i)
# create script file
script_file="setlayout.sh"
if [ ! -f $script_file ]
then
touch $script_file
chmod +x $script_file
fi
# rofi emulation of dmenu
option=$(echo "1) US|2) Colemak" | rofi -dmenu -sep '|' -i)
echo $option
case $option in
1*)
cmd="setxkbmap us -option"
echo $cmd > $script_file
$($cmd)
;;
2*)
cmd="setxkbmap us -variant colemak -option caps:ctrl_modifier -option altwin:swap_alt_win"
echo $cmd > $script_file
$($cmd)
;;
esac