Metadata-Version: 2.4
Name: term-clock-app
Version: 1.1.0
Summary: A terminal digital clock that scales to fill the window.
Author: Lorenzo Wood
License: MIT License
        
        Copyright (c) 2026 Lorenzo Wood
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/lorenzowood/term-clock
Project-URL: Repository, https://github.com/lorenzowood/term-clock
Project-URL: Issues, https://github.com/lorenzowood/term-clock/issues
Keywords: clock,terminal,tui,ssh
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Terminals
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# term-clock

A digital clock for the terminal. It shows `hh:mm:ss`, stays on the wall-clock
second, and grows to fill the window. By default it also tracks 15-minute
blocks: amber in the last five minutes, red in the last minute, with a
progress bar under the digits.

Works over SSH the same way it works locally: alternate screen, no flicker,
CTRL+C returns you to the prompt.

## Install

```sh
pip install term-clock-app
```

Already installed:

```sh
pip install -U term-clock-app
```

The PyPI name is `term-clock-app` because `term-clock` / `termclock` is already taken. The command you run is still `term-clock`.

From a clone:

```sh
pip install -e .
```

Python 3.9 or newer. No runtime dependencies.

## Run

```sh
term-clock
# or
python -m term_clock
```

```sh
term-clock --padding 1 --spacing 2          # layout defaults
term-clock --hour-format 12
term-clock --interval off                   # plain clock, no interval colours
term-clock --interval 15 --interval-bar on
term-clock --clock-color "#88ccff" --background-color "#101018"
```

Press **CTRL+C** to quit.

## Options

| Flag | Default | Meaning |
| --- | --- | --- |
| `--padding N` | `1` | Blank rows and columns around the clock |
| `--spacing N` | `2` | Blank columns between digits |
| `--hour-format {12,24}` | system clock, or `24` | 12-hour with AM/PM, or 24-hour |
| `--clock-color HEX` | terminal | Digit colour (`#rrggbb`) |
| `--background-color HEX` | terminal | Background colour |
| `--interval MINUTES` | `15` | Interval length; `off` / `none` disables |
| `--interval-start HH:MM` | `0:00` | Anchor for the interval grid |
| `--interval-amber MINUTES` | `5` | Minutes before the end → amber |
| `--interval-red MINUTES` | `1` | Minutes before the end → red |
| `--interval-amber-color HEX` | `#f09000` | Amber colour |
| `--interval-red-color HEX` | `#ff0000` | Red colour |
| `--interval-bar {on,off}` | `on` | Progress bar under the digits |
| `--config-file FILE` | `~/.config/term-clock/term-clock.conf` | Settings file |

The default hour format follows the environment's time locale
(`LC_TIME` / `T_FMT`) when that can be read. If it cannot, the clock uses 24-hour.

## Intervals

Meetings on 15-minute marks: the clock turns amber in the last 5 minutes of
each block, red in the last minute. The optional bar grows under the digits
from left to right — default colour, then amber, then red — so just before
the boundary you see a full-width bar with a band of amber and a sliver of
red at the end.

`--interval-bar off` hides the bar only; the digits still change colour.
`--interval off` turns intervals off entirely (no colour changes, no bar).

Intervals tile forwards and backwards from `--interval-start` (default
`0:00`), so a 27-minute cycle can still start at `09:00`. With the
defaults, blocks end at `:00`, `:15`, `:30`, and `:45`.

```sh
term-clock --interval 15
term-clock --interval-bar off
term-clock --interval 27 --interval-start 9:00 --interval-amber 5 --interval-red 1
term-clock --interval off
```

## Config file

Flags can live in `~/.config/term-clock/term-clock.conf` (`$XDG_CONFIG_HOME`
if set). CLI flags override the file.

```ini
[term-clock]
padding = 1
spacing = 2
hour-format = 24
clock-color =
background-color =
interval = 15
interval-start = 0:00
interval-amber = 5
interval-red = 1
interval-amber-color = #f09000
interval-red-color = #ff0000
interval-bar = on
```

## Display

- **7 or fewer lines**: a plain text clock, centred.
- **8+ lines**: large seven-segment digits drawn with full blocks `█` for
  horizontal and vertical bars (square ends), and the four triangles
  `◤ ◥ ◣ ◢` for 45° cuts on outer curves (one column per row — never
  sampled, never an off-angle diagonal). They grow to fill the window
  (each axis stretched by at most 1.5× before the rest becomes centring
  margin). If the window is too small for a readable clock, it falls back
  to the text version.
- **Colons**: two small axis-aligned blocks (no diagonals), centred, spanning
  at most one third of the digit height.
- **12-hour**: AM or PM sits to the right of the digits.
- **Timing**: after each paint the process sleeps until the next wall-clock
  second, then keeps waiting until the displayed `hh:mm:ss` actually changes.
  If that second has already arrived, it paints immediately. A resize is
  picked up on the next second. Unchanged cells are not rewritten.

## Develop

```sh
pip install -e ".[dev]"
pytest
```

Pure rendering lives in `term_clock/core.py` (unit-tested). The terminal loop
is in `term_clock/cli.py`.

See `DESIGN.md` for the design and the TDD log.

## License

MIT. See `LICENSE`.
