Minor edits to cmd_duration

This commit is contained in:
Ilan Cosman 2021-09-27 11:46:58 -07:00
parent 049074e2a3
commit 45f598723b

View File

@ -1,15 +1,15 @@
function _tide_item_cmd_duration function _tide_item_cmd_duration
if test $CMD_DURATION -gt $tide_cmd_duration_threshold if test $CMD_DURATION -gt $tide_cmd_duration_threshold
math --scale=$tide_cmd_duration_decimals "$CMD_DURATION/1000"%60 | read -l seconds set -l time (math --scale=0 "$CMD_DURATION/3600000" # Hours
math --scale=0 "$CMD_DURATION/60000"%60 | read -l minutes math --scale=0 "$CMD_DURATION/60000"%60 # Minutes
math --scale=0 "$CMD_DURATION/3600000" | read -l hours math --scale=$tide_cmd_duration_decimals "$CMD_DURATION/1000"%60) # Seconds
if test $hours != 0 if test $time[1] != 0
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' $hours'h ' $minutes'm ' $seconds's' _tide_print_item cmd_duration $tide_cmd_duration_icon' ' $time[1]'h ' $time[2]'m ' $time[3]'s'
else if test $minutes != 0 else if test $time[2] != 0
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' $minutes'm ' $seconds's' _tide_print_item cmd_duration $tide_cmd_duration_icon' ' $time[2]'m ' $time[3]'s'
else if test $seconds != 0 else
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' $seconds's' _tide_print_item cmd_duration $tide_cmd_duration_icon' ' $time[3]'s'
end end
end end
end end