Skip to content

Commit

Permalink
slightly rework the low battery level command, and change option to '…
Browse files Browse the repository at this point in the history
…o' instead of 'e'
  • Loading branch information
valr committed Apr 27, 2022
1 parent 6ee0438 commit be95f4f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Application Options:
-i, --icon-type Set icon type ('standard', 'notification' or 'symbolic')
-l, --low-level Set low battery level (in percent)
-r, --critical-level Set critical battery level (in percent)
-e, --command-low-level Command to execute when low battery level is reached
-o, --command-low-level Command to execute when low battery level is reached
-c, --command-critical-level Command to execute when critical battery level is reached
-x, --command-left-click Command to execute when left clicking on tray icon
-n, --hide-notification Hide the notification popups
Expand All @@ -47,8 +47,7 @@ Examples:
cbatticon -t
cbatticon -p
cbatticon -u 20 -i notification -c "poweroff" -l 15 -r 3
# if xbacklight is installed
cbatticon -u 20 -i notification -r 3 -c "poweroff" -l 15 -r "xbacklight = 5"
cbatticon -u 20 -i notification -r 3 -c "poweroff" -l 15 -o "xbacklight = 5"

Thanks to:

Expand Down
2 changes: 2 additions & 0 deletions cbatticon.1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Specify the low level percentage of the battery.
The default is set to 20%.
.IP "\fB-n\fP, \fB\-\-hide-notification\fP" 5
Hide the notification popups.
.IP "\fB\-o\fP, \fB\-\-command-low-level\fP \fIcommand\fR" 5
Specify the command to execute when the low battery level is reached.
.IP "\fB-p\fP, \fB\-\-list-power-supplies\fP" 5
List the available power supplies on your system.
.IP "\fB\-r\fP, \fB\-\-critical-level\fP \fIpercentage\fR" 5
Expand Down
2 changes: 1 addition & 1 deletion cbatticon.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static gint get_options (int argc, char **argv)
{ "icon-type" , 'i', 0, G_OPTION_ARG_STRING, &icon_type_string , N_("Set icon type ('standard', 'notification' or 'symbolic')") , NULL },
{ "low-level" , 'l', 0, G_OPTION_ARG_INT , &configuration.low_level , N_("Set low battery level (in percent)") , NULL },
{ "critical-level" , 'r', 0, G_OPTION_ARG_INT , &configuration.critical_level , N_("Set critical battery level (in percent)") , NULL },
{ "command-low-level" , 'e', 0, G_OPTION_ARG_STRING, &configuration.command_low_level , N_("Command to execute when low battery level is reached") , NULL },
{ "command-low-level" , 'o', 0, G_OPTION_ARG_STRING, &configuration.command_low_level , N_("Command to execute when low battery level is reached") , NULL },
{ "command-critical-level", 'c', 0, G_OPTION_ARG_STRING, &configuration.command_critical_level, N_("Command to execute when critical battery level is reached"), NULL },
{ "command-left-click" , 'x', 0, G_OPTION_ARG_STRING, &configuration.command_left_click , N_("Command to execute when left clicking on tray icon") , NULL },
#ifdef WITH_NOTIFY
Expand Down

0 comments on commit be95f4f

Please sign in to comment.