Lots of bin changes

This commit is contained in:
Jonathan Hodgson 2020-01-04 13:21:05 +00:00
parent 2c617a5b49
commit 121798e075
12 changed files with 258 additions and 44 deletions

24
bin/.bin/settimer Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
echo "$@" > "$HOME/timer"
humanDuration=$(head -n 1 "$HOME/timer")
# All these dates are in seconds since the epoch
duration=$(( $(date -d "now + $humanDuration" '+%s') - $(date '+%s') ))
# Display date time notification when half way
( sleep $(( duration / 2 ))
datetime
) & disown
# Display date time notification when 90% done
( sleep $(( (duration * 9) / 10 ))
datetime
) & disown
# Display date time notification when half way
( sleep $duration
datetime "Finished"
) & disown