tide/functions/_tide_item_cmd_duration.fish

13 lines
588 B
Fish
Raw Normal View History

2020-05-20 20:05:33 +03:00
function _tide_item_cmd_duration
2022-09-12 03:35:17 +03:00
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"
2021-10-13 07:59:39 +03:00
else
2022-09-12 03:35:17 +03:00
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[3]s"
end
2021-03-02 20:46:40 +03:00
end