This commit is contained in:
ge 2022-11-10 23:07:39 +03:00
parent 1dd1522e5b
commit 837a431cbe
3 changed files with 22 additions and 19 deletions

16
README
View File

@ -6,7 +6,7 @@ NAME
btw - battery watchdog
SYNOPSIS
btw [-c|--crit value] [-p|--preriod seconds] [-l|--log file]
btw [-c|--crit level] [-p|--preriod seconds] [-l|--log file]
[-j|--syslog] [-s|--summary text] [-b|--body text] [-w|--watch]
btw --help
btw --version
@ -21,15 +21,17 @@ OPTIONS
-h, --help
Print this help message and exit.
-c, --crit value
Battery critical value in percents [default: 10]
-c, --crit level
Battery critical level in percents [default: 10]
-p, --preriod seconds
Battery check out period in seconds [default: 30]
-l, --log file
Log file [default: ~/.cache/btw.log] -j, --syslog Use logger in-
stead of log file.
Log file [default: ~/.cache/btw.log]
-j, --syslog
Use logger instead of log file.
-s, --summary text
Custom notification title text.
@ -79,13 +81,13 @@ LOGGING
EXAMPLES
btw will send notification at every battery checkout while current bat-
tery level is lower than critical value. For example, with following
tery level is lower than critical level. For example, with following
command:
btw -c 15 -p 30
you will recieve notification every 30 seconds until battery is under
10%. You can set up custom notification text via --summary and --body
15%. You can set up custom notification text via --summary and --body
options.
Variables can be used in notification:

10
btw
View File

@ -44,10 +44,10 @@ print_help() {
"btw - battery watchdog. Send notification when critical battery level reached.
Usage:
btw [-c|--crit \033[4mvalue\033[0m] [-p|--preriod \033[4mseconds\033[0m] \
btw [-c|--crit \033[4mlevel\033[0m] [-p|--preriod \033[4mseconds\033[0m] \
[-l|--log \033[4mfile\033[0m]
[-j|--syslog] [-s|--summary t\033[4mext\033[0m] \
[-b|--body t\033[4mext\033[0m] [-w|--watch]
[-j|--syslog] [-s|--summary \033[4mtext\033[0m] \
[-b|--body \033[4mtext\033[0m] [-w|--watch]
btw --help
btw --version
@ -58,8 +58,8 @@ Options:
-h, --help
Print this help message and exit.
-c, --crit \033[4mvalue\033[0m
Battery critical value in percents [default: 10]
-c, --crit \033[4mlevel\033[0m
Battery critical level in percents [default: 10]
-p, --preriod \033[4mseconds\033[0m
Battery check out period in seconds [default: 30]

11
btw.1
View File

@ -6,7 +6,7 @@
btw \- battery watchdog
.SH SYNOPSIS
.SY btw
.OP \-c|\-\-crit value
.OP \-c|\-\-crit level
.OP \-p|\-\-preriod seconds
.OP \-l|\-\-log file
.OP \-j|\-\-syslog
@ -28,14 +28,15 @@ Print version and exit.
\fB\-h\fR, \fB\-\-help\fR
Print this help message and exit.
.TP
\fB\-c\fR, \fB\-\-crit\fR \fIvalue\fR
Battery critical value in percents [default: 10]
\fB\-c\fR, \fB\-\-crit\fR \fIlevel\fR
Battery critical level in percents [default: 10]
.TP
\fB\-p\fR, \fB\-\-preriod\fR \fIseconds\fR
Battery check out period in seconds [default: 30]
.TP
\fB\-l\fR, \fB\-\-log\fR \fIfile\fR
Log file [default: ~/.cache/btw.log]
.TP
\fB\-j\fR, \fB\-\-syslog\fR
Use logger instead of log file.
.TP
@ -103,7 +104,7 @@ journalctl -t btw -f
.SH EXAMPLES
.B btw
will send notification at every battery checkout while current battery
level is lower than critical value. For example, with following command:
level is lower than critical level. For example, with following command:
.PP
.in +4m
.EX
@ -111,7 +112,7 @@ btw -c 15 -p 30
.EE
.in
.PP
you will recieve notification every 30 seconds until battery is under 10%.
you will recieve notification every 30 seconds until battery is under 15%.
You can set up custom notification text via --summary and --body options.
.PP
Variables can be used in notification: