sysact rewrite and minor stuff (#1000)
* minor forgoten stuff we already have shutdown in sudo loop * why was this still here? it belongs in ~/.config/ * what the actual phucc * implemented loginctl and fixed shebang
This commit is contained in:
parent
5caaa489ac
commit
15d09bac36
3 changed files with 14 additions and 18 deletions
|
@ -35,7 +35,7 @@ alias \
|
||||||
g="git" \
|
g="git" \
|
||||||
trem="transmission-remote" \
|
trem="transmission-remote" \
|
||||||
YT="youtube-viewer" \
|
YT="youtube-viewer" \
|
||||||
sdn="sudo shutdown -h now" \
|
sdn="shutdown -h now" \
|
||||||
e="$EDITOR" \
|
e="$EDITOR" \
|
||||||
v="$EDITOR" \
|
v="$EDITOR" \
|
||||||
p="pacman" \
|
p="pacman" \
|
||||||
|
|
|
@ -1,22 +1,18 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# A dmenu wrapper script for system functions.
|
# A dmenu wrapper script for system functions.
|
||||||
|
|
||||||
# For non-systemd init systems.
|
|
||||||
case "$(readlink -f /sbin/init)" in
|
case "$(readlink -f /sbin/init)" in
|
||||||
*runit*) hib="sudo -A zzz" ;;
|
*systemd*) ctl='systemctl' ;;
|
||||||
*openrc*) reb="sudo -A openrc-shutdown -r"; shut="sudo -A openrc-shutdown -p 0" ;;
|
*) ctl='loginctl' ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
cmds="\
|
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
|
||||||
🔒 lock slock
|
'🔒 lock') slock ;;
|
||||||
🚪 leave dwm kill -TERM $(pgrep -u $USER "\bdwm$")
|
'🚪 leave dwm') kill -TERM "$(pgrep -u "$USER" "\bdwm$")" ;;
|
||||||
♻ renew dwm kill -HUP $(pgrep -u $USER "\bdwm$")
|
'♻️ renew dwm') kill -HUP "$(pgrep -u "$USER" "\bdwm$")" ;;
|
||||||
🐻 hibernate slock ${hib:-systemctl suspend-then-hibernate -i}
|
'🐻 hibernate') slock $ctl hibernate ;;
|
||||||
🔃 reboot ${reb:-sudo -A reboot}
|
'💤 sleep') slock $ctl suspend ;;
|
||||||
🖥 shutdown ${shut:-sudo -A shutdown -h now}
|
'🔃 reboot') $ctl reboot ;;
|
||||||
📺 display off xset dpms force off"
|
'🖥️shutdown') $ctl poweroff ;;
|
||||||
|
'📺 display off') xset dpms force off ;;
|
||||||
choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1
|
*) exit 1 ;;
|
||||||
|
esac
|
||||||
eval "$(echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-)"
|
|
||||||
|
|
Loading…
Reference in a new issue