From 56b4ad3b8256b5f720ebd6c1a3edea6c28b4fdbd Mon Sep 17 00:00:00 2001 From: BardofSprites <89086143+BardofSprites@users.noreply.github.com> Date: Sun, 30 Jun 2024 19:55:29 -0400 Subject: modded sysact --- bin/.local/bin/scripts/sysact.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bin/.local/bin/scripts/sysact.sh (limited to 'bin') 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 -- cgit v1.2.3