tui-clock

command module
v0.0.0-...-4165f54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2025 License: MIT Imports: 11 Imported by: 0

README

TUI Clock (As Basic As It Gets)

A large, colorful terminal clock that fills most of your terminal using pure Go and ANSI escape sequences.

Screenshot

TUI Clock Screenshot

The clock dynamically scales to fit your terminal size with beautiful gradient colors.

Features

  • 🎨 Colorful Display: Beautiful gradient colors for each row
  • 📏 Dynamic Scaling: Automatically scales to fit your terminal size
  • 🌍 Timezone Support: Display time in any IANA timezone
  • 24-Hour Format: Clean, easy-to-read time display
  • 🎯 Centered Layout: Always perfectly centered with proper borders
  • 🚀 Zero Dependencies: Pure Go, no external dependencies

Prerequisites

  • Go 1.21 or later

Installation

From Source
git clone https://github.com/AlexAvilov/tui-clock.git
cd tui-clock
go build -o tui-clock
Using Go Install
go install github.com/AlexAvilov/tui-clock@latest

Usage

Basic Usage
# Use local time zone
go run .

# Or if installed
tui-clock
Specify Timezone
# Use UTC
go run . -tz=UTC

# Use a specific timezone
go run . -tz=Europe/London
go run . -tz=America/New_York
go run . -tz=Asia/Tokyo
Building
# Build for current platform
go build -o tui-clock

# Build for specific platforms
GOOS=linux GOARCH=amd64 go build -o tui-clock-linux
GOOS=darwin GOARCH=amd64 go build -o tui-clock-macos
GOOS=windows GOARCH=amd64 go build -o tui-clock-windows.exe

How It Works

The clock renders in 24-hour format, hides the cursor, and responds to Ctrl+C for graceful exit. The digits scale dynamically to:

  • Cover approximately 80% of the terminal height
  • Expand horizontally to roughly 90% of the available width
  • Stay perfectly centered with at least a single-character border

The scaling algorithm ensures the clock never overflows your terminal while maximizing the display size.

Controls

  • Ctrl+C: Exit the clock

License

MIT License - see LICENSE file for details.

Documentation

Overview

Package main implements a TUI (Terminal User Interface) clock that displays the current time in large, colorful digits that dynamically scale to fit the terminal size. It supports timezone selection and works in both regular terminals and tmux sessions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL