Skip to content

Let the power-profiles-daemon migration finish without an active session - #16565

Merged
omarchybot merged 1 commit into
quattrofrom
fix-powerprofiles-migration-ssh
Oct 25, 2026
Merged

omarchybot merged 1 commit into
quattrofrom
fix-powerprofiles-migration-ssh

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

The migration #14737 added ends by applying the power profile with omarchy-powerprofiles-set autodetect. Switching a profile needs polkit's active-session grant (org.freedesktop.UPower.PowerProfiles.switch-profile), which an update has only from inside a graphical login. Run over SSH, or on a machine nobody is logged into, polkit denies it, the setter exits non-zero, and under bash -euo pipefail the migration fails after the package swap has already happened. That migration stays pending and stops every migration queued behind it.

The profile does not need to be applied here: default/hypr/autostart.lua runs omarchy-powerprofiles-init at every login, and that runs the same autodetect. So the migration now reports that the switch is deferred and finishes, while a failed package swap or daemon restart still stops it as before. On a stock install over SSH it now exits 0 with omarchy-power-profiles-daemon installed and the daemon running, where it exited 1 with the AccessDenied above.

The fix edits the shipped migration rather than adding one, because migrations run strictly in order: a new migration would wait behind this one forever, while machines where it failed still have it pending and rerun the corrected file.

Codex Medium and Muse Spark 1.3 (via pi, thinking high) reviewed it and found nothing to change. Muse separately traced the setter's other failure paths, all of which end at the same powerprofilesctl set, and confirmed no later migration depends on the profile having been applied.

🤖 Generated by Opus 5.5 in Claude Code. Reviewed by Codex Medium and Muse Spark 1.3 High.

Switching a power profile needs polkit's active-session grant, so the migration's closing autodetect was denied on an update over SSH or without a graphical login, failed under -euo pipefail after the package swap, and stopped the migration queue. The profile is applied by omarchy-powerprofiles-init at every login, so the migration reports the skipped switch and finishes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

Makes profile selection non-fatal in migrations/1791554699.sh, allowing updates without an active graphical session to finish.

  • The package migration finishes when profile switching is unavailable.

Reviews (1) · Last reviewed commit: "Let the power-profiles-daemon migration ..." · Reviewed by Greptile

@omarchybot
omarchybot merged commit 1381fa0 into quattro Oct 25, 2026
2 checks passed
@omarchybot
omarchybot deleted the fix-powerprofiles-migration-ssh branch October 25, 2026 06:02
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