generated from PlexSheep/rs-base
update README for countdown mode
This commit is contained in:
parent
f3e58a635d
commit
9ef4575931
3 changed files with 27 additions and 2 deletions
27
README.md
27
README.md
|
@ -14,6 +14,10 @@ A clock app in terminal. It support the following modes:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## Countdown
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
@ -31,8 +35,13 @@ $ tclock
|
||||||
```
|
```
|
||||||
Run this command to start a clock, and press `q` to exit.
|
Run this command to start a clock, and press `q` to exit.
|
||||||
|
|
||||||
|
You can always use `-h` or `--help` to show help message, for exmaple
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ tclock --help
|
$ tclock --help
|
||||||
|
|
||||||
|
# or
|
||||||
|
$ tclock clock -h
|
||||||
```
|
```
|
||||||
|
|
||||||
## Clock mode, this it the default mode
|
## Clock mode, this it the default mode
|
||||||
|
@ -44,6 +53,8 @@ $ tclock clock
|
||||||
$ tclock
|
$ tclock
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For more details, run `tclock clock -h` to show usage.
|
||||||
|
|
||||||
## Run timer
|
## Run timer
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
@ -63,13 +74,27 @@ tclock timer -d 25m -e terminal-notifier -title tclock -message "'Time is up!'"
|
||||||
|
|
||||||
Here we use [terminal-notifier](https://github.com/julienXX/terminal-notifier) to fire a notification when time is up.
|
Here we use [terminal-notifier](https://github.com/julienXX/terminal-notifier) to fire a notification when time is up.
|
||||||
|
|
||||||
|
For more details, run `tclock timer -h` to show usage.
|
||||||
|
|
||||||
## Run stopwatch
|
## Run stopwatch
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ tclock stopwatch
|
$ tclock stopwatch
|
||||||
```
|
```
|
||||||
|
|
||||||
You can press `Space` key to _pause_ and _resume_ the stopwatch.
|
For more details, run `tclock stopwatch -h` to show usage.
|
||||||
|
|
||||||
|
## Run countdown
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ tclock countdown --time 2023-01-01 --title 'New Year 2023'`
|
||||||
|
```
|
||||||
|
|
||||||
|
You can use `-t` or `--time` to specify time, for example: `2023-01-01`, `20:00`, `'2022-12-25 20:00:00'` or `2022-12-25T20:00:00-04:00`.
|
||||||
|
|
||||||
|
You can use `-r` or `--reverse` to run in count-up mode, it counts up duration since the specific time.
|
||||||
|
|
||||||
|
For more details, run `tclock countdown -h` to show usage.
|
||||||
|
|
||||||
## Customize style
|
## Customize style
|
||||||
|
|
||||||
|
|
BIN
assets/demo-countdown-mode.gif
Normal file
BIN
assets/demo-countdown-mode.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 68 KiB |
|
@ -57,7 +57,7 @@ pub(crate) enum Mode {
|
||||||
Stopwatch,
|
Stopwatch,
|
||||||
/// The countdown timer mode shows the duration to a specific time
|
/// The countdown timer mode shows the duration to a specific time
|
||||||
Countdown {
|
Countdown {
|
||||||
/// The target time to countdown to, eg. "2023-01-01", or "20:00"
|
/// The target time to countdown to, eg. "2023-01-01", "20:00", "2022-12-25 20:00:00" or "2022-12-25T20:00:00-04:00"
|
||||||
#[clap(long, short, value_parser = parse_datetime)]
|
#[clap(long, short, value_parser = parse_datetime)]
|
||||||
time: DateTime<Local>,
|
time: DateTime<Local>,
|
||||||
|
|
||||||
|
|
Reference in a new issue