]> crepu.dev Git - config.git/blame_incremental - djavu-asus/emacs/elpa/jabber-20230715.456/jabber-wmii.el
Reorganización de directorios
[config.git] / djavu-asus / emacs / elpa / jabber-20230715.456 / jabber-wmii.el
... / ...
CommitLineData
1;; jabber-wmii.el - emacs-jabber interface to wmii -*- lexical-binding: t; -*-
2
3;; Copyright (C) 2007 - Detlev Zundel - dzu@gnu.org
4
5;; This file is a part of jabber.el.
6
7;; This program is free software; you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation; either version 2 of the License, or
10;; (at your option) any later version.
11
12;; This program is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with this program; if not, write to the Free Software
19;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
21(eval-when-compile (require 'jabber-alert))
22
23(defvar jabber-wmii-color "#ffffff #335577 #447799"
24 "Color specification as needed by the wmii window manager for the jabber alert messages.")
25
26(defvar jabber-wmii-reset-time "20 sec"
27 "If non-nil time to reset wmii message. If nil the message has to be cleared by other means, i.e. from wmiirc.")
28
29(defvar jabber-wmii-timer nil
30 "Timer to clear wmii message.")
31
32(defun jabber-wmii-clear ()
33 "Clear any previous message output through wmii window manager."
34 (condition-case e
35 (call-process "wmiir" nil nil nil "remove" "/rbar/jabber")
36 (error nil)))
37
38(defun jabber-wmii-message (text &optional title)
39 "Show MSG in wmii."
40 (when jabber-wmii-timer
41 (cancel-timer jabber-wmii-timer))
42 (let ((tmp (make-temp-file temporary-file-directory)))
43 (with-temp-file tmp
44 (insert jabber-wmii-color " " (or title text)))
45 ;; Possible errors include not finding the wmiir binary, and
46 ;; too many pipes open because of message flood.
47 (condition-case e
48 (call-process "wmiir" tmp nil nil "create" "/rbar/jabber")
49 (error nil))
50 (delete-file tmp))
51 (when jabber-wmii-reset-time
52 (setq jabber-wmii-timer
53 (run-at-time jabber-wmii-reset-time nil 'jabber-wmii-clear))))
54
55(define-jabber-alert wmii "Show a message through the wmii window manager."
56 'jabber-wmii-message)
57
58(provide 'jabber-wmii)