From a285a64feee467d211744665f9b9b33568f117ab Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 16 Jan 2022 15:05:46 +0100 Subject: Add popupgrade script --- .local/bin/sysact | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 .local/bin/sysact (limited to '.local/bin/sysact') diff --git a/.local/bin/sysact b/.local/bin/sysact new file mode 100755 index 0000000..b07e1c9 --- /dev/null +++ b/.local/bin/sysact @@ -0,0 +1,16 @@ +#!/bin/sh +# A dmenu wrapper script for system functions. + +case "$(readlink -f /sbin/init)" in + *systemd*) ctl='systemctl' ;; + *) ctl='loginctl' ;; +esac + +case "$(printf "󰌾 lock\n󰑐 renew dwm\n󰑙 reboot\n󰤆 shutdown\n󰇄 display off" | dmenu -i -p 'Action: ')" in + '󰌾 lock') slock ;; + '󰑐 renew dwm') kill -HUP "$(pgrep -u "$USER" "\bdwm$")" ;; + '󰑙 reboot') $ctl reboot ;; + '󰤆 shutdown') $ctl poweroff ;; + '󰇄 display off') xset dpms force off ;; + *) exit 1 ;; +esac -- cgit v1.2.3-70-g09d2