1
0
Fork 0
dotfiles/.local/bin/sysact

23 lines
853 B
Plaintext
Raw Normal View History

2022-07-04 21:36:33 +02:00
#!/bin/sh
# A dmenu wrapper script for system functions.
case "$(readlink -f /sbin/init)" in
2023-02-07 17:19:53 +01:00
*systemd*) ctl='systemctl' ;;
*) ctl='loginctl' ;;
2022-07-04 21:36:33 +02:00
esac
2023-03-02 13:13:40 +01:00
# case "$(printf " lock\nﴚ leave dwm\n累 renew dwm\nﭦ hibernate\n sleep\nﰇ reboot\n襤 shutdown\n display off" | dmenu -i -p 'Action: ')" in
2024-01-15 18:02:19 +01:00
case "$(printf "󰌾 lock\n󰗼 leave dwm\n󰑙 renew dwm\n󰜉 reboot\n⏻ shutdown\n󰶐 display off" | dmenu -i -p 'Action: ')" in
'󰌾 lock')
2023-02-07 17:19:53 +01:00
xset s activate &
gpg-connect-agent --no-autostart reloadagent /bye
;;
2024-01-15 18:02:19 +01:00
'󰗼 leave dwm') kill -TERM "$(pgrep -u "$USER" "\bdwm$")" ;;
'󰑙 renew dwm') kill -HUP "$(pgrep -u "$USER" "\bdwm$")" ;;
# '⏼ hibernate') $ctl hibernate -i ;;
# '⏾ sleep') $ctl suspend -i ;;
'󰜉 reboot') $ctl reboot ;;
'⏻ shutdown') $ctl poweroff ;;
'󰶐 display off') xset dpms force off ;;
2023-02-07 17:19:53 +01:00
*) exit 1 ;;
2022-07-04 21:36:33 +02:00
esac