projects
/
grml-scripts.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release new version 2.8.2
[grml-scripts.git]
/
usr_bin
/
notifyd.py
diff --git
a/usr_bin/notifyd.py
b/usr_bin/notifyd.py
index
cf94ee6
..
312c9b0
100755
(executable)
--- a/
usr_bin/notifyd.py
+++ b/
usr_bin/notifyd.py
@@
-20,7
+20,7
@@
"""
"""
-example of ~/.notif
i
d.conf:
+example of ~/.notif
y
d.conf:
---------------------------
import os
---------------------------
import os
@@
-47,6
+47,7
@@
import string
import socket
import logging
import getopt
import socket
import logging
import getopt
+import subprocess
default_hostname = 'localhost'
default_port = 1234
default_hostname = 'localhost'
default_port = 1234
@@
-58,12
+59,13
@@
default_logfile = None
def play(sound_file):
def play_wrapper(msg):
def play(sound_file):
def play_wrapper(msg):
- os.system('/usr/bin/aplay "%s" 2> /dev/null &' % sound_file)
+ with open(os.devnull, 'w') as devnull:
+ subprocess.Popen(['/usr/bin/aplay', sound_file], stderr=devnull)
return play_wrapper
def execute(command):
def command_wrapper(msg):
return play_wrapper
def execute(command):
def command_wrapper(msg):
-
os.system
(command % dict(msg = msg))
+
subprocess.call
(command % dict(msg = msg))
return command_wrapper
def osd(msg):
return command_wrapper
def osd(msg):