This is a command-line tool written in Rust for displaying a clock or a countdown timer with customizable fonts and colors using the cfonts
library. The tool can also execute a command when a timer completes.
- Display the current time in a specified timezone.
- Show a countdown timer for a given duration.
- Show the current date and weekday.
- Execute a command when the timer completes.
- Customizable font colors.
- Ensure you have Rust installed. If not, install it from rust-lang.org.
- Clone this repository:
git clone https://github.com/nuwak/rclock cd rclock
- Build the project:
cargo build --release sudo cp target/release/rclock /usr/local/bin
- The executable will be located in
target/release/
. You can add it to your PATH for easier usage.
The tool provides several options to customize its behavior. Here is the basic usage:
rclock [OPTIONS]
-c, --color <COLOR>
: Color index (1-9) for the font (default: 2).-t, --timezone <TIMEZONE>
: Timezone for the clock (default: "Europe/Belgrade").-d, --duration <DURATION>
: Countdown duration (e.g., '3h', '125m', '3:12:15').-D, --date
: Display the current date and weekday.-x, --command <COMMAND>
: Command to execute when the timer completes.-T, --target-time <TARGET_TIME>
: Target time for countdown (e.g., '2024-12-31T23:59:59Z').
-
Display the current time in a specified timezone:
rclock --timezone "America/New_York"
-
Display a countdown timer for 5 minutes:
rclock --duration "5m"
-
Display the current date and weekday:
rclock --date
-
Execute a command when the timer completes:
rclock --duration "1h" --command "echo 'Time is up!'"
-
Countdown to a specific target time:
rclock --target-time "23:59:59"
-
Other
rclock -d '0:0:10' -x 'paplay files/notification.wav'
rclock -c 3 -t 'Asia/Manila'
rclock
rclock -T '23:0:0'
rclock -d '10m'
rclock -h
bash tmux.sh
- Press
SPACE
to pause/resume the timer. - Press
q
to quit the application.
This project is licensed under the MIT License. See the LICENSE
file for details.
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
- cfonts for the beautiful font rendering.
- chrono for handling date and time.
- clap for argument parsing.
- Nuwak - GitHub