Skip to content

Commit

Permalink
Update routine to use new programs
Browse files Browse the repository at this point in the history
  • Loading branch information
za3k committed May 4, 2023
1 parent 41aaa67 commit 33063af
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 30 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Sounds beeps, even on devices with beep turned off. Pseudo-rando beeps and says
Usage:

beepz "Pomodoro"
beepz -q "Pomodoro" # Don't use TTS, just beep

budget_summary
---
Expand Down Expand Up @@ -71,6 +72,10 @@ confirm
---
(Dead) `cp confirm.txt /usr/share/confirm/confirm` for install. Randomly tells you to avoid a default course of action to switch up habits. Poorly designed, doesn't work.

countdown
---
See 'timer'

create-github-repo
---
Usage: `create-github-repo NAME DESCRIPTION`
Expand Down Expand Up @@ -445,12 +450,13 @@ Tag images in a directory interactively, using 'feh'. One button resizes, anothe

timer
---
Kitchen timer for the command line
Kitchen timer for the command line. 'countdown' just displays a time, 'timer' additionally beeps at the end

Example:

timer 5m30s
timer "20 minutes" "next pomodoro"
timer 5m30s

video-linter
---
Expand Down
7 changes: 4 additions & 3 deletions beepz
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
Usage: beepz [REASON]
Usage: beepz [-q] [REASON]
Make a series of (pseudo-) random beeps based on REASON, then say REASON using TTS if TTS is available.
"""
import math, random, struct, subprocess,sys
Expand Down Expand Up @@ -45,8 +45,9 @@ def say(text):
subprocess.check_output(['speak', '-v', 'english-mb-en1', text])

if __name__ == "__main__":
seed = ''.join(sys.argv[1:])
args = [x for x in sys.argv[1:] if x.startswith("-")]
seed = ''.join(x for x in sys.argv[1:] if not x.startswith("-"))
h = hashlib.sha1(seed.encode('utf8')).digest()
random.seed(h[0]+h[1]*256+h[1]*256**2)
play_samples(randbeeps())
if seed: say(seed)
if seed and "-q" not in args: say(seed)
57 changes: 37 additions & 20 deletions routine
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
# plank - 3m
# squat+curl: 6m
# lift + press: 3m
case "$1" of)
A|a)
echo "Not done"
;;
B|b
/home/zachary/.projects/short-programs/timer 1s\
plank 30s rest 30s \
plank 30s rest 30s \
plank 30s rest 30s \
"dumbbell squat" 1m "bicep curl" 90s \
"dumbbell squat" 1m "bicep curl" 90s \
"dumbbell squat" 1m "bicep curl" 90s \
rest 1m \
"straight leg deadlift" 90s "dumbbell shoulder press" 90s \
"straight leg deadlift" 90s "dumbbell shoulder press" 90s \
"straight leg deadlift" 90s "dumbbell shoulder press" 90s \
done # Routine B
func doit() {
say "$1" && countdown "$1" "$2" && beepz -q "$1"
}

case "$1" in
A|a) # 23 minutes
say "Exercise Routine A" && sleep 2
for x in 1 2 3; do
doit "plank" 30s
doit "rest" 30s
done
for x in 1 2 3; do
doit "dumbbell straight-leg deadlift" 110s
doit "dumbbell row one arm" 90s
done
doit "rest" 1m
for x in 1 2 3; do
doit "dumbbell squat" 90s
doit "pushups" 90s
done
say "done"
;;
B|b) # 20.5 minutes
say "Exercise Routine B" && sleep 2
for x in 1 2 3; do
doit "plank" 30s
doit "rest" 30s
done
for x in 1 2 3; do
doit "dumbbell squat" 1m
doit "bicep curl" 90s
done
doit "rest" 1m
for x in 1 2 3; do
doit "straight leg deadlift" 90s
doit "dumbbell shoulder press" 90s
done
say "done"
*)
echo "Not a valid routine"
;;
Expand Down
7 changes: 1 addition & 6 deletions say
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
#!/bin/sh
if [ $# -eq 0 ]
then
exec festival --tts
else
echo "$@" | festival --tts
fi
speak -v english-mb-en1 "$@"

0 comments on commit 33063af

Please sign in to comment.