2020-05-20 20:05:33 +03:00
|
|
|
function _tide_item_cmd_duration
|
2020-05-19 06:03:25 +03:00
|
|
|
if test $CMD_DURATION -gt $tide_cmd_duration_threshold
|
|
|
|
set -l seconds (math --scale=$tide_cmd_duration_decimals "$CMD_DURATION/1000" % 60)
|
2020-05-14 01:25:02 +03:00
|
|
|
set -l minutes (math -s0 "$CMD_DURATION/60000" % 60)
|
|
|
|
set -l hours (math -s0 "$CMD_DURATION/3600000" % 60)
|
2020-05-13 22:46:42 +03:00
|
|
|
|
2020-05-14 01:25:02 +03:00
|
|
|
if test $seconds -eq 0
|
|
|
|
set -e seconds
|
|
|
|
end
|
|
|
|
if test $minutes -eq 0
|
|
|
|
set -e minutes
|
|
|
|
end
|
|
|
|
if test $hours -eq 0
|
|
|
|
set -e hours
|
2020-05-13 22:46:42 +03:00
|
|
|
end
|
|
|
|
|
2020-05-19 06:03:25 +03:00
|
|
|
set_color $tide_cmd_duration_color
|
2020-06-25 05:45:50 +03:00
|
|
|
printf '%s' {$hours}'h' {$minutes}'m' {$seconds}'s'
|
2020-05-13 22:46:42 +03:00
|
|
|
end
|
|
|
|
end
|