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

20
README
View File

@ -6,7 +6,7 @@ NAME
btw - battery watchdog btw - battery watchdog
SYNOPSIS 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] [-j|--syslog] [-s|--summary text] [-b|--body text] [-w|--watch]
btw --help btw --help
btw --version btw --version
@ -21,15 +21,17 @@ OPTIONS
-h, --help -h, --help
Print this help message and exit. Print this help message and exit.
-c, --crit value -c, --crit level
Battery critical value in percents [default: 10] Battery critical level in percents [default: 10]
-p, --preriod seconds -p, --preriod seconds
Battery check out period in seconds [default: 30] Battery check out period in seconds [default: 30]
-l, --log file -l, --log file
Log file [default: ~/.cache/btw.log] -j, --syslog Use logger in- Log file [default: ~/.cache/btw.log]
stead of log file.
-j, --syslog
Use logger instead of log file.
-s, --summary text -s, --summary text
Custom notification title text. Custom notification title text.
@ -41,7 +43,7 @@ OPTIONS
Follow to the log file (tail -f). Follow to the log file (tail -f).
INVOKING INVOKING
Run watchdog in background. See application autostart options for your Run watchdog in background. See application autostart options for your
desktop environment or init system. For example add in your ~/.xinitrc: desktop environment or init system. For example add in your ~/.xinitrc:
btw & btw &
@ -79,13 +81,13 @@ LOGGING
EXAMPLES EXAMPLES
btw will send notification at every battery checkout while current bat- 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: command:
btw -c 15 -p 30 btw -c 15 -p 30
you will recieve notification every 30 seconds until battery is under 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. options.
Variables can be used in notification: 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. "btw - battery watchdog. Send notification when critical battery level reached.
Usage: 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] [-l|--log \033[4mfile\033[0m]
[-j|--syslog] [-s|--summary t\033[4mext\033[0m] \ [-j|--syslog] [-s|--summary \033[4mtext\033[0m] \
[-b|--body t\033[4mext\033[0m] [-w|--watch] [-b|--body \033[4mtext\033[0m] [-w|--watch]
btw --help btw --help
btw --version btw --version
@ -58,8 +58,8 @@ Options:
-h, --help -h, --help
Print this help message and exit. Print this help message and exit.
-c, --crit \033[4mvalue\033[0m -c, --crit \033[4mlevel\033[0m
Battery critical value in percents [default: 10] Battery critical level in percents [default: 10]
-p, --preriod \033[4mseconds\033[0m -p, --preriod \033[4mseconds\033[0m
Battery check out period in seconds [default: 30] Battery check out period in seconds [default: 30]

11
btw.1
View File

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