But no more!
You will need this and this:
#! /usr/bin/env python
from dbus.mainloop.glib import DBusGMainLoop
import dbus
import socket
import gobject
DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
def handler(locked):
client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
client.connect("/tmp/irssi_socket")
if locked:
client.send("command /away afk")
else:
client.send("command /away")
print client.recv(1024)
client.close()
bus.add_signal_receiver(handler, dbus_interface = "org.gnome.ScreenSaver", signal_name="ActiveChanged")
gobject.MainLoop().run()
Just install the Perl script into irssi, and then run this python service somewhere in your desktop session. Any time your screensaver turns on, you'll go away.
1 comments:
Very cool. I wonder if it works when you are using irssi across ssh which is how I always use it. Will have to experiment with it tonight.
Post a Comment