From 34a007012bb0cb556d8be11987cf96476a7a5344 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Mon, 7 Jun 2021 18:38:03 +0200 Subject: machines/shiki: burpie roll --- machines/profpatsch/shiki.nix | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'machines/profpatsch/shiki.nix') 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"; }; }; -- cgit 1.4.1