diff options
author | Ryan Schanzenbacher <ryan@rschanz.org> | 2024-04-05 11:57:45 -0400 |
---|---|---|
committer | Ryan Schanzenbacher <ryan@rschanz.org> | 2024-04-05 11:57:45 -0400 |
commit | b88d77fb2d0d5028a6f5670695dee6bec129501f (patch) | |
tree | 2536b0461d297e647cf07157641c9b1223339adf /home-config/fish/functions/_tide_item_status.fish | |
parent | 776a7ca55d2d2c3f396de91db1c6c3c5065012cd (diff) |
ahhh sloppy fish, still needs fixing, esp with the vars
Diffstat (limited to 'home-config/fish/functions/_tide_item_status.fish')
-rw-r--r-- | home-config/fish/functions/_tide_item_status.fish | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/home-config/fish/functions/_tide_item_status.fish b/home-config/fish/functions/_tide_item_status.fish new file mode 100644 index 0000000..3a040fd --- /dev/null +++ b/home-config/fish/functions/_tide_item_status.fish | |||
@@ -0,0 +1,15 @@ | |||
1 | function _tide_item_status | ||
2 | if string match -qv 0 $_tide_pipestatus # If there is a failure anywhere in the pipestatus | ||
3 | if test "$_tide_pipestatus" = 1 # If simple failure | ||
4 | contains character $_tide_left_items || tide_status_bg_color=$tide_status_bg_color_failure \ | ||
5 | tide_status_color=$tide_status_color_failure _tide_print_item status $tide_status_icon_failure' ' 1 | ||
6 | else | ||
7 | fish_status_to_signal $_tide_pipestatus | string replace SIG '' | string join '|' | read -l out | ||
8 | test $_tide_status = 0 && _tide_print_item status $tide_status_icon' ' $out || | ||
9 | tide_status_bg_color=$tide_status_bg_color_failure tide_status_color=$tide_status_color_failure \ | ||
10 | _tide_print_item status $tide_status_icon_failure' ' $out | ||
11 | end | ||
12 | else if not contains character $_tide_left_items | ||
13 | _tide_print_item status $tide_status_icon | ||
14 | end | ||
15 | end | ||