tide/functions/_tide_item_status.fish

28 lines
1.2 KiB
Fish
Raw Normal View History

2020-05-20 20:05:33 +03:00
function _tide_item_status
2020-07-21 00:11:59 +03:00
if string match --quiet --invert '0' $_tide_last_pipestatus # If there is a failure anywhere in the pipestatus
2020-07-09 04:37:47 +03:00
if test "$_tide_last_pipestatus" = '1'
2020-07-23 19:12:08 +03:00
if test "$tide_status_always_display" = 'true'
2020-07-09 04:37:47 +03:00
set -g tide_status_bg_color $tide_status_failure_bg_color
set_color $tide_status_failure_color
2020-09-07 07:34:58 +03:00
printf '%s' $tide_status_failure_icon' ' '1'
2020-07-09 04:37:47 +03:00
end
2020-07-12 02:45:23 +03:00
return
2020-07-09 04:37:47 +03:00
end
2020-07-03 20:27:10 +03:00
if test $_tide_last_status -eq 0
2020-07-08 19:58:39 +03:00
set -g tide_status_bg_color $tide_status_success_bg_color
2020-07-03 20:27:10 +03:00
set_color $tide_status_success_color
2020-09-07 07:34:58 +03:00
printf '%s' $tide_status_success_icon' '
2020-07-03 20:27:10 +03:00
else
2020-07-08 19:58:39 +03:00
set -g tide_status_bg_color $tide_status_failure_bg_color
2020-07-03 20:27:10 +03:00
set_color $tide_status_failure_color
2020-09-07 07:34:58 +03:00
printf '%s' $tide_status_failure_icon' '
end
2020-07-03 20:27:10 +03:00
2020-07-08 19:58:39 +03:00
__fish_pipestatus_with_signal $_tide_last_pipestatus | string replace 'SIG' '' | string join '|'
2020-07-23 19:12:08 +03:00
else if test "$tide_status_always_display" = 'true'
2020-07-08 19:58:39 +03:00
set -g tide_status_bg_color $tide_status_success_bg_color
2020-07-03 20:27:10 +03:00
set_color $tide_status_success_color
printf '%s' $tide_status_success_icon
end
end