Power Star
A system tray power manager for OpenBSD. One battery icon in your tray, and one place to see and change what OpenBSD exposes for power: charge thresholds, performance policy, CPU types, brightness, lid and power button actions, automatic suspend. Settings that need root are saved where OpenBSD keeps them, so they survive a reboot.
Requirements
- OpenBSD (tested on 8.0, amd64) running an X session with a system tray
- Python 3.11+ and
py3-qt6 doasfor changes that need root (see Notes)
Installation
Quick install (recommended)
$ doas pkg_add py3-qt6 py3-pipx
$ pipx install --system-site-packages powerstar
--system-site-packages lets pipx use the py3-qt6 package instead of building Qt from PyPI.
Then run:
$ powerstar
From source
$ git clone https://github.com/OpenBSDGuy/power_star
$ cd power_star
$ python3 -m venv --system-site-packages venv && . venv/bin/activate
$ pip install -e .
$ powerstar
First run
Power Star starts in the tray; there is nothing to set up. If no system tray is available it says so and exits. Controls your machine does not support (for example charge thresholds on a laptop without them) are disabled with a reason.
Usage
The tray icon shows the charge level, a lightning bolt while charging and a plug on external power. It turns orange below 30% and red at 10% or less. Hover for the percentage, status and time left. Click it to open Preferences; right-click for the menu: status, health and cycles of each battery, CPU speed, temperature and fan, a Performance submenu (Automatic, High performance, Power saving), Suspend, Hibernate, Preferences and Quit. The Performance submenu needs no password but lasts only until the next reboot; Power Star re-applies your last choice when it starts.
| Tab | What it drives |
|---|---|
| Battery | hw.battery.chargemode, chargestart, chargestop; per-battery charge, health, cycles, rate, voltage |
| Performance | hw.perfpolicy (on AC and on battery), hw.setperf, hw.blockcpu (hyper-threads, P, E, L cores) |
| Display | Brightness (xbacklight) and screen off time (xset DPMS) |
| Sleep & buttons | machdep.lidaction, machdep.pwraction, automatic suspend or hibernate at a battery % (apmd -z, -Z) |
| General | Percentage on the icon, low battery notification and level, how often the status is read |
Apply lists the files and commands first, then applies the values now and saves them for boot. Display settings belong to the X session, so they are stored in ~/.config/powerstar/config.toml and applied each time Power Star starts.
Screenshots
| Performance | Display |
|---|---|
| Sleep & buttons | General |
|---|---|
Starting at login
i3, in ~/.config/i3/config:
exec --no-startup-id powerstar
A plain X session, in ~/.xsession before the window manager starts:
powerstar &
Xfce: Settings, Session and Startup, Application Autostart, then add powerstar.
Notes
- Power Star never asks for, sees or stores a password. For each Apply it writes one shell script and runs it as root, trying
doas -n(works only ifdoas.confallows it without a prompt), thenpkexec(if polkit and a polkit agent are present), then anxtermrunningdoas, where you type the password into doas's own prompt. sysctlvalues are set now and written to/etc/sysctl.conf: only the line of the changed key is replaced, a new key is appended below a# added by powerstarcomment, and every other line is kept.apmdflags are changed withrcctl. Saving a performance policy removes-A,-Hor-Lfrom them, because they would overridehw.perfpolicywhen apmd starts.hw.smtis a deprecated alias of the S letter ofhw.blockcpu. When the CPU types are saved, anhw.smtline is commented out (# disabled by powerstar:) so the two do not fight at boot. A choice that would block every core type is refused.- OpenBSD's
sysctlexits 0 when a write is rejected, so Power Star treats anything on stderr as a failure. - If any step fails, the files are restored and the values already changed are set back.
- Powering off from the power button also needs
hw.allowpowerdown=1, which only changes at boot, so that choice takes effect after a reboot.
Manual
powerstar(1) covers the tray, tabs, authorisation, files and how to uninstall. Read it with man powerstar once installed system-wide (powerstar --install-man), or without installing with powerstar --man.
License
GPL-3.0
Metadata
Release files for powerstar 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| powerstar-0.1.0.tar.gz | 47.8 kB | Without provenance | Details for powerstar-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| powerstar-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for powerstar-0.1.0-py3-none-any.whl |
Total release size: 89.6 kB
Release files / powerstar-0.1.0.tar.gz
| Download URL | powerstar-0.1.0.tar.gz |
|---|---|
| Size | 47.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39ab7f327082e40d8623df4ac16571daba82f1739c4649732ca5088d633f3d4f
|
|
BLAKE2b-256 checksum How to use checksums |
61d39b9034cc78b57f1b509f28c7db6a4c7dd67085820577dbe2900e0e7c87b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.9
|
Release files / powerstar-0.1.0-py3-none-any.whl
| Download URL | powerstar-0.1.0-py3-none-any.whl |
|---|---|
| Size | 41.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f2d2cd4c34ec5b87861bb630a90b50286ff1043344b34ef6b9c656bde900aa9a
|
|
BLAKE2b-256 checksum How to use checksums |
56dfd9b8814ff90917f17437cc0ecb07e28bed6fd7a648dbb4f999fde6d4aa01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.9
|
Security for powerstar 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.