Skip to content

Instantly share code, notes, and snippets.

@7hibault
Last active February 16, 2021 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7hibault/78668ee0d845ea55124608583fb4d109 to your computer and use it in GitHub Desktop.
Save 7hibault/78668ee0d845ea55124608583fb4d109 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Clear everything
tput reset
# Pretty-print a summary
now=$(date +"%H:%M")
end=$(date -d "$now today + "$1" minutes" +'%H:%M')
pad=$((6-${#1}))
printf "┌───────────────────┐\n"
printf "│ Durée......%sm% *s│▒\n" "$1" "$pad"
printf "│ Début......%s │▒\n" "$now"
printf "│ Fin........%s │▒\n" "$end"
printf "└───────────────────┘▒\n"
printf " ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒\n"
# Make text cursor invisible
tput civis
# Save cursor position
tput sc
# Stay strong and focused
printf "
██████  ██████  ██  ██ ██████  █████  ██████  ███████ 
██      ██    ██ ██  ██ ██   ██ ██   ██ ██       ██      
██  ██  ██ ██  ██ ██████  ███████ ██  ███ █████ 
██  ██  ██ ██  ██ ██   ██ ██   ██ ██  ██ ██    
 ██████  ██████   ██████  ██  ██ ██  ██  ██████  ███████ 
"
# Sleep for the configured duration and notify when time's up
sleep $1m && notify-send "Beep beep beep!"
# Back to saved position
tput rc
# Clear to the end of the screen
tput ed
# Give yourself a nice pat on the back
printf "
██████  ██████  █████  ██  ██  ██████  ██ 
██   ██ ██   ██ ██   ██ ██  ██ ██    ██  ██ 
██████  ██████  ███████ ██  ██ ██  ██  ██ 
██   ██ ██   ██ ██   ██  ██  ██  ██  ██     
██████  ██  ██ ██  ██   ████    ██████   ██ 
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment