Skip to content

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

License

Notifications You must be signed in to change notification settings

elliottophellia/clock.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Languages