Convert plocate-ac-only, power-profile, wifi-powersave, unmount-fuse to package files

Four scripts that wrote static /etc or /usr files become package-shipped
files. The other config-script audit candidates (omarchy-ai-skill,
nautilus-python, omarchy-toggles, input-group) correctly stay scripts —
they're user-level operations, not /etc writes.

New package-owned files (omarchy-installer/etc/, shipped by
omarchy-settings):
- etc/systemd/system/plocate-updatedb.service.d/ac-only.conf
- etc/udev/rules.d/99-omarchy-power-profile.rules
- etc/udev/rules.d/99-omarchy-wifi-powersave.rules

The two udev rule files are renamed for namespacing (99-power-profile
-> 99-omarchy-power-profile; 99-wifi-powersave -> 99-omarchy-wifi-powersave)
and rewritten to invoke /usr/bin/omarchy-powerprofiles-set and
/usr/bin/omarchy-wifi-powersave instead of $HOME/.local/share/omarchy/bin/...
(both binaries ship in the omarchy package at /usr/bin/).

The battery-present gate from the original scripts is dropped — the rules
trigger on power_supply udev events, which are benign on desktops without
batteries. (The runtime commands no-op on AC-only systems.)

Script changes:
- install/config/plocate-ac-only.sh: DELETED (file ships, daemon-reload
  happens via pacman hook).
- install/config/unmount-fuse.sh: DELETED (file ships at
  /usr/lib/systemd/system-sleep/unmount-fuse via omarchy-settings).
- install/config/powerprofilesctl-rules.sh: SHRINK to runtime ops
  (enable power-profiles-daemon, udevadm reload+trigger).
- install/config/wifi-powersave-rules.sh: SHRINK to udevadm reload+trigger.
- install/config/all.sh: drop the two deleted entries.

bin/omarchy-update-system-pkgs: add --overwrite for plocate-updatedb
drop-in and unmount-fuse paths (the udev rule renames need no overwrite
since the new paths are virgin).

migrations/1779307845.sh: remove the legacy 99-power-profile.rules and
99-wifi-powersave.rules paths on existing installs, then reload udev.
This commit is contained in:
Ryan Hughes
2026-06-04 18:34:04 -04:00
parent 5683750b29
commit dcac0ed953
10 changed files with 34 additions and 28 deletions
+3 -1
View File
@@ -28,4 +28,6 @@ sudo pacman -Syyu --noconfirm \
--overwrite '/etc/systemd/resolved.conf.d/20-docker-dns.conf' \ --overwrite '/etc/systemd/resolved.conf.d/20-docker-dns.conf' \
--overwrite '/etc/systemd/system.conf.d/10-faster-shutdown.conf' \ --overwrite '/etc/systemd/system.conf.d/10-faster-shutdown.conf' \
--overwrite '/etc/systemd/system/user@.service.d/10-faster-shutdown.conf' \ --overwrite '/etc/systemd/system/user@.service.d/10-faster-shutdown.conf' \
--overwrite '/etc/systemd/system/docker.service.d/no-block-boot.conf' --overwrite '/etc/systemd/system/docker.service.d/no-block-boot.conf' \
--overwrite '/etc/systemd/system/plocate-updatedb.service.d/ac-only.conf' \
--overwrite '/usr/lib/systemd/system-sleep/unmount-fuse'
@@ -0,0 +1,2 @@
[Unit]
ConditionACPower=true
@@ -0,0 +1,2 @@
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-power-profile --property=After=power-profiles-daemon.service /usr/bin/omarchy-powerprofiles-set"
SUBSYSTEM=="power_supply", ATTR{type}=="USB", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-power-profile --property=After=power-profiles-daemon.service /usr/bin/omarchy-powerprofiles-set"
@@ -0,0 +1,2 @@
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-wifi-powersave-on /usr/bin/omarchy-wifi-powersave on"
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-wifi-powersave-off /usr/bin/omarchy-wifi-powersave off"
-2
View File
@@ -18,7 +18,6 @@ run_logged $OMARCHY_INSTALL/config/toggles.sh
run_logged $OMARCHY_INSTALL/config/nautilus-python.sh run_logged $OMARCHY_INSTALL/config/nautilus-python.sh
run_logged $OMARCHY_INSTALL/config/localdb.sh run_logged $OMARCHY_INSTALL/config/localdb.sh
run_logged $OMARCHY_INSTALL/config/fast-shutdown.sh run_logged $OMARCHY_INSTALL/config/fast-shutdown.sh
run_logged $OMARCHY_INSTALL/config/unmount-fuse.sh
run_logged $OMARCHY_INSTALL/config/input-group.sh run_logged $OMARCHY_INSTALL/config/input-group.sh
run_logged $OMARCHY_INSTALL/config/omarchy-ai-skill.sh run_logged $OMARCHY_INSTALL/config/omarchy-ai-skill.sh
run_logged $OMARCHY_INSTALL/config/pi.sh run_logged $OMARCHY_INSTALL/config/pi.sh
@@ -26,7 +25,6 @@ run_logged $OMARCHY_INSTALL/config/omarchy-toggles.sh
run_logged $OMARCHY_INSTALL/config/kernel-modules-hook.sh run_logged $OMARCHY_INSTALL/config/kernel-modules-hook.sh
run_logged $OMARCHY_INSTALL/config/powerprofilesctl-rules.sh run_logged $OMARCHY_INSTALL/config/powerprofilesctl-rules.sh
run_logged $OMARCHY_INSTALL/config/wifi-powersave-rules.sh run_logged $OMARCHY_INSTALL/config/wifi-powersave-rules.sh
run_logged $OMARCHY_INSTALL/config/plocate-ac-only.sh
run_logged $OMARCHY_INSTALL/config/hardware/network.sh run_logged $OMARCHY_INSTALL/config/hardware/network.sh
run_logged $OMARCHY_INSTALL/config/hardware/set-wireless-regdom.sh run_logged $OMARCHY_INSTALL/config/hardware/set-wireless-regdom.sh
-3
View File
@@ -1,3 +0,0 @@
sudo install -d /etc/systemd/system/plocate-updatedb.service.d
printf '%s\n' '[Unit]' 'ConditionACPower=true' | sudo tee /etc/systemd/system/plocate-updatedb.service.d/ac-only.conf >/dev/null
sudo systemctl daemon-reload
+6 -11
View File
@@ -1,11 +1,6 @@
if omarchy-battery-present; then # The udev rule (/etc/udev/rules.d/99-omarchy-power-profile.rules) ships via
cat <<EOF | sudo tee "/etc/udev/rules.d/99-power-profile.rules" # omarchy-settings. This script handles the runtime side: enable the service
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-power-profile --property=After=power-profiles-daemon.service $HOME/.local/share/omarchy/bin/omarchy-powerprofiles-set" # the rule's RUN+= chains through, and reload udev so the new rule takes effect.
SUBSYSTEM=="power_supply", ATTR{type}=="USB", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-power-profile --property=After=power-profiles-daemon.service $HOME/.local/share/omarchy/bin/omarchy-powerprofiles-set" sudo systemctl enable power-profiles-daemon
EOF sudo udevadm control --reload 2>/dev/null
sudo udevadm trigger --subsystem-match=power_supply 2>/dev/null
sudo systemctl enable power-profiles-daemon
sudo udevadm control --reload 2>/dev/null
sudo udevadm trigger --subsystem-match=power_supply 2>/dev/null
fi
-2
View File
@@ -1,2 +0,0 @@
sudo mkdir -p /usr/lib/systemd/system-sleep
sudo install -m 0755 -o root -g root "$OMARCHY_PATH/default/systemd/system-sleep/unmount-fuse" /usr/lib/systemd/system-sleep/
+5 -9
View File
@@ -1,9 +1,5 @@
if omarchy-battery-present; then # The udev rule (/etc/udev/rules.d/99-omarchy-wifi-powersave.rules) ships via
cat <<EOF | sudo tee "/etc/udev/rules.d/99-wifi-powersave.rules" # omarchy-settings. This script just reloads udev so the rule takes effect
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-wifi-powersave-on $HOME/.local/share/omarchy/bin/omarchy-wifi-powersave on" # without waiting for a reboot.
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-wifi-powersave-off $HOME/.local/share/omarchy/bin/omarchy-wifi-powersave off" sudo udevadm control --reload
EOF sudo udevadm trigger --subsystem-match=power_supply
sudo udevadm control --reload
sudo udevadm trigger --subsystem-match=power_supply
fi
+14
View File
@@ -0,0 +1,14 @@
echo "Clean up legacy udev rules now namespaced under 99-omarchy-*.rules"
# powerprofilesctl-rules.sh used to write /etc/udev/rules.d/99-power-profile.rules.
# Package now ships /etc/udev/rules.d/99-omarchy-power-profile.rules. Both
# rules would fire simultaneously, so remove the old one.
sudo rm -f /etc/udev/rules.d/99-power-profile.rules
# wifi-powersave-rules.sh used to write /etc/udev/rules.d/99-wifi-powersave.rules.
# Package now ships /etc/udev/rules.d/99-omarchy-wifi-powersave.rules. Same.
sudo rm -f /etc/udev/rules.d/99-wifi-powersave.rules
# Reload so the new rules take effect immediately.
sudo udevadm control --reload 2>/dev/null
sudo udevadm trigger --subsystem-match=power_supply 2>/dev/null