Fixed shh to use different location for shh touchfile
authorAndrew DeFaria <Andrew@DeFaria.com>
Wed, 5 Jan 2022 20:05:44 +0000 (12:05 -0800)
committerAndrew DeFaria <Andrew@DeFaria.com>
Wed, 5 Jan 2022 20:05:44 +0000 (12:05 -0800)
Otherwise the script removes itself!

bin/shh
lib/Speak.pm

diff --git a/bin/shh b/bin/shh
index f70c361..c020f98 100755 (executable)
--- a/bin/shh
+++ b/bin/shh
@@ -1,13 +1,14 @@
 #!/bin/bash
 timeout=5000 # 5 seconds
 #!/bin/bash
 timeout=5000 # 5 seconds
+touchfile=/opt/clearscm/data/shh
 
 # This just toggles the creation of the /opt/clearscm/bin/shh file
 
 # 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
   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
   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
index dd38346..7003f20 100644 (file)
@@ -103,8 +103,8 @@ Returns:
 
 =cut
 
 
 =cut
 
-  if (-f "$FindBin::Bin/shh") {
-    $msg .= ' [silent]';
+  if (-f "$FindBin::Bin/../data/shh") {
+    $msg .= ' [silent shh]';
     if ($log) {
       $log->msg($msg);
     } else {
     if ($log) {
       $log->msg($msg);
     } else {