From cfaef26e8718916adcc68fbfb63b15f2389b2cd2 Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Fri, 6 Oct 2023 23:10:55 +0200 Subject: move all the files --- mut/bin/sysact | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 mut/bin/sysact (limited to 'mut/bin/sysact') diff --git a/mut/bin/sysact b/mut/bin/sysact new file mode 100755 index 0000000..4bb92dc --- /dev/null +++ b/mut/bin/sysact @@ -0,0 +1,21 @@ +#!/bin/sh + +# A dmenu wrapper script for system functions. +export WM="dwm" +ctl='systemctl' + +wmpid(){ # This function is needed if there are multiple instances of the window manager. + echo "$(pidof dwm)" +} + +case "$(printf "🔒 lock\n🚪 leave $WM\n♻️ renew $WM\n🐻 hibernate\n🔃 reboot\n🖥️shutdown\n💤 sleep\n📺 display off" | dmenu -i -p 'Action: ')" in + '🔒 lock') slock ;; + "🚪 leave $WM") kill -TERM "$(wmpid)" ;; + "♻️ renew $WM") kill -HUP "$(wmpid)" ;; + '🐻 hibernate') slock $ctl hibernate -i ;; + '💤 sleep') slock $ctl suspend -i ;; + '🔃 reboot') $ctl reboot -i ;; + '🖥️shutdown') $ctl poweroff -i ;; + '📺 display off') xset dpms force off ;; + *) exit 1 ;; +esac -- cgit v1.2.3