home · contact · privacy
More refactoring. master
authorChristian Heller <c.heller@plomlompom.de>
Fri, 21 Mar 2025 18:24:38 +0000 (19:24 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 21 Mar 2025 18:24:38 +0000 (19:24 +0100)
testing/home/all/.profile
testing/home/desktop/.local/bin/vol
testing/home/desktop/.nonpath_bins/plomlib.sh.desktop
testing/home/t490s/.nonpath_bins/status.sh

index 1039ec77d6d9f9f2b48a931201c29b43c467727f..fb0e2a43053b6028507afcef4c139c039afdf918 100644 (file)
@@ -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
index ddc5598450043fcfbdcf7165bc66bdbb11c63d77..baa6936097140aeaa11d3b82fe3208f256b492ed 100755 (executable)
@@ -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
index 43e9acafd860b2e5642d19570819ba961d57a82e..556fbb4fc998d2086ae816698e58520a9f8406d1 100644 (file)
@@ -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" ]
+}
+
index 1363bf6d82b708ea091ae3c0fbe522a498ac94d8..4aee19e8c281a14fddc5120bffdb9658ed2196ca 100755 (executable)
@@ -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
 }