fix: drop fixed unit name from power-profile udev rule to prevent wakeup failures#6091
Open
DiegoMirner wants to merge 1 commit into
Open
fix: drop fixed unit name from power-profile udev rule to prevent wakeup failures#6091DiegoMirner wants to merge 1 commit into
DiegoMirner wants to merge 1 commit into
Conversation
…eup failures When multiple USB-C power supply udev events fire rapidly on resume, systemd-run fails with exit code 1 because the named unit omarchy-power-profile already exists. Removing the fixed --unit= lets each event get a unique transient unit name, avoiding the collision. powerprofilesctl set is idempotent so concurrent runs are harmless. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the udev rules used to trigger omarchy-powerprofiles-set on power supply changes by altering the systemd-run invocation.
Changes:
- Removes the explicit
--unit=omarchy-power-profilefrom thesystemd-runcalls in the generated udev rules. - Keeps the
After=power-profiles-daemon.serviceordering property and existing triggers forMainsandUSB.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3
to
+4
| SUBSYSTEM=="power_supply", ATTR{type}=="Mains", RUN+="/usr/bin/systemd-run --no-block --collect --property=After=power-profiles-daemon.service $HOME/.local/share/omarchy/bin/omarchy-powerprofiles-set" | ||
| SUBSYSTEM=="power_supply", ATTR{type}=="USB", RUN+="/usr/bin/systemd-run --no-block --collect --property=After=power-profiles-daemon.service $HOME/.local/share/omarchy/bin/omarchy-powerprofiles-set" |
Comment on lines
+3
to
+4
| SUBSYSTEM=="power_supply", ATTR{type}=="Mains", RUN+="/usr/bin/systemd-run --no-block --collect --property=After=power-profiles-daemon.service $HOME/.local/share/omarchy/bin/omarchy-powerprofiles-set" | ||
| SUBSYSTEM=="power_supply", ATTR{type}=="USB", RUN+="/usr/bin/systemd-run --no-block --collect --property=After=power-profiles-daemon.service $HOME/.local/share/omarchy/bin/omarchy-powerprofiles-set" |
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.
Problem
On laptops with USB-C only charging (e.g. ASUS Zenbook with Intel Meteor Lake), multiple
power_supplyudev events fire simultaneously on resume from sleep. Each event calls:Because all events try to create a transient unit with the same fixed name, the second (and any subsequent) invocation fails with:
This shows up in the journal on every wakeup as:
Fix
Remove the
--unit=omarchy-power-profileargument so each event gets a unique auto-generated transient unit name.powerprofilesctl setis idempotent, so concurrent runs are harmless — the last one to execute simply wins.Test
Verified by triggering two rapid back-to-back
systemd-runcalls with the same unit name (reproduces the error), then without the fixed name (both succeed with exit 0). Also confirmed viasudo udevadm trigger --subsystem-match=power_supply --attr-match=type=USBthat no failures appear in the journal after the fix.🤖 Generated with Claude Code