-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbattmond.1
63 lines (63 loc) · 1.88 KB
/
battmond.1
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
.\"
.\" $Id: battmond.1 54 2006-09-08 13:12:05Z ntarmos $
.\"
.Dd Sep 20, 2019
.Dt BATTMOND 1
.Os
.Sh NAME
.Nm battmond
.Nd monitor battery level on ACPI-enabled (laptop) computers
.Sh SYNOPSIS
.Nm battmond
.Op Fl d Ar device
.Op Fl i Ar interval
.Op Fl W Ar warning
.Op Fl H Ar halt
.Op Fl z
.Op Fl h
.Sh DESCRIPTION
.Nm battmond
monitors the battery level on your ACPI-enabled (laptop) computer.
Battmond probes your battery level in predefined intervals. When the
battery level is running low it writes a warning message to the syslog.
On critical level, it powers the computer down. Both levels and the
probe interval can be configured on the command line.
.Pp
.Nm battmond
probes the battery level through the ACPIIO_BATT_GET_BATTINFO ioctl(2)
on
.Ar /dev/acpi .
.Nm -d
option allows for defining a different device, although you shouldn't
(probably) need it. Probes are performed in regular intervals of 10
seconds. This value can be tweaked through the
.Nm -i
option. When the computer is on battery (i.e. there is a battery present
and no power cord is connected),
.Nm battmond
checks the battery level against two values: the
.Ar warning
and the
.Ar halt
threshold. If the battery level goes below the former, a warning is sent
to the syslog with a priority of LOG_ALERT. If it goes below the latter,
.Nm battmond
initiates a system shutdown, through a call to /sbin/halt. The warning
and halt thresholds can be tuned using the
.Nm -W
and
.Nm -H
options respectively. Values are expressed in percentage of maximum
charge, with default values being 10 (%) for the warning message and 5
(%) for the system halt. Using the
.Nm -z
option will switch the behaviour of the program to suspend the computer
instead of shutting it down. Finally,
.Nm -h
prints a brief help message to the stderr and terminates the program.
.Sh SEE ALSO
.Xr acpi 1 ,
.Xr acpiconf 8 ,
.Xr ioctl 2
.Sh AUTHOR
Nikos Ntarmos <ntarmos@gmail.com>