diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-01-16 15:05:46 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-01-16 15:05:46 +0100 |
commit | a285a64feee467d211744665f9b9b33568f117ab (patch) | |
tree | f68cc264c48a77501cf5f381b2bd3641dd4034c3 | |
parent | b0552979200bda4f2006977d8b7baef0599e74e3 (diff) |
Add popupgrade script
-rwxr-xr-x | .local/bin/statusbar/sb-popupgrade | 9 | ||||
-rwxr-xr-x | .local/bin/sysact | 16 |
2 files changed, 25 insertions, 0 deletions
diff --git a/.local/bin/statusbar/sb-popupgrade b/.local/bin/statusbar/sb-popupgrade new file mode 100755 index 0000000..dd5322f --- /dev/null +++ b/.local/bin/statusbar/sb-popupgrade @@ -0,0 +1,9 @@ +#!/bin/sh + +printf "Beginning upgrade.\\n" + +paru -Syu +pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}" + +printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n" +read -r _ 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 |