i am writing a script to quick change the mod key of i3
conf0="/home/myuser/.config/i3/config" case "${1}" in (alt) key=Mod1 ;; (win) key=Mod4 ;; (*) printf "Invalid key: %s\n" "${1}" ; exit 1 ;; esac sed -i 's/^\(set $mod\) .*/\1 '"${key}/" "${conf0}" || exit printf "Changed successfully to %s/%s\n" "${1}" "${key}"
but i wont the i3 config to automatically reload at the end of my script. I found xdotool might work but if have to check the current $mod key to be able to reload i3.
How can this? Is awk a goo choice for that?
Please point me in the right direction