aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardofSprites <[email protected]>2024-06-30 19:55:29 -0400
committerBardofSprites <[email protected]>2024-06-30 19:55:29 -0400
commit56b4ad3b8256b5f720ebd6c1a3edea6c28b4fdbd (patch)
tree43f4c4bbb0e3ea92defd175425d08e92eed631ec
parent54a88b0a5294d03d11f8b196a823bf867f9e2eaf (diff)
modded sysact
-rwxr-xr-xbin/.local/bin/scripts/sysact.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/.local/bin/scripts/sysact.sh b/bin/.local/bin/scripts/sysact.sh
new file mode 100755
index 0000000..4a7c191
--- /dev/null
+++ b/bin/.local/bin/scripts/sysact.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# A dmenu wrapper script for system functions.
+export WM="dwm"
+case "$(readlink -f /sbin/init)" in
+ *systemd*) ctl='systemctl' ;;
+ *) ctl='loginctl' ;;
+esac
+
+case "$(printf "🔒 lock\n🐻 hibernate\n🔃 reboot\n🧹shutdown\n💤 sleep" | dmenu -i -p 'Action: ')" in
+ '🔒 lock') slock ;;
+ '🐻 hibernate') slock $ctl hibernate -i ;;
+ '💤 sleep') slock $ctl suspend -i ;;
+ '🔃 reboot') $ctl reboot -i ;;
+ '🖥️shutdown') $ctl poweroff -i ;;
+ *) exit 1 ;;
+esac