aboutsummaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rw-r--r--install.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/install.sh b/install.sh
new file mode 100644
index 0000000..bcf7704
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+set -e
+
+echo "Installing power-watch..."
+
+mkdir -p ~/.local/bin
+mkdir -p ~/.config/systemd/user
+
+cp power-watch.sh ~/.local/bin/power-watch.sh
+chmod +x ~/.local/bin/power-watch.sh
+
+cp systemd/power-watch.service ~/.config/systemd/user/
+cp systemd/power-watch.timer ~/.config/systemd/user/
+
+systemctl --user daemon-reload
+systemctl --user enable --now power-watch.timer
+
+echo "Enabling lingering..."
+sudo loginctl enable-linger "$USER"
+
+echo "Done! Power Watch is running."
+echo "Test with: systemctl --user start power-watch.service"
+