Repository navigation
Conversation
Automated AI review
Verified: the switch from
The legacy
|
|
Good fix for the |
busctl --system against net.hadess.PowerProfiles replaces the PyGObject CLI whose env-python3 shebang breaks under Homebrew/mise PATHs. Keeps the battery-service IPC refresh from omacom#15027 and the panel's last-good guard.
1047b80 to
09e23c8
Compare
|
Thanks for this. I read the change at 09e23c8 against The
Not calling Python at all is a reasonable design on its own merits, but that is a choice between approaches rather than a defect in the others, so it is left to the maintainer. This also overlaps #8712 (skip the profile calls when the daemon is down, #8596): both rewrite the current-profile command in Codex Medium reviewed the same comparison and also concluded that #11097 takes precedence by age, that #14737 makes both moot, and that #11097 conflicts with #14737 (it modifies the script #14737 deletes). That review read this session's notes, so its agreement is not guaranteed to be independent. This one now waits on the maintainer to decide between the three. |
The D-Bus address and the jq that parses it now live only in the list script, instead of being repeated inline in the menu provider. Co-Authored-By: islam <islamimad66@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The list check above it runs the script against the fake busctl, which is what shows it reads D-Bus; quattro dropped tests that only read source text in omacom#16334. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…filesctl The Omarchy build of power-profiles-daemon (omacom#14737) ships powerprofilesctl with a fixed /usr/bin/python3 shebang, so the PATH failure the comment named no longer happens; the PyGObject shutdown crash from omacom#8596 still does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge; no blocking issue was found. SummaryPower-profile reads and writes now use D-Bus instead of
No new actionable issues were found. Reviews (2) · Last reviewed commit: "Read the power profiles once for the men..." · Reviewed by Greptile |
|
I looked at this again because #14737 has merged since my last comment. That changes part of the picture: Omarchy's own Pushed to your branch (fast-forward, no force):
Checked on a disposable Omarchy ISO worker (
Second opinion: Codex Medium and muse-wonder (via pi, thinking high) reviewed the full diff against Waiting on you, @shrijit37: please update the description to match the branch. It describes a |
quattro's omacom#18745 added omarchy-powerprofiles-floor with a test that needs a powerprofilesctl get mock; this branch had removed the mock since list and set no longer call the CLI. Keep the mock with only get, so list and set still cannot pass through it, and keep both tests.
--active-state already gives every profile and which is active, so the provider no longer runs the list twice, four D-Bus reads where two do.
|
Pushed to your branch (fast-forward, no force):
Checked on a disposable Omarchy ISO worker (
Second opinion: Codex Medium and muse-wonder (via pi, thinking high) reviewed the merge resolution and the new menu line. Neither found a defect. They could read this session's notes, so their agreement isn't guaranteed to be independent. They disagreed on one thing: #18745's Still waiting on you, @shrijit37: the description still describes a |
Problem
powerprofilesctlis a PyGObject script (#!/usr/bin/env python3). Under a shell whose PATH leads with a Homebrew or mise python, the shebang resolves to a python withoutgiand the command dies withModuleNotFoundError: giand no output. The battery dropdown spawns it through Quickshell's process PATH — the list comes back empty, the POWER PROFILE section renders no buttons, and setting a profile does nothing. #11637 already moved the battery service's poll tobusctl ... ActiveProfile; the panel and menu still route through the Python CLI.Fix
Read and set the power profile directly over D-Bus, no Python involved:
bin/omarchy-powerprofiles-listreads the daemon'sProfilesandActiveProfileproperties viabusctl --json=short ... get-property, withjqextracting the names. It still emitsname\t0|1per line, so the panel's highlight and index logic are unchanged.bin/omarchy-powerprofiles-setsetsActiveProfileviabusctl set-property. The UPower autodetect read is unchanged.shell/plugins/menu/Menu.qmlreads the active profile for its provider the same way and lists through the D-Bus-backed script.shell/plugins/panels/power/Panel.qmlresets the profile list on an empty payload and re-kicks the query on the next open, so a transient failure can't freeze the buttons.Evidence
On a T2 MacBook running Arch, where Homebrew's python shadows the system one under the panel's PATH:
The equivalent busctl reads always answer — the daemon's properties are plain D-Bus.
Tests
test/shell.d/powerprofiles-set-test.shfakes the D-Bus daemon instead of the Python CLI: a stubbusctlservesProfiles,ActiveProfile, and UPowerOnBatteryand logsset-propertycalls, so every existing assertion (state files, calls log, autodetect, init, defaults) keeps running against the new transport.test/shell.d/power-test.shasserts the panel's reset/retry behavior.video-background-test.sh's existingbusctl ActiveProfileassertion is untouched.Supersedes
This removes the dependency on the Python CLI, so the shebang-patch approach (
install/config/fix-powerprofilesctl-shebang.sh, reverted by everypower-profiles-daemonupgrade — #11031) no longer applies to power profiles, and supersedes the re-apply direction of #11097 by not editing a package-owned file. Related: #8184, #8596.Fixes #8596