aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2020-06-01 01:55:02 -0400
committertdro <tdro@users.noreply.github.com>2020-06-01 02:02:14 -0400
commit700e91873d98010f59d9603876e0ac499da06957 (patch)
treed31e8038730fb5c22f3a40ead1ac9d4b50fc592c
parentf83d9db2c10ea52e25052b769fd09c1e8477c45a (diff)
downloaddotfiles-700e91873d98010f59d9603876e0ac499da06957.tar.gz
dotfiles-700e91873d98010f59d9603876e0ac499da06957.tar.bz2
dotfiles-700e91873d98010f59d9603876e0ac499da06957.zip
.config/systemd/user: Add workout notify
-rw-r--r--.config/systemd/user/workout-notify.service8
-rw-r--r--.config/systemd/user/workout-notify.timer10
-rwxr-xr-x.local/bin/scripts/workout-notify5
3 files changed, 23 insertions, 0 deletions
diff --git a/.config/systemd/user/workout-notify.service b/.config/systemd/user/workout-notify.service
new file mode 100644
index 0000000..3ea82f4
--- /dev/null
+++ b/.config/systemd/user/workout-notify.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Workout notifications
+
+[Service]
+Type=oneshot
+Environment=DISPLAY=:0
+ExecStart=%h/.local/bin/scripts/workout-notify
+SyslogIdentifier=workout-notify
diff --git a/.config/systemd/user/workout-notify.timer b/.config/systemd/user/workout-notify.timer
new file mode 100644
index 0000000..041c354
--- /dev/null
+++ b/.config/systemd/user/workout-notify.timer
@@ -0,0 +1,10 @@
+[Unit]
+Description=Workout notification timer
+
+[Timer]
+OnBootSec=90m
+OnUnitActiveSec=90m
+RandomizedDelaySec=15m
+
+[Install]
+WantedBy=default.target
diff --git a/.local/bin/scripts/workout-notify b/.local/bin/scripts/workout-notify
new file mode 100755
index 0000000..12b0615
--- /dev/null
+++ b/.local/bin/scripts/workout-notify
@@ -0,0 +1,5 @@
+#!/bin/sh
+workout=$(fortune ~/Documents/text/databases/exercises.fortune);
+notify-send -u critical \
+"You have $(shuf -i 10-25 -n1) minutes to complete \
+$(shuf -i "${workout%% *}" -n1) ${workout#* }.";