Skip to content

Commit

Permalink
Minor edits to cmd_duration
Browse files Browse the repository at this point in the history
  • Loading branch information
IlanCosman committed Sep 12, 2022
1 parent 73c7b46 commit 98b087a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions functions/_tide_item_cmd_duration.fish
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
function _tide_item_cmd_duration
test $CMD_DURATION -gt $tide_cmd_duration_threshold && time=(math --scale=0 "$CMD_DURATION/3600000" # Hours
math --scale=0 "$CMD_DURATION/60000"%60 # Minutes
math --scale=$tide_cmd_duration_decimals "$CMD_DURATION/1000"%60) if test $time[1] != 0
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$time[1]h $time[2]m $time[3]s"
else if test $time[2] != 0
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$time[2]m $time[3]s"
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"
else
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$time[3]s"
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[3]s"
end
end

0 comments on commit 98b087a

Please sign in to comment.