Ensure this isnt run over and over also

This commit is contained in:
David Heinemeier Hansson
2025-07-20 21:21:28 -05:00
parent f781a805c9
commit 61a7aee377

View File

@ -1,14 +1,10 @@
echo "Enable battery low notifications for laptops"
if ls /sys/class/power_supply/BAT* &>/dev/null; then
if ls /sys/class/power_supply/BAT* &>/dev/null && [[ ! -f ~/.local/share/omarchy/config/systemd/user/omarchy-battery-monitor.service ]]; then
mkdir -p ~/.config/systemd/user
cp ~/.local/share/omarchy/config/systemd/user/omarchy-battery-monitor.* ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now omarchy-battery-monitor.timer || true
echo "Battery monitoring enabled - you'll receive notifications at 10% battery"
else
echo "No battery detected - skipping battery monitor setup"
fi