BATSIGNAL(1) General Commands Manual BATSIGNAL(1)

batsignal - battery monitor daemon

batsignal [OPTIONS]

batsignal is a lightweight battery daemon written in C that notifies the user about battery states. It is intended for minimal window managers, but can be used in any environment that supports desktop notifications via libnotify.

Display help
Display version information
Run batsignal as background daemon
Check battery once and exit
Ignore missing battery errors
Cause notifications to expire
Disable desktop notifications
Battery warning LEVEL (default 15). 0 disables this level
Critical battery LEVEL (default 5). 0 disables this level
Battery danger LEVEL (default 2). 0 disables this level
Battery full LEVEL (default 0). 0 disables this level
Show a message when the battery begins charging or discharging
Show MESSAGE when battery is at warning level
Show MESSAGE when battery is at critical level
Run COMMAND when battery is at danger level
Show MESSAGE when battery is at full level
Show MESSAGE when battery is charging, if -p option is set
Show MESSAGE when battery is discharging, if -p option is set
Send each message using COMMAND
Battery device NAME - multiple batteries may be separated by commas (default BAT0)
Minimum number of SECONDS (default 60) to wait between battery checks. Settings SECONDS to 0 disables polling and waits for the USR1 signal before checking battery level. Prefixing SECONDS with a + (ex: -m +10) will force a check at SECONDS intervals, regardless of battery level.
App name used in notifications (default: batsignal)
Display specified ICON in notifications

Options can be passed to batsignal as command arguments or placed in a configuration file. Options from the configuration file will be applied first and then may be overridden by command line as arguments.

The configuration file should include option arguments as documented above, one argument per line. Lines beginning with # and empty lines are ignored. For example, to specify a warning level of 30 and run as a background daemon, the following configuration file could be used:

# Run in background
-b
# Use warning level of 30
-w
30

The following paths are checked in sequence for a configuration file:

BATSIGNAL_CONFIG environment variable (if present)
$HOME/.config/batsignal (or the config base specificed in XDG_CONFIG_HOME)
$HOME/.batsignal
/usr/local/etc/batsignal
/etc/batsignal

Sets the option configuration file path.
The base path for the XDG config directory. Used in the option file search.

batsignal responds to the following signals:

Sending the process SIGUSR1 will cause an immediate battery check to be performed.

In most cases, batsignal will perform fewer battery state checks while the battery is discharging and the level of charge is not near a warning level. This frequency is affected by the multiplier (-m) option and is never less than <multiplier> seconds. If the "full" level (-f) is set or charge/discharge messages are enabled (-p), batsignal will instead check the battery state every <multiplier> seconds regardless of level of charge.

If the "full" level (-f) is set, the battery full notification will be triggered at the given level of charge or when the battery status changes to full, whichever occurs first.

The message COMMAND passed with -M is a C printf-style format string. It can use two string placeholders (%s) that will be replaced by the message text and the current battery level. Be sure to test the command - invalid format strings may cause batsignal to crash.
Ex: -M "wall 'Battery warning: %s - Level is %s'"

Copyright 2018-2024 Corey Hinshaw
Copyright 2016-2017 Aaron Marcher
License: ISC License

batsignal-1.8.0