From: Christian Heller <c.heller@plomlompom.de>
Date: Fri, 21 Mar 2025 18:24:38 +0000 (+0100)
Subject: More refactoring.
X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/process_descriptions?a=commitdiff_plain;h=1884d832c52b0d32c2fa88f94aeb111270027cf9;p=config

More refactoring.
---

diff --git a/testing/home/all/.profile b/testing/home/all/.profile
index 1039ec7..fb0e2a4 100644
--- a/testing/home/all/.profile
+++ b/testing/home/all/.profile
@@ -7,6 +7,7 @@
 # useful for providing environment variables to non-shell applications started
 # within a login session.
 
+# for: dot_shell_file_variants
 . "${HOME}"/.nonpath_bins/plomlib.sh
 
 eval $(ssh-agent) && ssh-add
diff --git a/testing/home/desktop/.local/bin/vol b/testing/home/desktop/.local/bin/vol
index ddc5598..baa6936 100755
--- a/testing/home/desktop/.local/bin/vol
+++ b/testing/home/desktop/.local/bin/vol
@@ -1,6 +1,9 @@
 #!/bin/sh
 set -e
 
+# for: audio_dev_is_mute
+. "${HOME}/.nonpath_bins/plomlib.sh"
+
 MAX_LOUDNESS=150
 
 BIN_NAME="$(basename $0)"
@@ -21,12 +24,8 @@ error_exit() {
     exit 1
 }
 
-dev_is_mute() {
-    [ "$(pactl get-sink-mute 0)" = "Mute: yes" ]
-}
-
 toggle_mute() {
-    if dev_is_mute; then
+    if audio_dev_is_mute; then
         MUTE_BOOL=0
         MUTE_WORD=off
     else
diff --git a/testing/home/desktop/.nonpath_bins/plomlib.sh.desktop b/testing/home/desktop/.nonpath_bins/plomlib.sh.desktop
index 43e9aca..556fbb4 100644
--- a/testing/home/desktop/.nonpath_bins/plomlib.sh.desktop
+++ b/testing/home/desktop/.nonpath_bins/plomlib.sh.desktop
@@ -6,3 +6,7 @@ get_passphrase() {
     echo "" # newline so user knows their input return was accepted
 }
 
+audio_dev_is_mute() {
+    [ "$(pactl get-sink-mute 0)" = "Mute: yes" ]
+}
+
diff --git a/testing/home/t490s/.nonpath_bins/status.sh b/testing/home/t490s/.nonpath_bins/status.sh
index 1363bf6..4aee19e 100755
--- a/testing/home/t490s/.nonpath_bins/status.sh
+++ b/testing/home/t490s/.nonpath_bins/status.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 # see sway-bar(5) and swaybar-protocol(7)
 
+# for: audio_dev_is_mute
+. "${HOME}/.nonpath_bins/plomlib.sh"
+
 SYSCLASS_DIR=/sys/class
 
 COL_WHITE=dddddd
@@ -134,10 +137,10 @@ print_datetime() {
 print_volume() {
     print_bar_block "vol " '' 0
     VOLUME="$(pactl get-sink-volume 0 | head -1 | sed 's/ //g' | cut -d'/' -f2)"
-    if [ "$(pactl get-sink-mute 0)" = "Mute: no" ]; then
-        print_bar_block "${VOLUME}" "${COL_YELLOW}"
-    else
+    if audio_dev_is_mute; then
         print_bar_block "<s>${VOLUME}</s>"
+    else
+        print_bar_block "${VOLUME}" "${COL_YELLOW}"
     fi
 }