Skip to content

Latest commit

 

History

History
53 lines (33 loc) · 812 Bytes

README.md

File metadata and controls

53 lines (33 loc) · 812 Bytes

a simple battery monitor cron tool

I wondered how quickly my laptop battery deteriorates over time. This little tool creates a sqlite database and records battery values from /sys/class/power_supply.

For convencience a simple dump method is included.

install

go get github.com/krysopath/watchmon
go install github.com/krysopath/watchmon

Get the binary and build it.

crontab -e

Open the crontab editor

 */N * * * * $HOME/go/bin/watchmon | logger

Adapt the N to set how many minutes between executions should pass. Also check the PATH.

Lastly:

watchmon -dbcreate

Creates the sqlite file

dump

watchmon -dump

shells with benefits

To enable <TAB><TAB> madness, run bash with bash-completions and source:

. watchmon-completion