summaryrefslogtreecommitdiff
path: root/scripts/lib/lib_handle.sh
diff options
context:
space:
mode:
authorSuleyman Farajli <suleyman@farajli.net>2025-11-25 19:40:13 +0400
committerSuleyman Farajli <suleyman@farajli.net>2025-11-25 19:40:13 +0400
commite071061ca38bc648184d43898a36589a30494ff5 (patch)
tree1eb6a81c9b09b96f086cb44bcce92ffd229b7a19 /scripts/lib/lib_handle.sh
parentf1ac6e645ace0f5f014cce85578e55ad356345ba (diff)
docs(lib scripts): updated
Diffstat (limited to 'scripts/lib/lib_handle.sh')
-rw-r--r--scripts/lib/lib_handle.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/lib/lib_handle.sh b/scripts/lib/lib_handle.sh
index d4524d9..5bc9aa3 100644
--- a/scripts/lib/lib_handle.sh
+++ b/scripts/lib/lib_handle.sh
@@ -1,6 +1,18 @@
#!/bin/sh
+
. "lib_common.sh"
+# This script defines a set of “*_handle” helper functions used to control
+# system features.
+#
+# Each handler uses an external program and centralizes these calls
+# here so they can be easily swapped or replaced in one location if
+# you decide to use different tools later.
+#
+# Each function expects a first argument selecting an action, followed by
+# any required parameters. They provide a simple, unified interface for
+# controlling desktop-related functionality from other scripts.
+
volume_handle() {
case "${1}" in
"up") pactl set-sink-volume @DEFAULT_SINK@ +"${2}"% ;;
@@ -111,7 +123,9 @@ notify_handle() {
case "${1}" in
"reload") xsetroot -name "fsignal:1" ;;
"send")
- echo "${2}" > /tmp/noti.fifo
+ # Avoid Hanging
+ printf "%s\n" "${2}" |
+ dd of=/tmp/noti.fifo oflag=nonblock 2>/dev/null
shift 2
printf "%s\n" "$*" > /tmp/noti.txt
xsetroot -name "fsignal:1"