Countdown timer built in Go
-
Install
go
-
Build from source
$ git clone https://github.com/Murtaza-Udaipurwala/countdown
$ cd countdown
$ make PREFIX=~/.local install
- Help
$ ./countdown -h
- Simple stopwatch
$ ./countdown
- Countdown timer
$ ./countdown -s 10 # start a countdown timer for 10 seconds
$ ./countdown -m 10 # start a countdown timer for 10 minutes
$ ./countdown -h 1 -m 39 -s 18 # start a countdown timer for 1 hour, 39 minutes and 18 seconds
- Colors
$ ./countdown -c # enable colorful output. To be used in conjuction with any flag
#!/bin/sh
hidecursor() {
if type setterm >/dev/null 2>&1; then
setterm --cursor off
fi
}
showcursor() {
if type setterm >/dev/null 2>&1; then
setterm --cursor on
fi
}
clear
hidecursor
trap 'showcursor' 2
countdown "$@"
showcursor