fix(powerprofiles): stop spawning powerprofilesctl from list and set - #19
Open
mark-groves wants to merge 3 commits into
Open
mark-groves wants to merge 3 commits into
mark-groves wants to merge 3 commits into
Conversation
A PATH bomb on powerprofilesctl must still produce the daemon's profile names. That locks the remaining poll that spawned the CPython 3.14 crash.
Read Profiles and ActiveProfile through busctl, the same path the battery poll already uses. Drop the unused menu provider that still called get.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
PR 17 stopped the battery service from running
powerprofilesctl getevery two seconds. That was the command line on every recent SIGSEGV.omarchy-powerprofiles-listandomarchy-powerprofiles-setstill started the same PyGObject script. The power panel calls list every five seconds while it is open.This change reads
ProfilesandActiveProfilethroughbusctl, then writes the profile withset-property. No Python interpreter starts.Scope
bin/omarchy-powerprofiles-listbin/omarchy-powerprofiles-setshell/plugins/menu/Menu.qml(unusedpower-profilesprovider)test/shell.d/powerprofiles-list-test.shtest/shell.d/powerprofiles-set-test.shOut of scope: the 2s
busctlpoll inService.qml, already landed in PR 17. No upstream PR until this has been tried on the fork.Tradeoffs
A shared helper was not added. List and set call
busctlthe same way the battery poll already does. A D-Bus subscription would replace the panel's 5s refresh and is more code than this leftover needs.Blast Radius
Anyone who opens the power panel or plugs in AC hits these two commands. The printed list on this machine matches the old
powerprofilesctlorder. Ifpower-profiles-daemonis down, list still exits 0 with no rows.Verification
./test/shell.d/powerprofiles-list-test.shfailed before the fix (powerprofilesctlbomb, empty output), then passed../test/shell.d/powerprofiles-set-test.shpassed after the mock moved tobusctl set-property../test/shell.d/menu-test.shand./test/shell.d/video-background-test.shpassed.omarchy-powerprofiles-list --active-statestill printspower-saver 1/balanced 0/performance 0with apowerprofilesctlbomb on PATH.Note
Medium Risk
Changes how AC/battery profile selection is applied system-wide via D-Bus; behavior should match the daemon but any busctl/jq parsing mismatch could mis-list profiles or fail to set them.
Overview
Power profile list/set no longer spawn
powerprofilesctl(the PyGObject CLI that was implicated in SIGSEGVs).omarchy-powerprofiles-listandomarchy-powerprofiles-setnow talk tonet.hadess.PowerProfilesover D-Bus viabusctl—readingProfiles/ActiveProfilewithjq, and writing the active profile withset-property—so the power panel’s periodic refresh does not start a Python interpreter.The unused power-profiles dynamic menu provider is removed from
Menu.qml. Shell tests are updated: mocks assertpowerprofilesctlis never invoked, new coverage for list output/--active-state, and set tests expect profile changes to go throughPanel.qmlrather than the menu.Reviewed by Cursor Bugbot for commit 8ffb448. Configure here.