aboutsummaryrefslogtreecommitdiff
path: root/README
blob: a8ebce504b4653d3a2e5b5572f4da318319860cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
ttym - terminal countdown / stopwatch
=====================================

A small countdown timer and stopwatch in C. Single binary, libc-only,
no daemon. Default build is intentionally minimal:

    T-24:13 +00:47 [>>>>>>>>>>------------------------------]  25%

  - countdown when given a duration; stopwatch when not
  - pause/resume with [space], quit with [q] or Ctrl+C
  - ASCII progress bar
  - one-shot terminal bell on completion

Anything beyond that is an optional patch under patches/. See
patches/README for the available set and apply order.


Requirements
------------

A C compiler and POSIX make. No external libraries.


Installation
------------

Edit config.mk if needed, then:

    make
    sudo make install      # to $(PREFIX)/bin/timer ; default /usr/local

Override the prefix at build time:

    make PREFIX=$HOME/.local install

The installed binary is named `timer`.


Configuration
-------------

Compile-time knobs live in config.def.h. On first build the Makefile
copies it to config.h; edit config.h and re-`make` to change defaults.


Usage
-----

    timer [FLAGS] DURATION    countdown
    timer [FLAGS]             stopwatch

    DURATION:  25m | 90s | 2h | 1h30m | 01:30:00 | 25:00

    FLAGS:
      -q              no sound
      -s              silent
      --              end of options
      -h              help

`timer -h` always reflects the build: each patch updates the help text
in lockstep with the flags it adds.


License
-------

MIT. See LICENSE.