OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
power-suspend medium occasional DISPUTE

Apply the saved battery power profile when the laptop boots unplugged

omarchylaptoppower-profiles-daemon
CORRECTED An auditor found the fix wrong or incomplete and rewrote it. · checked against Omarchy omarchy 4.0.4-1 on 2026-10-05
AUDIT NOTE

Cause confirmed against the installed omarchy-powerprofiles-set: only the exact b true from busctl selects battery, any failure falls to ac, and with no saved AC profile it picks performance. Issue #12734 (open, 4.0.4-1, ppd 0.30-1) supports this and the transition-only shell service. o.exec_on_start exists in default/hypr/helpers.lua and registers an hl.on("hyprland.start") handler, ~/.config/hypr/autostart.lua is required after default.hypr.omarchy, and Omarchy itself runs sleep 2 && omarchy-hook post-boot through hl.exec_cmd, so the shell form works. The defect is ordering. omarchy-powerprofiles-set applies the requested profile immediately, whatever the current power source. The record runs omarchy-powerprofiles-set battery first and omarchy-powerprofiles-set ac balanced last, so a reader on battery ends the procedure running Balanced, not their saved Power Saver. The fix saves the AC profile first and finishes with autodetect. Not exercised: no profile was changed and no reboot was done. Second audit confirmed the corrected text: Issue #12734 (open, 4.0.4-1, ppd 0.30-1) supports the cause, the hedge on UPower timing and the transition-only shell service. omarchy-powerprofiles-set is identical on quattro: only b true selects battery, and an absent ac file falls back to performance. The quattro battery Service.qml added only a 2 s read of ActiveProfile and still calls omarchy-powerprofiles-set only from onOnBatteryChanged, so the defect is current. The corrected ordering is right. ac balanced applies balanced, then autodetect applies the saved battery profile when on battery. o.exec_on_start in default/hypr/helpers.lua wraps hl.on("hyprland.start") + hl.exec_cmd. Omarchy itself runs sleep 2 && omarchy-hook post-boot the same way. The stock ~/.config/hypr/autostart.lua (template /usr/share/omarchy/config/hypr/autostart.lua) is required by hyprland.lua after default.hypr.omarchy. Not exercised: no profile change, no reboot.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.

Symptom

I chose Power Saver for battery and it works when I unplug. But if I boot the laptop already on battery, it runs performance all day. powerprofilesctl get says performance while cat ~/.local/state/omarchy/powerprofiles/battery says power-saver.

Cause

omarchy-powerprofiles-set autodetect decides AC or battery from busctl get-property org.freedesktop.UPower ... OnBattery. Only the exact answer b true selects battery. Any failure, such as UPower not answering yet early in the session, is silently treated as AC, and with no AC profile saved the script picks performance. The shell's battery service applies a profile only on AC/battery *changes*, so nothing corrects it until you plug in and unplug again. Reported on 4.0.4-1 with power-profiles-daemon 0.30. The UPower timing is the reporter's analysis, shown to be possible but not proven for that boot.

Fix

**First, save an explicit AC profile,** so that a wrong guess of AC does not jump straight to performance. Do this before the next step, because omarchy-powerprofiles-set applies the profile it saves at once, even on battery:


omarchy-powerprofiles-set ac balanced

**Then apply the right profile for the current power source:**


omarchy-powerprofiles-set autodetect
powerprofilesctl get

On battery this should print your saved battery profile, for example power-saver. If it does not, apply it explicitly with omarchy-powerprofiles-set battery.

**Persistent workaround on Omarchy 4:** run autodetect again a few seconds after login, once UPower is up. Add this line to ~/.config/hypr/autostart.lua:


o.exec_on_start("sleep 10 && omarchy-powerprofiles-set autodetect")

o.exec_on_start is Omarchy's helper that runs the command on hyprland.start, the same hook that already runs omarchy-powerprofiles-init. It takes effect at the next login.

Verify

Shut down, unplug, boot on battery and log in. After about 15 seconds powerprofilesctl get should print the profile stored in ~/.local/state/omarchy/powerprofiles/battery.

Sources

omarchy-battery-power-profile-ignored-when-booting-on-battery