]> git.neil.brown.name Git - plato.git/commitdiff
lock: volume=0 much mean no sound.
authorNeilBrown <neilb@suse.de>
Thu, 19 Dec 2013 23:07:04 +0000 (10:07 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 19 Dec 2013 23:07:04 +0000 (10:07 +1100)
Telling sound server the volume is zero doesn't work.

utils/lock.py

index f627608184aa562108070306cbfd7684d835c309..4f68d8d1247c344848b4c94ea9a067abce10b7cd 100755 (executable)
@@ -106,6 +106,7 @@ def do_alert(event, who):
     n = '/run/sound/10-alert'
     if 'tone' in p and p['tone']:
         path = p['tone']
+        v = 10
         if 'volume' in p:
             v = int(p['volume'])
             if v < 10:
@@ -113,7 +114,8 @@ def do_alert(event, who):
         if path[0] != '/':
             path = os.path.join("/usr/share/openmoko/sounds",path)
         try:
-            os.symlink(path, n)
+            if v > 0:
+                os.symlink(path, n)
         except:
             pass
     if 'vib' in p and p['vib']: