cdown / battery-notify Goto Github PK
View Code? Open in Web Editor NEWA simple battery notifier for Linux.
License: MIT License
A simple battery notifier for Linux.
License: MIT License
Right now if you pass --help or --version it just launches anyway, this is a bit weird.
This needs some more thinking, because we also need to handle what to do if Instant::now() is too low. Maybe always just bump it by sleep_backoff?
Seems fairly likely the anti drift isn't working right:
May 05 11:31:05 roujiamo sh[266462]: [2023-05-05T10:31:05Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39330000, full_uwh: 56970000 }]
May 05 11:31:05 roujiamo sh[266462]: [2023-05-05T10:31:05Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39330000, full_uwh: 56970000 }
May 05 11:31:05 roujiamo sh[266462]: [2023-05-05T10:31:05Z INFO battery_notify] Bluetooth battery status: []
May 05 11:33:05 roujiamo sh[266462]: [2023-05-05T10:33:05Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:33:05 roujiamo sh[266462]: [2023-05-05T10:33:05Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:33:06 roujiamo sh[266462]: [2023-05-05T10:33:05Z INFO battery_notify] Bluetooth battery status: []
May 05 11:35:06 roujiamo sh[266462]: [2023-05-05T10:35:06Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:35:06 roujiamo sh[266462]: [2023-05-05T10:35:06Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:35:06 roujiamo sh[266462]: [2023-05-05T10:35:06Z INFO battery_notify] Bluetooth battery status: []
May 05 11:37:06 roujiamo sh[266462]: [2023-05-05T10:37:06Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:37:06 roujiamo sh[266462]: [2023-05-05T10:37:06Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:37:06 roujiamo sh[266462]: [2023-05-05T10:37:06Z INFO battery_notify] Bluetooth battery status: []
May 05 11:39:06 roujiamo sh[266462]: [2023-05-05T10:39:06Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:39:06 roujiamo sh[266462]: [2023-05-05T10:39:06Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:39:06 roujiamo sh[266462]: [2023-05-05T10:39:06Z INFO battery_notify] Bluetooth battery status: []
May 05 11:41:06 roujiamo sh[266462]: [2023-05-05T10:41:06Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:41:06 roujiamo sh[266462]: [2023-05-05T10:41:06Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:41:06 roujiamo sh[266462]: [2023-05-05T10:41:06Z INFO battery_notify] Bluetooth battery status: []
May 05 11:43:06 roujiamo sh[266462]: [2023-05-05T10:43:06Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:43:06 roujiamo sh[266462]: [2023-05-05T10:43:06Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:43:06 roujiamo sh[266462]: [2023-05-05T10:43:06Z INFO battery_notify] Bluetooth battery status: []
May 05 11:45:06 roujiamo sh[266462]: [2023-05-05T10:45:06Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:45:06 roujiamo sh[266462]: [2023-05-05T10:45:06Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:45:06 roujiamo sh[266462]: [2023-05-05T10:45:06Z INFO battery_notify] Bluetooth battery status: []
May 05 11:47:06 roujiamo sh[266462]: [2023-05-05T10:47:06Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:47:06 roujiamo sh[266462]: [2023-05-05T10:47:06Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:47:06 roujiamo sh[266462]: [2023-05-05T10:47:06Z INFO battery_notify] Bluetooth battery status: []
May 05 11:49:06 roujiamo sh[266462]: [2023-05-05T10:49:06Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:49:06 roujiamo sh[266462]: [2023-05-05T10:49:06Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:49:06 roujiamo sh[266462]: [2023-05-05T10:49:06Z INFO battery_notify] Bluetooth battery status: []
May 05 11:51:06 roujiamo sh[266462]: [2023-05-05T10:51:06Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:51:06 roujiamo sh[266462]: [2023-05-05T10:51:06Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:51:06 roujiamo sh[266462]: [2023-05-05T10:51:06Z INFO battery_notify] Bluetooth battery status: []
May 05 11:53:06 roujiamo sh[266462]: [2023-05-05T10:53:06Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:53:06 roujiamo sh[266462]: [2023-05-05T10:53:06Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:53:06 roujiamo sh[266462]: [2023-05-05T10:53:06Z INFO battery_notify] Bluetooth battery status: []
May 05 11:55:06 roujiamo sh[266462]: [2023-05-05T10:55:06Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:55:06 roujiamo sh[266462]: [2023-05-05T10:55:06Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:55:06 roujiamo sh[266462]: [2023-05-05T10:55:06Z INFO battery_notify] Bluetooth battery status: []
May 05 11:57:06 roujiamo sh[266462]: [2023-05-05T10:57:06Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:57:06 roujiamo sh[266462]: [2023-05-05T10:57:06Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:57:06 roujiamo sh[266462]: [2023-05-05T10:57:06Z INFO battery_notify] Bluetooth battery status: []
May 05 11:59:06 roujiamo sh[266462]: [2023-05-05T10:59:06Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:59:06 roujiamo sh[266462]: [2023-05-05T10:59:06Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:59:06 roujiamo sh[266462]: [2023-05-05T10:59:06Z INFO battery_notify] Bluetooth battery status: []
May 05 12:01:07 roujiamo sh[266462]: [2023-05-05T11:01:07Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39300000, full_uwh: 56970000 }]
May 05 12:01:07 roujiamo sh[266462]: [2023-05-05T11:01:07Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39300000, full_uwh: 56970000 }
May 05 12:01:07 roujiamo sh[266462]: [2023-05-05T11:01:07Z INFO battery_notify] Bluetooth battery status: []
May 05 12:03:07 roujiamo sh[266462]: [2023-05-05T11:03:07Z INFO battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39300000, full_uwh: 56970000 }]
May 05 12:03:07 roujiamo sh[266462]: [2023-05-05T11:03:07Z INFO battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39300000, full_uwh: 56970000 }
May 05 12:03:07 roujiamo sh[266462]: [2023-05-05T11:03:07Z INFO battery_notify] Bluetooth battery status: []
If there are multiple batteries, this could be wrong, since the batteries don't necessarily have the same capacity at full.
Some general thoughts:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.