From b9581bfa0e37aafedf42ccbb1c514b572aa0d8d3 Mon Sep 17 00:00:00 2001 From: Andrew DeFaria Date: Wed, 5 Jan 2022 12:05:44 -0800 Subject: [PATCH] Fixed shh to use different location for shh touchfile Otherwise the script removes itself! --- bin/shh | 7 ++++--- lib/Speak.pm | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/shh b/bin/shh index f70c361..c020f98 100755 --- a/bin/shh +++ b/bin/shh @@ -1,13 +1,14 @@ #!/bin/bash timeout=5000 # 5 seconds +touchfile=/opt/clearscm/data/shh # This just toggles the creation of the /opt/clearscm/bin/shh file -if [ -f /opt/clearscm/bin/shh ]; then - rm /opt/clearscm/bin/shh +if [ -f $touchfile ]; then + rm $touchfile cp ~/.icons/ShhOff.png ~/.icons/Shh.png notify-send -t $timeout "Announcements turned on" else - touch /opt/clearscm/bin/shh + touch $touchfile cp ~/.icons/ShhOn.png ~/.icons/Shh.png # Note that a -t 0 will keep the notification up. This way we can # be visually reminded that we are not receiving audio announcements diff --git a/lib/Speak.pm b/lib/Speak.pm index dd38346..7003f20 100644 --- a/lib/Speak.pm +++ b/lib/Speak.pm @@ -103,8 +103,8 @@ Returns: =cut - if (-f "$FindBin::Bin/shh") { - $msg .= ' [silent]'; + if (-f "$FindBin::Bin/../data/shh") { + $msg .= ' [silent shh]'; if ($log) { $log->msg($msg); } else { -- 2.17.1