Skip to content

Port omarchy-powerctl to C99 - #227

Merged
henrikklee merged 3 commits into
OrchardLinux:mainfrom
tcballard:perf-powerctl-c
Dec 6, 2026
Merged

henrikklee merged 3 commits into
OrchardLinux:mainfrom
tcballard:perf-powerctl-c

Conversation

@tcballard

Copy link
Copy Markdown
Contributor

Replaces the Python 3 omarchy-powerctl client with a zero-dependency C99 binary (desktop/configuration/powerctl.c, ~17 KB ELF).

  • Eliminates Python interpreter startup latency on every lock, idle, wake, dim/undim, and status call.
  • Wired into Makefile, desktop/install-tree, release/audit.py, and package staging/audit tests.
  • Adds tests/test_powerctl.py testing the compiled binary against a Unix domain socket.

Tested: test_powerctl.py (2/2), test_package_staging.py (7/7), test_package.py (22/22), test_powerd.py (96/96).

tcballard and others added 2 commits December 2, 2026 11:25
omarchy-powerctl is spawned on every wake, unlock, idle-grace input, dim,
undim and lock event just to send one line over /run/omarchy-powerd.sock,
paying Python 3 interpreter startup (~80-120 ms) each time.

Replace it with a zero-dependency C99 binary (~17 KB ELF) compiled in
Makefile, staged by desktop/install-tree and audited by release/audit.py.

Assisted-by: LLM
# Conflicts:
#	CHANGELOG.md
#	Makefile
#	desktop/install-tree
#	release/audit.py
#	tests/package_tree.py
#	tests/test_package.py
@henrikklee
henrikklee merged commit e70d905 into OrchardLinux:main Dec 6, 2026
11 checks passed
@henrikklee

Copy link
Copy Markdown
Contributor

Merged, thank you Tom! Lock and brightness calls no longer wait for Python to start.

On your branch we merged main in, so powerctl now builds next to powerd and the mute-switch helper, and we added the changelog line. Next up: #228.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants