2020-05-20 20:05:33 +03:00
|
|
|
function _tide_item_cmd_duration
|
2020-11-25 20:22:35 +03:00
|
|
|
if test $CMD_DURATION -gt $tide_cmd_duration_threshold
|
|
|
|
set -l seconds (math --scale=$tide_cmd_duration_decimals "$CMD_DURATION/1000" % 60)
|
|
|
|
set -l minutes (math --scale=0 "$CMD_DURATION/60000" % 60)
|
|
|
|
set -l hours (math --scale=0 "$CMD_DURATION/3600000")
|
2020-05-13 22:46:42 +03:00
|
|
|
|
2020-10-17 01:45:40 +03:00
|
|
|
set_color $tide_cmd_duration_color
|
|
|
|
|
2020-11-20 02:58:49 +03:00
|
|
|
printf '%s' $tide_cmd_duration_icon' '
|
|
|
|
|
2020-10-17 01:45:40 +03:00
|
|
|
if test $hours -gt 0
|
2020-11-20 02:58:49 +03:00
|
|
|
printf '%s' $hours'h ' $minutes'm ' $seconds's'
|
2020-11-03 22:25:50 +03:00
|
|
|
else if test $minutes -gt 0
|
2020-11-20 02:58:49 +03:00
|
|
|
printf '%s' $minutes'm ' $seconds's'
|
2020-11-03 22:25:50 +03:00
|
|
|
else if test $seconds -gt 0
|
2020-10-17 01:45:40 +03:00
|
|
|
printf '%s' $seconds's'
|
2020-05-13 22:46:42 +03:00
|
|
|
end
|
|
|
|
end
|
2020-10-17 01:45:40 +03:00
|
|
|
end
|