Skip to content

Instantly share code, notes, and snippets.

@andresaquino
Last active March 15, 2018 21:55
Show Gist options
  • Save andresaquino/5dd08af1646a25a79a465a019971d982 to your computer and use it in GitHub Desktop.
Save andresaquino/5dd08af1646a25a79a465a019971d982 to your computer and use it in GitHub Desktop.
Un sencillo timer en bash
#!/bin/sh
# vim: ts=3 sw=3 sts=3 et si ai:
# (c) 2018, Andres Aquino <inbox@andresaquino.sh>
# This file is licensed under the BSD License version 3 or later.
# See the LICENSE file.
trap "exit 0" SIGINT SIGTERM
ccount=0
while(true); do
etime=$(date '+%H%Mµ%S')
toilet -f smmono9 "${etime}: time's up."
utimer -t ${1}
ccount=$((${ccount}+1))
if [ ${ccount} -eq 4 ]; then
clear
ccount=0
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment