feat: add battery conservation mode with Waybar toggle
Update PKGBUILD version / update-pkgver (push) Successful in 2s
Update PKGBUILD version / update-pkgver (push) Successful in 2s
Laptops with charge_control_end_threshold support get a click-to-toggle on the battery module (80% ↔ 100%). A ♥ icon appears when conservation is active, hidden when inactive. State persists across reboots via systemd oneshot service. udev rule grants wheel group write access so no sudo is needed for toggling.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
# ABOUTME: Restores battery charge threshold from saved state on boot.
|
||||
# ABOUTME: Only runs on laptops with threshold support and a saved state file.
|
||||
|
||||
[Unit]
|
||||
Description=Restore battery conservation mode threshold
|
||||
After=sysinit.target
|
||||
ConditionPathExists=/sys/class/power_supply/BAT0/charge_control_end_threshold
|
||||
ConditionPathExists=/var/lib/moonarch/batsaver-threshold
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sh -c 'cat /var/lib/moonarch/batsaver-threshold > /sys/class/power_supply/BAT0/charge_control_end_threshold'
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user