Skip to content
/ timer Public

CLI timer: sleep alternative that displays timer until sleeping is done

Notifications You must be signed in to change notification settings

AmrSaber/timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLI Timer

CLI tool that is very similar to sleep but it shows a timer with the remaining time (timer disappears when done).

demo

It is safe to set

alias sleep=timer

As it behaves exactly the same as sleep (and more).

Install

Go install

You can install the package from code with go by running:

go install github.com/AmrSaber/timer@latest

To uninstall, run:

rm $(which timer)

Download binary

You can also download and use your OS's related binary from releases.

Usage

Use as:

timer 10s

You can add multiple durations (including negative ones) and they will all be summed together to get the final timer duration.

Durations can have any of go duration suffexis (h, m, s, ms, us, ...) but whatever duration is given it is rounded to the closest second. If no suffix is given to a duration, then s is assumed.

Not providing any duration, providing wrong duration, or cancelling the timer before it's done (sending SIGINT signal with ctrl+c) results in exit code of 1; otherwise, exits with 0 exit code when timer is done.

About

CLI timer: sleep alternative that displays timer until sleeping is done

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages