Skip to main content

Basically tty-clock but rewritten in Python

Project description

Clock.py

A Python implementation of the classic tty-clock, a digital clock for your terminal.

Python License Version

Buy Me a Coffee Traktir Saya Kopi

Features

  • 12/24 hour mode
  • Show/hide seconds
  • Display date
  • Custom colors
  • Blink separator
  • UTC time mode
  • Centered or custom positioning
  • Bold characters

Installation

Release

# Install using pipx
pipx install ttyclock-py

Build from Source

# Clone the repository
git clone https://github.com/elliottophellia/clock.py

# Change directory
cd clock.py

# Build the package
poetry build

# Install the package
pipx install dist/ttyclock_py-1.0.0.tar.gz

Usage

ttyclock-py

Command Line Options

-h, --help            show this help message and exit
-c, --center          Center the clock in the terminal
-s, --seconds         Show seconds in the clock
-b, --bold            Use bold characters
-t, --twelve          Use 12-hour format
-P, --ampm            Show AM/PM indicator in 12-hour format
-k, --blink           Blink the colon
-u, --utc             Use UTC time
-d, --date            Show current date
-C, --color {0,1,2,3,4,5,6,7}
                      Set the clock color (0-7)
-x X                  Set the clock's x position
-y Y                  Set the clock's y position
-D, --delay DELAY     Set the update delay (seconds)
-S, --save-config     Save current settings to config file

Configuration

The program stores its configuration in ~/.config/clock-py/config.json. You can modify this file directly or use the --save-config option to save your current settings.

Default configuration:

{
  "color": "GREEN",
  "delay": 0.1,
  "options": {
      "twelve_hour": False,
      "show_seconds": False,
      "bold": False,
      "center": False,
      "blink_colon": False,
      "utc": False,
      "show_date": False,
      "show_ampm": False,
  },
  "position": {
      "x": 0,
      "y": 0
  }
}

License

This project is licensed under the Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.0). For more information, please refer to the LICENSE file included in this repository.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ttyclock_py-1.0.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ttyclock_py-1.0.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file ttyclock_py-1.0.0.tar.gz.

File metadata

  • Download URL: ttyclock_py-1.0.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.8.0-1021-azure

File hashes

Hashes for ttyclock_py-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d387436b9e32ed04704888d6e4efe66b78967ced4680ca791d2e5550b1c5e7b2
MD5 f4e7aabd4a65501a101178517db979d8
BLAKE2b-256 0c942b00be03fb2ba70a29b3222747797718d0c2718a50e3b15bb3971daa0b8e

See more details on using hashes here.

File details

Details for the file ttyclock_py-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ttyclock_py-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.8.0-1021-azure

File hashes

Hashes for ttyclock_py-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3faa4a0e5696311956126ae2aa293c2979694345edc2873242e66a8287c05986
MD5 33433aa20d3114465ce499e1ff1ac9ee
BLAKE2b-256 a50b4b99180d13d553a770623d3f641dda7f85c5acca237a912c9345b1241450

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page