| 1 | #!/bin/bash |
| 2 | set -e |
| 3 | |
| 4 | echo "Installing power-watch..." |
| 5 | |
| 6 | mkdir -p ~/.local/bin |
| 7 | mkdir -p ~/.config/systemd/user |
| 8 | |
| 9 | cp power-watch.sh ~/.local/bin/power-watch.sh |
| 10 | chmod +x ~/.local/bin/power-watch.sh |
| 11 | |
| 12 | cp systemd/power-watch.service ~/.config/systemd/user/ |
| 13 | cp systemd/power-watch.timer ~/.config/systemd/user/ |
| 14 | |
| 15 | systemctl --user daemon-reload |
| 16 | systemctl --user enable --now power-watch.timer |
| 17 | |
| 18 | echo "Enabling lingering..." |
| 19 | sudo loginctl enable-linger "$USER" |
| 20 | |
| 21 | echo "Done! Power Watch is running." |
| 22 | echo "Test with: systemctl --user start power-watch.service" |
| 23 | |