diff --git a/bin/omarchy-update-system-pkgs b/bin/omarchy-update-system-pkgs index ac9dc35e..fbd52f5d 100755 --- a/bin/omarchy-update-system-pkgs +++ b/bin/omarchy-update-system-pkgs @@ -28,4 +28,6 @@ sudo pacman -Syyu --noconfirm \ --overwrite '/etc/systemd/resolved.conf.d/20-docker-dns.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/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' diff --git a/etc/systemd/system/plocate-updatedb.service.d/ac-only.conf b/etc/systemd/system/plocate-updatedb.service.d/ac-only.conf new file mode 100644 index 00000000..4e53123c --- /dev/null +++ b/etc/systemd/system/plocate-updatedb.service.d/ac-only.conf @@ -0,0 +1,2 @@ +[Unit] +ConditionACPower=true diff --git a/etc/udev/rules.d/99-omarchy-power-profile.rules b/etc/udev/rules.d/99-omarchy-power-profile.rules new file mode 100644 index 00000000..258cc93d --- /dev/null +++ b/etc/udev/rules.d/99-omarchy-power-profile.rules @@ -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" diff --git a/etc/udev/rules.d/99-omarchy-wifi-powersave.rules b/etc/udev/rules.d/99-omarchy-wifi-powersave.rules new file mode 100644 index 00000000..87950af6 --- /dev/null +++ b/etc/udev/rules.d/99-omarchy-wifi-powersave.rules @@ -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" diff --git a/install/config/all.sh b/install/config/all.sh index 3f6592b5..5e6fb924 100644 --- a/install/config/all.sh +++ b/install/config/all.sh @@ -18,7 +18,6 @@ run_logged $OMARCHY_INSTALL/config/toggles.sh run_logged $OMARCHY_INSTALL/config/nautilus-python.sh run_logged $OMARCHY_INSTALL/config/localdb.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/omarchy-ai-skill.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/powerprofilesctl-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/set-wireless-regdom.sh diff --git a/install/config/plocate-ac-only.sh b/install/config/plocate-ac-only.sh deleted file mode 100644 index 31cd088f..00000000 --- a/install/config/plocate-ac-only.sh +++ /dev/null @@ -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 diff --git a/install/config/powerprofilesctl-rules.sh b/install/config/powerprofilesctl-rules.sh index 0715a1c6..c4f99a03 100644 --- a/install/config/powerprofilesctl-rules.sh +++ b/install/config/powerprofilesctl-rules.sh @@ -1,11 +1,6 @@ -if omarchy-battery-present; then - cat </dev/null - sudo udevadm trigger --subsystem-match=power_supply 2>/dev/null -fi +# 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. +sudo systemctl enable power-profiles-daemon +sudo udevadm control --reload 2>/dev/null +sudo udevadm trigger --subsystem-match=power_supply 2>/dev/null diff --git a/install/config/unmount-fuse.sh b/install/config/unmount-fuse.sh deleted file mode 100644 index 9c44e17f..00000000 --- a/install/config/unmount-fuse.sh +++ /dev/null @@ -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/ diff --git a/install/config/wifi-powersave-rules.sh b/install/config/wifi-powersave-rules.sh index 55739059..11a39b1c 100644 --- a/install/config/wifi-powersave-rules.sh +++ b/install/config/wifi-powersave-rules.sh @@ -1,9 +1,5 @@ -if omarchy-battery-present; then - cat </dev/null +sudo udevadm trigger --subsystem-match=power_supply 2>/dev/null