Created
April 11, 2019 18:33
-
-
Save glowinthedark/8eeb04968bd023bb7d5c496bed084d5c to your computer and use it in GitHub Desktop.
Bash Tea-timer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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