mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
what the actual phucc
This commit is contained in:
parent
5a58f8b30d
commit
ede14e5420
@ -1,22 +1,19 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
# 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*) slp='systemctl suspend'; hib='systemctl suspend-then-hibernate -i' ;;
|
||||||
*openrc*) reb="sudo -A openrc-shutdown -r"; shut="sudo -A openrc-shutdown -p 0" ;;
|
*runit*) slp='sudo -A zzz -z'; hib='sudo -A zzz -Z' ;;
|
||||||
|
*) exit 1 ;;
|
||||||
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 $hib ;;
|
||||||
🔃 reboot ${reb:-sudo -A reboot}
|
'💤 sleep') slock $slp ;;
|
||||||
🖥 shutdown ${shut:-sudo -A shutdown -h now}
|
'🔃 reboot') sudo -A shutdown -h now ;;
|
||||||
📺 display off xset dpms force off"
|
'🖥️shutdown') sudo -A shutdown -r now ;;
|
||||||
|
'📺 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…
x
Reference in New Issue
Block a user