add useful and used scripts

This commit is contained in:
Tibeuleu
2024-02-27 17:40:07 +01:00
parent 738538d51b
commit 62121f561d
36 changed files with 872 additions and 0 deletions

19
.local/bin/sysact Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
# A dmenu wrapper script for system functions.
# For non-systemd init systems.
case "$(readlink -f /sbin/init)" in
*runit*) hib="doas_askpass zzz" ;;
*openrc*) hib="loginctl suspend" ; reb="loginctl reboot"; shut="loginctl poweroff";;
esac
cmds="\
🔒 lock slock
🐻 hibernate ${hib:-doas_askpass systemctl suspend}
🔃 reboot ${reb:-doas_askpass reboot}
🖥 shutdown ${shut:-doas_askpass shutdown -h now}"
choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1
`echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-`