Skip to content

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zenbookd

Daemon and CLI tool for my Zenbook's battery charge limit

Because Linux is a dysfunctional desktop experience I cannot have a charge limit applied in a matter that isn't a JavaScript vibe slop shell extension or a non-persistent setting in a shitty settings page so here we are.

Install

./scripts/install.sh

The installer adds you to the zenbookd group, which is what grants access to the daemon's socket. Log back in (or run newgrp zenbookd) before the CLI will work.

Usage

zenbookd status                       # current charge, health and config
zenbookd set-limit 80                 # hold the battery at 80%
zenbookd boost                        # charge to 100% now, restore the limit after
zenbookd boost --stop                 # cancel an active boost early
zenbookd set-periodic-charge on       # enable/disable periodic full charge
zenbookd set-charge-period 30         # days between periodic full charges
zenbookd set-wifi-power-save on       # disable Wi-Fi power saving while on AC
zenbookd reload                       # re-read config.toml without restarting
zenbookd --version                    # print the version

status prints a panel:

╭─ zenbookd ──────────────────────────────╮
│                                         │
│   Charge  ██████████████░░░░░░   72%    │
│   Health  ███████████████████░   94%    │
│                                         │
├─────────────────────────────────────────┤
│                                         │
│   Charge limit          80%             │
│   Applied threshold     100%  boost     │
│   Periodic full charge  every 30 days   │
│   Last full charge      12 days ago     │
│   Boost                 23h 9m left     │
│                                         │
╰─────────────────────────────────────────╯

Colour follows NO_COLOR and is dropped when the output is not a terminal. The box falls back to ASCII when the locale is not UTF-8, and to a plain list when the terminal is too narrow to hold it.

Config

/etc/zenbookd/config.toml:

# Percentage (1-100) the battery is held at.
charge_limit = 80

# Periodically charge to 100% to let the BMS recalibrate.
enable_periodic_full_charge = true

# How often that full charge happens, in days.
full_charge_period = 30

# Disable Wi-Fi power saving while on AC power, restoring it once unplugged.
disable_wifi_power_save_on_ac = true

Changes made through the CLI are written back here, preserving comments and any other keys already in the file, so edits and commands stay in sync. Hand edits take effect after zenbookd reload (or a service restart). The daemon keeps its own state (last full charge, any active boost) in /var/lib/zenbookd/state.toml.

License

MIT, see LICENSE.md.

About

Zenbook Batery Daemon

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages