Next: , Previous: Useful features, Up: Useful features


10.1 Autoaway

It is possible to automatically set your status to “away” when you haven't used your computer for a while. This lets your contacts know that you might not answer immediately.

To activate this feature, add jabber-autoaway-start to jabber-post-connect-hooks, e.g:

     (add-hook 'jabber-post-connect-hooks 'jabber-autoaway-start)

There are different methods to find how long you have been “idle”. The method to use is specified by jabber-autoaway-method. The value of this variable should be a function that returns the number of seconds you have been idle. Three functions are provided.

If your Emacs has the current-idle-time function (which was introduced in Emacs 22), it is used by default. Note that this method only measures the time since you last interacted with Emacs, and thus disregards activity in other programs.

If you are using the X Window System, you can use the xprintidle program.1 Make sure that jabber-xprintidle-program is set to the correct file name. This uses the same method as XScreensaver to find your idle time.

If you use the xscreensaver program, you can use the xscreensaver-emacs-jabber Perl script to synchronize xscreensaver and jabber.el status. It is a simple Perl daemon that watches for xscreensaver status and sets jabber.el's presence when needed. I.e.: it sets XA presence when the screen is blanked or locked (by hands or by idle timeout) and default presence when it's unlocked/unblanked. To use it, just run xscreensaver-emacs-jabber after xscreensaver and make sure that your Emacs run in server mode (that you run (server-start) in init files; see Using Emacs as a Server. Alternatively, you can turn on and off server-mode by jabber.el's hooks).

If you are using Emacs on a GNU/Linux terminal, the function jabber-termatime-get-idle-time is used by default. It uses the access time of the terminal device as a measure of idle time.


Footnotes

[1] http://www.dtek.chalmers.se/~henoch/text/xprintidle.html