Skip to content

Support per-power-source profile overrides in omarchy-powerprofiles-set#6157

Open
fase29 wants to merge 1 commit into
basecamp:devfrom
fase29:power-profile-config-v2
Open

Support per-power-source profile overrides in omarchy-powerprofiles-set#6157
fase29 wants to merge 1 commit into
basecamp:devfrom
fase29:power-profile-config-v2

Conversation

@fase29

@fase29 fase29 commented Jul 1, 2026

Copy link
Copy Markdown

What

Adds an optional user config file at ~/.config/omarchy/power-profile that lets
you choose which power profile is applied on battery vs. on AC:

battery=power-saver
ac=balanced

Each key is looked up against the profiles reported by powerprofilesctl list,
so any valid profile name works.

Why

The udev rule installed by powerprofilesctl-rules.sh runs
omarchy-powerprofiles-set on every AC/USB power event, and the script
unconditionally forces performance whenever the machine is on AC.

On my laptop that's a problem: performance makes the chassis run hot enough
that the built-in keyboard becomes uncomfortable to type on. I want to stay on
power-saver (or balanced) even while plugged in, but there was no way to do
that short of editing the script directly — which git pull reverts on the next
update.

This makes the AC/battery profile targets configurable, so the tradeoff between
performance and heat/noise/battery can be set to preference instead of being
hardcoded.

Behavior

  • Fully backward compatible. With no config file present, behavior is
    identical to today: performance on AC (falling back to balanced if
    unavailable), balanced on battery.
  • Unknown keys or invalid/unavailable profile values fall back to the built-in
    defaults, so a typo can never leave the machine in a broken state.
  • The user's home is derived from the script's own path rather than $HOME,
    because udev invokes the script as root via systemd-run.

Example

~/.config/omarchy/power-profile

battery=power-saver
ac=power-saver

Keeps the laptop cool and quiet regardless of whether it's plugged in.

Read optional battery/ac profile preferences from ~/.config/omarchy/power-profile. Falls back to the existing performance-on-AC / balanced-on-battery defaults when the file is absent or a value is invalid, so default behavior is unchanged.
Copilot AI review requested due to automatic review settings July 1, 2026 15:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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