summaryrefslogtreecommitdiff
path: root/ar/.local/bin/sysact
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-03-09 22:03:28 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-03-09 22:03:28 +0900
commit1853f713625558299d5e8982b9d2a8d0ff2dbc8d (patch)
treec089596b8c5052dd827c39813572b635c76d89f2 /ar/.local/bin/sysact
parent56df043d5906aac93e4345528c5f9a6541f5b14e (diff)
updates
Diffstat (limited to 'ar/.local/bin/sysact')
-rwxr-xr-xar/.local/bin/sysact12
1 files changed, 11 insertions, 1 deletions
diff --git a/ar/.local/bin/sysact b/ar/.local/bin/sysact
index 3706d2b..d4f3653 100755
--- a/ar/.local/bin/sysact
+++ b/ar/.local/bin/sysact
@@ -7,6 +7,16 @@ case "$(readlink -f /sbin/init)" in
*) ctl='loginctl' ;;
esac
+lock() {
+ mpc pause
+ pauseallmpv
+ wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
+ kill -39 "$(pidof dwmblocks)"
+ slock
+ wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
+ kill -39 "$(pidof dwmblocks)"
+}
+
wmpid() { # This function is needed if there are multiple instances of the window manager.
tree="$(pstree -ps $$)"
tree="${tree#*$WM(}"
@@ -14,7 +24,7 @@ wmpid() { # This function is needed if there are multiple instances of the windo
}
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 ;;
+'🔒 lock') lock ;;
"🚪 leave $WM") kill -TERM "$(wmpid)" ;;
"♻️ renew $WM") kill -HUP "$(wmpid)" ;;
'🐻 hibernate') slock $ctl hibernate -i ;;