From b88d77fb2d0d5028a6f5670695dee6bec129501f Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Fri, 5 Apr 2024 11:57:45 -0400 Subject: ahhh sloppy fish, still needs fixing, esp with the vars --- home-config/fish/functions/_tide_item_cmd_duration.fish | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 home-config/fish/functions/_tide_item_cmd_duration.fish (limited to 'home-config/fish/functions/_tide_item_cmd_duration.fish') diff --git a/home-config/fish/functions/_tide_item_cmd_duration.fish b/home-config/fish/functions/_tide_item_cmd_duration.fish new file mode 100644 index 0000000..bc48bac --- /dev/null +++ b/home-config/fish/functions/_tide_item_cmd_duration.fish @@ -0,0 +1,12 @@ +function _tide_item_cmd_duration + test $CMD_DURATION -gt $tide_cmd_duration_threshold && t=( + math -s0 "$CMD_DURATION/3600000" # Hours + math -s0 "$CMD_DURATION/60000"%60 # Minutes + math -s$tide_cmd_duration_decimals "$CMD_DURATION/1000"%60) if test $t[1] != 0 + _tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[1]h $t[2]m $t[3]s" + else if test $t[2] != 0 + _tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[2]m $t[3]s" + else + _tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[3]s" + end +end -- cgit v1.2.3