File: osd-notify.txt

package info (click to toggle)
nut 2.4.3-1.1squeeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 5,816 kB
  • ctags: 5,658
  • sloc: ansic: 45,735; sh: 11,290; makefile: 668; python: 448; perl: 179
file content (86 lines) | stat: -rw-r--r-- 2,437 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Desc: Using upsmon to make On Screen Display (OSD) notification
File: osd-notify.txt
Date: 12 April 2003
Auth: Arnaud Quette <arnaud.quette@free.fr>

This document presents how to display NUT notification using
an On Screen Display (OSD) system.

It is a complement to Russell Kroll's pager.txt, which
can be found on NUT website, or in NUT source tree. Have
a look at this document before reading more.

Pre requisites
--------------

You must have a running NUT installation (driver, upsd and upsmon).
Refer, if necessary, to NUT documentation for installing
and configuring those.

You also need X OSD to be installed. You can either:
- get it on: http://www.ignavus.net/software.html
- Debian: apt-get install xosd-bin
- Mandrake: urpmi xosd
- Others RPM based: get and install xosd (for example, from
http://rpmfind.net/linux/rpm2html/search.php)

Creating osd-notify shell script
--------------------------------

X OSD provides a really nice program, called osd_cat.
For more information on osd_cat, look at its manpage.

For convenience, I've written a small script called
osd-notify which should be available with the present
file.

You can adjust osd-notify settings to match your needs.
In particular, you must put a valid font in "FONT".
Use xfontsel to find one.


Configuring upsmon to use osd-notify
------------------------------------

1) You need to set EXEC flags on the event you want to
be osd-displayed in upsmon.conf. For example

   NOTIFYFLAG ONBATT EXEC
   NOTIFYFLAG ONLINE EXEC

You can of course set other actions, like WALL or SYSLOG,
and other events. Look at upsmon.conf manual page.

2) Copy osd-notify somewhere on your system (/usr/local/bin
or whatever).

3) Test osd-notify script by calling:
$> osd-notify NUT

4) Tell upsmon where your script is

   NOTIFYCMD /path/to/osd-notify

Show time
---------

You need to adjust X11 access right to allow upsmon's
user to display OSD notification on your screen. This
is done with, from within a xterm, by using:

$> xhost +local:nutmon

Don't forget to adjust upsmon's user name according to
your system settings. This must match the value of the
"RUN_AS_USER" field in upsmon.conf

Now, restart upsmon, pull the plug, and see what happens...

For screenshots, have a look at X OSD website:
	http://www.ignavus.net/software.html

Conclusion
----------

What great things we can do with a small nut ;-)
Feel free to send me your comments and enhancements.