summaryrefslogtreecommitdiff
path: root/home-config/fish/functions/_tide_item_cmd_duration.fish
diff options
context:
space:
mode:
Diffstat (limited to 'home-config/fish/functions/_tide_item_cmd_duration.fish')
-rw-r--r--home-config/fish/functions/_tide_item_cmd_duration.fish12
1 files changed, 12 insertions, 0 deletions
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 @@
1function _tide_item_cmd_duration
2 test $CMD_DURATION -gt $tide_cmd_duration_threshold && t=(
3 math -s0 "$CMD_DURATION/3600000" # Hours
4 math -s0 "$CMD_DURATION/60000"%60 # Minutes
5 math -s$tide_cmd_duration_decimals "$CMD_DURATION/1000"%60) if test $t[1] != 0
6 _tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[1]h $t[2]m $t[3]s"
7 else if test $t[2] != 0
8 _tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[2]m $t[3]s"
9 else
10 _tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[3]s"
11 end
12end