Skip to content
/ chrono Public

Ncurses and/or X11 chronometer with optional milliseconds, pause, reset and countdown functions.

License

Notifications You must be signed in to change notification settings

esselfe/chrono

Repository files navigation

231112
chrono is a terminal ncurses-based and/or X11-based windowed chronometer with  
(optional) millisecond precision, seconds, minutes, hours, days, months & years, 
repeatable countdown, pause and reset function. It is written in the C  
programming language and can be compiled by running:  
'./configure && make' from the source directory.  

Note that you will need the ncurses development headers,
ie: /usr/include/ncursesw/ncurses.h. You can run
'sudo apt install libncurses5-dev' on Debian/DEB-based Linux systems, or
'sudo yum install ncurses-devel' on RedHat/RPM-based systems.
Optionally the X11 headers will be checked during the configure, which can be
installed by running:
'sudo apt install libX11-dev libxext-dev' or
'yum install libX11-devel libXext-devel'
Additionally, you'll need m4, autoconf and automake to be installed due
to a misconfiguration in my autotools setup... to be fixed

You can add these options to the configure script:
--disable-ncurses    To disable terminal-based interface
--disable-x11        To disable GUI-based interface
The default is to enable both if preset. Note that one or both options are
required to be enabled for the program to provide minimal functions.

The other important option is --disable-sdl to disable the beep sound option
using the SDL2 library.

chrono options are:
       -h, --help             Show this help message
       -C, --command COMMAND  Execute COMMAND when the countdown reaches zero
       -c, --countdown FORMAT Count using one of these formats:
                              15, 1:15, 1:30:45, 2:1:5:0, 4:2:0:0:0 (years:months:days:hours:minutes:seconds)
       -D, --debug            Show detailed informations
       -r, --repeat           Repeat the countdown when it reaches zero
       -s, --seconds          Display seconds instead of milliseconds
       -t, --test             Perform debugging tests and exit
       -T, --title TEXT       Set the window title with TEXT
       -V, --version          Show program version and exit

If X11 support is enabled, these options become available:
       -b, --borderless       Create window without decorations/border
       -d, --display NAME     Open screen named NAME (ie ":0.0" or ":1.0")
       -S, --sticky           Show window on all desktops
       -x, --X11              Use the X11 GUI
       -W, --width NUM        Set the window horizontal size
       -H, --height NUM       Set the window vertical size
       -X, --position-x NUM   Set the window horizontal position
       -Y, --position-y NUM   Set the window vertical position
The -x option is not available if built without ncurses support

If SDL2 support is enabled, this option becomes available:
       -B, --beep             Play a sound when the countdown reaches zero

Once chrono is started, you can press:
'p' or <Space> to pause and unpause,
'q' or <Escape> to quit
'r' to reset the counter
's' to toggle milliseconds visibility

The program can be paused and reset programmatically using (from a shell):
killall -SIGUSR1 chrono
killall -SIGUSR2 chrono

About

Ncurses and/or X11 chronometer with optional milliseconds, pause, reset and countdown functions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published