about summary refs log tree commit diff
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2021-06-07 18:38:03 +0200
committerProfpatsch <mail@profpatsch.de>2021-06-07 18:38:03 +0200
commit34a007012bb0cb556d8be11987cf96476a7a5344 (patch)
treeaf78ec0cc73910f17b49e40e58db5920d46c2a45
parentc95a52b4b42e98389c3580b00d7ed53ad3146424 (diff)
machines/shiki: burpie roll
-rw-r--r--machines/profpatsch/shiki.nix23
1 files changed, 20 insertions, 3 deletions
diff --git a/machines/profpatsch/shiki.nix b/machines/profpatsch/shiki.nix
index 95e35972..8824d4c2 100644
--- a/machines/profpatsch/shiki.nix
+++ b/machines/profpatsch/shiki.nix
@@ -473,8 +473,25 @@ in {
           description = "do a barrel roll";
           serviceConfig = {
             Restart = "no";
-            ExecStart = "${pkgs.writers.writeDash "barrel-roll" ''
-              ${pkgs.libnotify}/bin/notify-send --urgency=critical "Do a barrel roll!"
+            ExecStart = "${pkgs.writers.writePython3 "barrel-roll" {
+              flakeIgnore = [ "E121" "E128" "E999" "E203" "E201" "E202" "E501" ];
+            } ''
+              import random
+              import subprocess as sub
+              excercises = [
+                 { "name": "burpies"
+                 , "sets": 2
+                 , "reps": 10
+                 , "sigma": 2 },
+              ]
+              ex = random.choice(excercises)
+              reps = round(random.gauss(ex['reps'], ex['sigma']))
+              msg = "Do a barrel roll! {} {}, {} sets".format(reps, ex['name'], ex['sets'])
+              sub.check_call([
+                "${pkgs.libnotify}/bin/notify-send",
+                "--urgency=critical",
+                msg
+              ])
             ''}";
             };
         };
@@ -483,7 +500,7 @@ in {
           wantedBy = [ "timers.target" ];
           timerConfig = {
             OnStartupSec="10m";
-            OnUnitActiveSec ="1h";
+            OnUnitActiveSec ="3h";
             AccuracySec="15m";
           };
         };