From ccca62e11f0d1ddd8838fb927c09d72dcb53e514 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sat, 21 Dec 2024 18:57:29 +0100 Subject: exercise-reminder: add it --- install.sh | 3 +++ reminder/reminder/exercise.scm | 6 ++++++ shepherd/shepherd/init.d/exercise.scm | 17 +++++++++++++++++ uninstall.sh | 3 +++ 4 files changed, 29 insertions(+) create mode 100644 reminder/reminder/exercise.scm create mode 100644 shepherd/shepherd/init.d/exercise.scm diff --git a/install.sh b/install.sh index b81416a..2730232 100755 --- a/install.sh +++ b/install.sh @@ -38,3 +38,6 @@ stow -Rt $XDG_CONFIG_HOME newsboat # Sioyek stow -Rt $XDG_CONFIG_HOME sioyek + +# Reminder +stow -Rt $XDG_CONFIG_HOME reminder diff --git a/reminder/reminder/exercise.scm b/reminder/reminder/exercise.scm new file mode 100644 index 0000000..e034a8c --- /dev/null +++ b/reminder/reminder/exercise.scm @@ -0,0 +1,6 @@ +((period 45) ;; In minutes, how much time to period between notifications + (title "Crush it!") ;; Notification title (optional) + (messages ("Squats x 20" ;; Some text with each message to show + "Push-ups x 15" ;; Accepts simple markup like + "Pull-ups x 6" + "Kettlebell swings x 30"))) diff --git a/shepherd/shepherd/init.d/exercise.scm b/shepherd/shepherd/init.d/exercise.scm new file mode 100644 index 0000000..c00b879 --- /dev/null +++ b/shepherd/shepherd/init.d/exercise.scm @@ -0,0 +1,17 @@ +(define config (or (getenv "XDG_CONFIG_HOME") + (string-append (getenv "HOME") "/.config"))) + +(define exercise + (service + '(exercise) + #:documentation "When you are in the computer, you should pause and do some +exercise. Dude, come on" + #:start (make-forkexec-constructor + `("guile" "-e" "(reminder)" "--" "-c" + ,(string-append config "/reminder/exercise.scm")) + #:log-file (string-append config "/reminder/exercise.log")) + #:stop (make-kill-destructor) + #:respawn? #t)) +(register-services exercise) + +(start exercise) diff --git a/uninstall.sh b/uninstall.sh index 02f0a5b..448b49f 100644 --- a/uninstall.sh +++ b/uninstall.sh @@ -35,3 +35,6 @@ stow -Dt ${XDG_CONFIG_HOME:=$HOME/.config} newsboat # sioyek stow -Dt ${XDG_CONFIG_HOME:=$HOME/.config} sioyek + +# Exercise reminder +stow -Dt ${XDG_CONFIG_HOME:=$HOME/.config} reminder -- cgit v1.2.3