Make power profile defaults configurable#6046
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a user-configurable default power profile configuration so omarchy-powerprofiles-set can choose AC/battery profiles based on persisted settings.
Changes:
- Add a migration to install a default
powerprofiles.confinto the user config directory (if missing). - Add
config/omarchy/powerprofiles.confwith defaultac/batteryprofile mappings. - Update
omarchy-powerprofiles-setto read and validate configured profiles before falling back to hard-coded defaults.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| migrations/1780735021.sh | Creates the config directory and seeds powerprofiles.conf if it doesn’t exist. |
| config/omarchy/powerprofiles.conf | Introduces default AC/battery profile mappings. |
| bin/omarchy-powerprofiles-set | Loads profile defaults from config and applies them if valid. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
966cfdc to
af1a6f0
Compare
af1a6f0 to
7767b32
Compare
7767b32 to
78afa24
Compare
78afa24 to
c23298b
Compare
c23298b to
00597e9
Compare
00597e9 to
52206bf
Compare
52206bf to
a65d3f8
Compare
|
This would be great to be able to configure! My Dell Latitude with an i7 will also start taking off if I keep it in performance mode. For now I've added the following to Which is a terrible hack but I just get annoyed by having to do the change manually on every boot. Shame that your config menu PR was closed. |
|
Thanks for the comment @MrDach. I know a ton of people having the same problem. |
Summary
This is a smaller version of #5621: no menu, just a persistent config file.
omarchy-powerprofiles-setnow reads:Those are today's defaults, so behavior is unchanged unless the user edits the file. If the file is missing or contains an unavailable profile, the helper falls back to the existing defaults.
The existing udev rule is unchanged. This makes the Omarchy helper configurable and seeds the default config file.
One important detail: udev launches the helper through the system manager, so
$HOMEis not guaranteed to be the desktop user's home. The helper therefore still honorsOMARCHY_CONFIG_HOMEfirst, but otherwise derives the user config path from its installed executable path under~/.local/share/omarchy/bin. That lets the same config file work from boot, Hyprland autostart, and udev AC/USB events without changing the udev rule.Why
Editing the udev rule directly does not hold up as a persistent user preference:
omarchy-powerprofiles-init$HOMEalone can miss~/.config/omarchy/powerprofiles.confThis gives users an Omarchy-supported override without changing defaults for everyone.
Testing
bash -n bin/omarchy-powerprofiles-set migrations/1780735021.shgit diff --checkbin/omarchy-powerprofiles-set acwith localac=balancedHOME=/rootandac=balanced, verifying it still reads the user config from the executable pathOMARCHY_CONFIG_HOMEoverride precedenceOMARCHY_CONFIG_HOME=/tmp/omarchy-powerprofiles-migration-test/.config/omarchy OMARCHY_PATH=/home/carmine/Code/omarchy bash migrations/1780735021.sh