How can I set/change my status (like Available/Busy/Away) in Pidgin instant messenger from the command line? I needed this to make sure that my status changes to 'Away' whenever I lock my screen. I installed the 'awayonlock' plugin, but it doesn't seem to work with MATE desktop environment.
Asked
Active
Viewed 1,435 times
2
-
Something like: `$pidgin-client --state "dont_disturb" --text-state "Meeting from 11:00 to 12:00 at B55 room"` – Goran.it Sep 15 '17 at 12:14
-
@Goran.it : I don't have any program called 'pidgin-client' in my Debian 8 machine. The ones I have are 'pidgin' and 'pidgin.orig'. I tried your command with both these and it doesn't seem to work. – Jerry George Sep 15 '17 at 12:22
-
2Maybe you could try `purple-remote "setstatus?status=away&message=AFK"` .. I'm not sure which programs gets installed with pidgin on ubuntu .. From what I've read purple-remote should do the trick, you can read more about that here : http://www.commandlinefu.com/commands/view/4554/change-pidgin-status – Goran.it Sep 15 '17 at 16:18
1 Answers
0
I was able to create a simple python script to do this:
set_im_status.py
#!/usr/local/bin/python
import sys
import dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop
dbus_loop = DBusGMainLoop()
bus = dbus.SessionBus(mainloop=dbus_loop)
dbus_obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
purple = dbus.Interface(dbus_obj, "im.pidgin.purple.PurpleInterface")
status = sys.argv[1]
# Available
if status == "a":
status_id = dbus.String(u'available')
# Busy
elif status == "b":
status_id = dbus.String(u'unavailable')
# Away
elif status == "w":
status_id = dbus.String(u'away')
# Invisible
elif status == "i":
status_id = dbus.String(u'invisible')
# Offline
elif status == "f":
status_id = dbus.String(u'offline')
else:
status_id = dbus.String(u'available')
status_type = purple.PurplePrimitiveGetTypeFromId(status_id)
saved = purple.PurpleSavedstatusNew("", status_type)
purple.PurpleSavedstatusActivate(saved)
Now to set the status to 'Busy', run: % python set_im_status.py b

Jerry George
- 21
- 5