Gajim

From ArchWiki
Revision as of 19:38, 15 March 2015 by Alad (talk | contribs) (stub)
Jump to navigation Jump to search

From the project page

Gajim a full featured and easy to use Jabber/XMPP client

Auto logout on suspend

If you suspend your computer gajim stay connected for about 15 minutes. To prevent message loss, it is needed to set your status offline before suspending or hibernating. The status message won't be changed.

Therefore create a new systemd unit gajim-suspend@.serivce in /etc/systemd/system.

[Unit]
Description=Suspend Gajim
Before=sleep.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
User=%I
RemainAfterExit=yes
Environment=DISPLAY=:0
ExecStart=-/usr/bin/bash -c ". /home/%I/.dbus/session-bus/$(</var/lib/dbus/machine-id)-0 && /usr/bin/gajim-remote change_status offline"
ExecStop=/usr/bin/bash -c ". /home/%I/.dbus/session-bus/$(</var/lib/dbus/machine-id)-0 && /usr/bin/gajim-remote change_status online"

[Install]
WantedBy=sleep.target

Then enable it with systemctl enable gajim@<USER>, where USER is the login name.