Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zenhack/battstat
A simple battery monitor with libnotify support (Abandoned)
https://github.com/zenhack/battstat
Last synced: 16 days ago
JSON representation
A simple battery monitor with libnotify support (Abandoned)
- Host: GitHub
- URL: https://github.com/zenhack/battstat
- Owner: zenhack
- License: isc
- Created: 2013-07-17T00:18:29.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-07-17T00:33:28.000Z (over 11 years ago)
- Last Synced: 2024-10-22T07:03:01.569Z (2 months ago)
- Language: C
- Homepage:
- Size: 109 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
Battstat is a simple battery monitor that I wrote for use with [dwm][1] and
[dunst][2], though it should be easy enough to use it with other window managers
and notification daemons. It reports the status of the battery continuously,
and provides low battery notifications via the notification daemon.# Building
make
# Installing
cp battstat $somewhere_in_your_path
# Usage
When run, Battstat repeatedly outputs the status of the battery. It will look
something like:Charging (51%)
Or
Discharging (32%), 1:05:23
A new status line should come in roughly once per second. In my case, I have
the following in my .xinitrc:battstat | while read battinfo; do
xsetroot -name "$(show-weather.sh) | $battinfo | $(date +'%a %d %h, %I:%M %p')"
done &Which puts the battery status, along with some other information, in the
dwm status bar (which just displays the root window's name). If you're using
another window manager, you will have to find your own way to display the
status.Battstat will also emit two warnings to the running notification daemon (if
any), When the battery has less than 20 minutes remaining, and again when it
has less than 5 minutes remaining. It's worth noting that Battstat does not
link against libnotify, rather it invokes the notify-send command to send
messages instead (The libnotify api is much more complex to use than the cli).# License
ISC, see COPYING.
[1]: http://dwm.suckless.org
[2]: http://www.knopwob.org/dunst