From 6d9c8e364a5a1fc8cb35a77da33d898aee9da069 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sat, 21 Jan 2023 17:15:54 -0500 Subject: [PATCH] fish: add time info to prompt --- src/.config/fish/functions/prompts.fish | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/.config/fish/functions/prompts.fish b/src/.config/fish/functions/prompts.fish index 0222328..04d0c3e 100644 --- a/src/.config/fish/functions/prompts.fish +++ b/src/.config/fish/functions/prompts.fish @@ -16,6 +16,19 @@ function fish_right_prompt set usercolor (set_color $col) end + set -l duration "$cmd_duration$CMD_DURATION" + if test $duration -gt 100 + set duration (math $duration / 1000)s + else + set duration + end + + printf '%s%s %s%s%s' \ + (set_color brgrey) \ + $duration \ + (set_color brblue) \ + (date +"%H:%M") \ + (set_color normal) printf '%s ' \ (fish_git_prompt) printf '%s%s@%s%s'\