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

Set a battery charge limit that survives reboot, suspend and hibernate

omarchyarchendeavouroscachyosmanjarolaptopthinkpadasusdellframeworksystem76
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

Technically excellent and verified almost line-for-line against wiki.archlinux.org/title/Laptop/ASUS (BAT0/BAT1/BATC/BATT names, 'reset on every power cycle', the asus-nb-wmi udev rule, the /usr/lib/systemd/system-sleep/battery-threshold.sh script, and 'persists after suspend-to-RAM but is reset when resuming from hibernation'). 'You must always specify both charge thresholds ... otherwise TLP will reject both thresholds' is verbatim from linrunner.de/tlp/settings/battery.html, and the ASUS dummy START=0 matches bc-vendors.html. TLP genuinely does restore thresholds on resume. tlp/thinkpad_acpi/tp_smapi-dkms all check out. TWO Omarchy commands are wrong. (1) omarchy pkg install tlp does not install tlp: bin/omarchy-pkg-install is an interactive fzf picker (pacman -Slq | fzf) that ignores its arguments entirely. The by-name installer is bin/omarchy-pkg-add (omarchy pkg add tlp). (2) OMARCHY_ALLOW_DIRECT_PACMAN=1 sudo pacman -S tlp cannot work: sudo strips the environment, so the variable never reaches pacman. The documented form printed by the guard itself is sudo env OMARCHY_ALLOW_DIRECT_PACMAN=1 pacman -Syu. It is also unnecessary: bin/omarchy-update-pacman-guard only aborts when the pacman invocation has BOTH a sync (-S) and a sysupgrade (-u) flag, and the hook only triggers on Operation=Upgrade, so a plain pacman -S tlp is never blocked. Also missing the Arch TLP page's instruction to mask systemd-rfkill.service and systemd-rfkill.socket.

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

Installing TLP on Omarchy or any distro shipping power-profiles-daemon puts two daemons on the same knobs. See the existing TLP/power-profiles-daemon conflict record before enabling tlp.service, and be aware Omarchy's power menu reads powerprofilesctl. Do not set a stop threshold below your current charge and then expect the battery to discharge to it. It will simply sit there not charging. Setting a very low ceiling (e.g. 50%) on a laptop you also use unplugged leaves you with much less runtime than the battery gauge implies.

Symptom

I want the laptop to stop charging at 80% like it did on Windows. Either the file isn't there at all (ls: cannot access '/sys/class/power_supply/BAT0/charge_control_end_threshold': No such file or directory), or I echo 80 into it, it works, and then after a reboot (on ASUS machines, after every resume from hibernate), it's silently back at 100 and the battery charges to full again.

Cause

The charge threshold is not a generic kernel feature. charge_control_start_threshold / charge_control_end_threshold are power-supply class attributes that only exist if a *vendor platform driver* creates them: thinkpad_acpi (natacpi) on ThinkPads, asus_wmi / asus-nb-wmi on ASUS, dell-laptop, system76_acpi, cros_ec on Framework. The value lives in volatile EC state, so nothing persists it across a power cycle. The Arch wiki notes the ASUS driver explicitly resets it to 100 on every power cycle, and that while the value survives suspend-to-RAM it is reset when resuming from hibernation. A second failure mode: the attribute does not exist until the platform module loads, so anything that writes it too early at boot silently does nothing.

Fix

Replace the Omarchy install paragraph in step 3 with:


omarchy pkg add tlp        # omarchy-pkg-add -> pacman -S --noconfirm --needed
sudo systemctl enable --now tlp.service
sudo systemctl mask systemd-rfkill.service systemd-rfkill.socket   # required by the Arch TLP page to avoid conflicts

On plain Arch/EndeavourOS/CachyOS: sudo pacman -Syu --needed tlp.

Drop the OMARCHY_ALLOW_DIRECT_PACMAN=1 sudo pacman -S tlp line. Omarchy's ALPM guard (bin/omarchy-update-pacman-guard) aborts only transactions carrying both -S and -u, so installing a single package is never blocked. If you ever do need the bypass, the env var must come *after* sudo or it is discarded: sudo env OMARCHY_ALLOW_DIRECT_PACMAN=1 pacman -Syu --needed tlp. Everything else in the record stands as written.

Verify

cat /sys/class/power_supply/BAT0/charge_control_end_threshold prints your value after a full power-off/on cycle, and again after systemctl hibernate + resume. With TLP, sudo tlp-stat -b shows a charge_control_end_threshold = 80 [%] line and no 'not available' warnings. Charge past the threshold and cat /sys/class/power_supply/BAT0/status should read Not charging while on AC.

Sources

battery-charge-threshold-resets-or-missing