"""
-example of ~/.notifid.conf:
+example of ~/.notifyd.conf:
---------------------------
import os
import socket
import logging
import getopt
+import subprocess
default_hostname = 'localhost'
default_port = 1234
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):
- os.system(command % dict(msg = msg))
+ subprocess.call(command % dict(msg = msg))
return command_wrapper
def osd(msg):