tide/functions/_tide_item_cmd_duration.fish

16 lines
715 B
Fish
Raw Normal View History

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
2021-09-08 06:51:16 +03:00
math --scale=$tide_cmd_duration_decimals "$CMD_DURATION/1000"%60 | read -l seconds
math --scale=0 "$CMD_DURATION/60000"%60 | read -l minutes
2021-08-27 00:09:19 +03:00
math --scale=0 "$CMD_DURATION/3600000" | read -l hours
if test $hours != 0
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' $hours'h ' $minutes'm ' $seconds's'
else if test $minutes != 0
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' $minutes'm ' $seconds's'
else if test $seconds != 0
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' $seconds's'
end
end
2021-03-02 20:46:40 +03:00
end