Last active
February 16, 2021 16:44
-
-
Save 7hibault/78668ee0d845ea55124608583fb4d109 to your computer and use it in GitHub Desktop.
This file contains 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
#!/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