35 lines
559 B
Bash
Executable File
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
|