Merge branch 'master' of git+ssh://github.com/adefaria/clearscm
[clearscm.git] / bin / shh
1 #!/bin/bash
2 touchfile=/opt/clearscm/data/shh
3
4 # This just toggles the creation of the /opt/clearscm/bin/shh file
5 if [ -f $touchfile ]; then
6   rm $touchfile
7   cp ~/.icons/ShhOff.png ~/.icons/Shh.png
8 else
9   # Stop currently playing audio
10   killall play 2> /dev/null
11   # Stop any Google TTS
12   if [ -f /tmp/simple_google_tts.pid ]; then
13     kill -9 $(cat /tmp/simple_google_tts.pid)
14   fi
15   # Clean up tmp
16   rm -rf /tmp/simple_google_tts.*
17   # Touch shh file
18   touch $touchfile
19   # Change the icon
20   cp ~/.icons/ShhOn.png ~/.icons/Shh.png
21 fi