tide/functions/_tide_item_status.fish

16 lines
934 B
Fish
Raw Normal View History

2020-05-20 20:05:33 +03:00
function _tide_item_status
2022-01-12 21:24:41 +03:00
if string match -qv 0 $_tide_pipestatus # If there is a failure anywhere in the pipestatus
2021-10-01 07:18:16 +03:00
if test "$_tide_pipestatus" = 1 # If simple failure
contains character $_tide_left_items || tide_status_bg_color=$tide_status_bg_color_failure \
2021-07-03 21:24:29 +03:00
tide_status_color=$tide_status_color_failure _tide_print_item status $tide_status_icon_failure' ' 1
2020-07-03 20:27:10 +03:00
else
2021-12-05 06:25:40 +03:00
fish_status_to_signal $_tide_pipestatus | string replace SIG '' | string join '|' | read -l out
test $_tide_status = 0 && _tide_print_item status $tide_status_icon' ' $out ||
tide_status_bg_color=$tide_status_bg_color_failure tide_status_color=$tide_status_color_failure \
_tide_print_item status $tide_status_icon_failure' ' $out
2020-11-25 01:30:45 +03:00
end
else if not contains character $_tide_left_items
2021-07-07 01:41:52 +03:00
_tide_print_item status $tide_status_icon
end
2021-03-02 20:46:40 +03:00
end