diff options
| author | Paul Buetow <paul@buetow.org> | 2025-06-26 21:37:26 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-06-26 21:37:26 +0300 |
| commit | 7da6c9c2ccc45430f82214bfd43979dc405fb455 (patch) | |
| tree | 9249fc378ad9c7f0f08ead6d7d32b777d0fbc710 | |
| parent | cd25f1fb6cf0e8edfe00d583953ae359da1ad6f8 (diff) | |
add timr
| -rw-r--r-- | dotfiles/fish/conf.d/timr.fish | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/dotfiles/fish/conf.d/timr.fish b/dotfiles/fish/conf.d/timr.fish new file mode 100644 index 0000000..4f08445 --- /dev/null +++ b/dotfiles/fish/conf.d/timr.fish @@ -0,0 +1,25 @@ +function timr_prompt -d "Display timr timr_status in the prompt" + if command -v timr >/dev/null + set -l timr_status (timr prompt) + if test -n "$timr_status" + set -l icon (string sub -l 1 -- "$timr_status") + set -l time (string sub -s 2 -- "$timr_status") + if test "$icon" = "▶" + set_color green + else + set_color yellow + end + printf '%s' "$icon" + set_color normal + printf ' %s' "$time" + end + end +end + +complete -c timr -n __fish_use_subcommand -a start -d "Start the timer" +complete -c timr -n __fish_use_subcommand -a stop -d "Stop the timer" +complete -c timr -n __fish_use_subcommand -a pause -d "Pause the timer" +complete -c timr -n __fish_use_subcommand -a status -d "Show the timer status" +complete -c timr -n __fish_use_subcommand -a reset -d "Reset the timer" +complete -c timr -n __fish_use_subcommand -a live -d "Show the live timer" +complete -c timr -n __fish_use_subcommand -a prompt -d "Show the prompt status" |
