omarchy-wifi-powersave: nullglob; plocate drop-in daemon-reload; idempotent legacy cleanup

- bin/omarchy-wifi-powersave: shopt -s nullglob. Previously, machines
  with no wireless interfaces ran the loop once with the literal glob
  ('iface=*'), failed iw, and exited 237. With the new always-installed
  udev rule that invokes this on every AC transition, the failure
  would surface as failed transient omarchy-wifi-powersave-* units on
  desktops. Now it cleanly no-ops.
- migrations/1779307845.sh: add 'systemctl daemon-reload' so the
  plocate-updatedb.service.d/ac-only.conf drop-in is picked up on
  upgrade. Arch's systemd pacman hook only triggers on
  /usr/lib/systemd/system/*, not /etc/systemd/system/*.
- install/config/powerprofilesctl-rules.sh and wifi-powersave-rules.sh:
  rm -f the pre-rename legacy paths before udevadm reload, so the
  cleanup is idempotent outside the one-shot migration (matters for
  re-install/downgrade testing).
This commit is contained in:
Ryan Hughes
2026-06-04 18:34:04 -04:00
parent dcac0ed953
commit 080c8ba38c
4 changed files with 13 additions and 1 deletions
+1
View File
@@ -3,6 +3,7 @@
# omarchy:summary=Set Wi-Fi power save mode on wireless interfaces
# omarchy:args=<on|off>
shopt -s nullglob
for iface in /sys/class/net/*/wireless; do
iface="$(basename "$(dirname "$iface")")"
iw dev "$iface" set power_save "$1" 2>/dev/null
+3
View File
@@ -1,6 +1,9 @@
# The udev rule (/etc/udev/rules.d/99-omarchy-power-profile.rules) ships via
# omarchy-settings. This script handles the runtime side: enable the service
# the rule's RUN+= chains through, and reload udev so the new rule takes effect.
# Also remove the pre-rename legacy path in case the old installer ran since
# the one-shot migration completed (idempotency for re-install/downgrade tests).
sudo rm -f /etc/udev/rules.d/99-power-profile.rules
sudo systemctl enable power-profiles-daemon
sudo udevadm control --reload 2>/dev/null
sudo udevadm trigger --subsystem-match=power_supply 2>/dev/null
+3
View File
@@ -1,5 +1,8 @@
# The udev rule (/etc/udev/rules.d/99-omarchy-wifi-powersave.rules) ships via
# omarchy-settings. This script just reloads udev so the rule takes effect
# without waiting for a reboot.
# Also remove the pre-rename legacy path in case the old installer ran since
# the one-shot migration completed (idempotency for re-install/downgrade tests).
sudo rm -f /etc/udev/rules.d/99-wifi-powersave.rules
sudo udevadm control --reload
sudo udevadm trigger --subsystem-match=power_supply
+6 -1
View File
@@ -9,6 +9,11 @@ sudo rm -f /etc/udev/rules.d/99-power-profile.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.
# Reload so the new udev rules take effect immediately.
sudo udevadm control --reload 2>/dev/null
sudo udevadm trigger --subsystem-match=power_supply 2>/dev/null
# The plocate-updatedb.service drop-in is installed under /etc/systemd/system,
# which Arch's systemd pacman hook does NOT trigger on. Explicitly reload so
# upgrades pick up the drop-in without needing a reboot.
sudo systemctl daemon-reload 2>/dev/null