diff --git a/.config/wm_scripts/autostart.sh b/.config/wm_scripts/autostart.sh index 027300e..d4f212e 100755 --- a/.config/wm_scripts/autostart.sh +++ b/.config/wm_scripts/autostart.sh @@ -16,3 +16,4 @@ run firefox run discord run alacritty "--working-directory $HOME/" run feh "--bg-fill $HOME/wallpaper/ff_campfire.jpg" +[ -f "setlayout.sh" ] && ./setlayout.sh diff --git a/.config/wm_scripts/layout.sh b/.config/wm_scripts/layout.sh index 18c735e..fbe330e 100755 --- a/.config/wm_scripts/layout.sh +++ b/.config/wm_scripts/layout.sh @@ -1,12 +1,20 @@ #!/bin/bash # -# Script to change Xorg layout. +# 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) @@ -14,9 +22,15 @@ echo $option case $option in 1*) - setxkbmap us + loadkeys us + cmd="setxkbmap us" + echo $cmd > $script_file + $($cmd) ;; 2*) - setxkbmap us -variant colemak + loadkeys colemak + cmd="setxkbmap us -variant colemak -option caps:ctrl_modifier -option altwin:swap_alt_win" + echo $cmd > $script_file + $($cmd) ;; esac