mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Fix sysact "WM" literal bug + generalization
This commit is contained in:
parent
c45f82300c
commit
eaa8de4953
@ -9,15 +9,19 @@ case "$(readlink -f /sbin/init)" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
pidof i3 && renew="i3 restart" && leave="i3 exit" && wm="i3"
|
pidof i3 && renew="i3 restart" && leave="i3 exit" && wm="i3"
|
||||||
|
pidof dwm && renew="kill -HUP $(pidof -s dwm)" && leave="kill -TERM $(pidof -s dwm)" && wm="dwm"
|
||||||
|
pidof bspwm && renew="${XDG_CONFIG_HOME:-$HOME/.config}/bspwm/bspwmrc" && wm "bspwm"
|
||||||
|
|
||||||
cmds="\
|
cmds="\
|
||||||
🔒 lock slock
|
🔒 lock slock
|
||||||
🚪 leave ${wm:-WM} ${leave:-kill -TERM $(pidof -s dwm)}
|
🚪 leave ${wm:-Xorg} ${leave:-killall Xorg}
|
||||||
♻ renew ${wm:-WM} ${renew:-kill -HUP $(pidof -s dwm)}
|
|
||||||
🐻 hibernate ${hib:-sudo -A systemctl suspend-then-hibernate}
|
🐻 hibernate ${hib:-sudo -A systemctl suspend-then-hibernate}
|
||||||
🔃 reboot ${reb:-sudo -A reboot}
|
🔃 reboot ${reb:-sudo -A reboot}
|
||||||
🖥 shutdown ${shut:-sudo -A shutdown -h now}"
|
🖥 shutdown ${shut:-sudo -A shutdown -h now}"
|
||||||
|
|
||||||
|
# If both wm and renew command are known add it to the menu
|
||||||
|
[ -n "$wm" ] && [ -n "$renew" ] && cmds="$(echo "$cmds" | sed "3i♻ renew ${wm} ${renew}")"
|
||||||
|
|
||||||
choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1
|
choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1
|
||||||
|
|
||||||
`echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-`
|
`echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user