Skip to content

Commit bb6401c

Browse files
authored
feat: battery monitoring (#113)
* feat: battery stats * chore: bump version
1 parent 0603a96 commit bb6401c

File tree

7 files changed

+364
-6
lines changed

7 files changed

+364
-6
lines changed

Cargo.lock

Lines changed: 231 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[package]
22
name = "stats_provider"
3-
version = "0.7.1"
3+
version = "0.8.0"
44
description = "A simple system stats event provider for Sketchybar."
55
edition = "2021"
66
build = "build.rs"
77

88
[dependencies]
99
anyhow = "1.0.100"
1010
clap = { version = "4.5.49", features = ["derive"] }
11+
starship-battery = "0.10.2"
1112
sysinfo = { version = "0.37.2", default-features = false, features = ["component", "disk", "network", "system"] }
1213
tokio = { version = "1", features = ["full"] }
1314

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Usage: stats_provider [OPTIONS]
3737

3838
Options:
3939
-a, --all Get all stats
40+
-b, --battery <BATTERY>... Get battery stats [possible values: percentage, remaining, state, time_to_full]
4041
-c, --cpu <CPU>... Get CPU stats [possible values: count, frequency, temperature, usage]
4142
-d, --disk <DISK>... Get disk stats [possible values: count, free, total, usage, used]
4243
-m, --memory <MEMORY>... Get memory stats [possible values: ram_available, ram_total, ram_usage, ram_used, swp_free, swp_total, swp_usage, swp_used]
@@ -45,7 +46,7 @@ Options:
4546
-u, --uptime <UPTIME>... Get uptime stats [possible values: week, day, hour, min, sec]
4647
-i, --interval <INTERVAL> Refresh interval in seconds [default: 5]
4748
--network-refresh-rate <NETWORK_REFRESH_RATE> Network refresh rate (how often to refresh network interface list, in stat intervals) [default: 5]
48-
-b, --bar <BAR> Bar name (optional)
49+
--bar <BAR> Bar name (optional)
4950
--verbose Enable verbose output
5051
--no-units Output values without units
5152
-h, --help Print help
@@ -145,6 +146,10 @@ Environment variables that can be provided by the `system_stats` event
145146
| Variable | Description |
146147
| ------------------------ | ----------------------------------------- |
147148
| `ARCH` | System architecture |
149+
| `BATTERY_PERCENTAGE` | Battery charge level % |
150+
| `BATTERY_REMAINING` | Time remaining until empty (min) |
151+
| `BATTERY_STATE` | Battery charging state |
152+
| `BATTERY_TIME_TO_FULL` | Time until fully charged (min) |
148153
| `CPU_COUNT` | Number of CPU cores |
149154
| `CPU_FREQUENCY` | CPU frequency MHz |
150155
| `CPU_TEMP` | CPU temperature °C |

0 commit comments

Comments
 (0)