i am trying to write a bash script to quick change the $mod key of i3 i moved the "set $mod Mod4" to the end of my conf
#!/bin/bash $1=key $alt="alt" $win="win" sed '$d' /home/fabian/.config/i3/config if [ "$key" = "$win" ]; then echo "set \$mod Mod4" >> /home/fabian/.config/i3/config echo echo "Changed successfully to win" else if [ "$key" = "$alt" ]; then echo "set \$mod Mod1" >> /home/fabian/.config/i3/config echo echo "Changed successfully to alt" else echo "No Flag valid flag set, set alt or win" fi fi
two problems: the sed command is not working even if i run with sudo
if i run the script with "changeMod.sh alt" it still goes into the win condition and echos "Changed successfully to win"
if it's possible i would like the script to insert old $mod+shift+r to reload the i3 conf
Do you know how this is possible?