diff options
Diffstat (limited to 'cholerab/knut/clients')
-rwxr-xr-x | cholerab/knut/clients/cnot/index | 22 | ||||
-rwxr-xr-x | cholerab/knut/clients/pidgin_speak/speak.py | 31 |
2 files changed, 53 insertions, 0 deletions
diff --git a/cholerab/knut/clients/cnot/index b/cholerab/knut/clients/cnot/index new file mode 100755 index 00000000..f276dd25 --- /dev/null +++ b/cholerab/knut/clients/cnot/index @@ -0,0 +1,22 @@ +#! /bin/sh +# +# cnot - cholerab live command line notification client, bitch! +# +# usage: [verbose=yes] cnot hostname [message...] +# +set -euf + +host="$1"; shift +port=42101 + +params="$*" + +flags=-sS + +if test "${verbose-no}" != no; then + flags="${flags+$flags }-v" +fi + +exec curl $flags -X PUT --data-binary @- "http://$host:$port" <<EOF +{"method":"clive","params":"$params","id":null} +EOF diff --git a/cholerab/knut/clients/pidgin_speak/speak.py b/cholerab/knut/clients/pidgin_speak/speak.py new file mode 100755 index 00000000..aeaa417f --- /dev/null +++ b/cholerab/knut/clients/pidgin_speak/speak.py @@ -0,0 +1,31 @@ +#!/usr/bin/python +import string +CNOT="../cnot/index %s %s" +host="pornocauster" +def speakOwn(account, receiver,message): + speak(account,receiver,message,"",""); +def speak(account, sender, message, conversation, flags): + bus = dbus.SessionBus() + obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject") + purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface") + import subprocess + message = message.replace("'",'"') + print message + #cmd = "espeak -v de '%s'" % message + cmd = CNOT % (host,message) + subprocess.call(cmd,shell=True) +import dbus, gobject + +from dbus.mainloop.glib import DBusGMainLoop +dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) +bus = dbus.SessionBus() + +bus.add_signal_receiver(speak, + dbus_interface="im.pidgin.purple.PurpleInterface", + signal_name="ReceivedImMsg") + +bus.add_signal_receiver(speakOwn, + dbus_interface="im.pidgin.purple.PurpleInterface", + signal_name="SentImMsg") +loop = gobject.MainLoop() +loop.run() |