Skip to content

Instantly share code, notes, and snippets.

@glowinthedark
Created April 11, 2019 18:33
Show Gist options
  • Select an option

  • Save glowinthedark/8eeb04968bd023bb7d5c496bed084d5c to your computer and use it in GitHub Desktop.

Select an option

Save glowinthedark/8eeb04968bd023bb7d5c496bed084d5c to your computer and use it in GitHub Desktop.
Bash Tea-timer
#!/usr/bin/env bash
DRIP="/usr/share/sounds/gnome/default/alerts/drip.ogg"
mpv --no-terminal $DRIP && notify-send -t 1 "TEA" "Started at: $(date +'%A, %d-%B-%y, %H:%M:%S')" --icon=dialog-information
declare -A ticks=( \
[50]="50 sec" \
[20]="1 min 10 sec" \
[20]="1 min 30 sec" \
[30]="2 min" \
[180]="5 min" \
)
for tick in "${!ticks[@]}"; do
echo "$tick - ${ticks[$tick]}";
sleep $tick && mpv --no-terminal $DRIP && notify-send -t 1 'tea' "${ticks[$tick]}" --icon=dialog-information
done
#!/usr/bin/env bash
PLONK="afplay /System/Library/PrivateFrameworks/TelephonyUtilities.framework/Versions/A/Resources/ringback_tone_ansi.caf &"
eval $PLONK && osascript -e "display notification \"Started: `date +'%A, %d-%B-%y, %H:%M:%S'`\" with title \"Tea\""
declare -A ticks=( \
[50]="50 sec" \
[20]="1 min 10 sec" \
[20]="1 min 30 sec" \
[30]="2 min" \
[180]="5 min" \
)
for tick in "${!ticks[@]}"; do
echo "$tick - ${ticks[$tick]}";
sleep $tick && eval $PLONK && osascript -e "display notification \"Elapsed: ${ticks[$tick]}\" with title \"Tea\""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment