From b88d77fb2d0d5028a6f5670695dee6bec129501f Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Fri, 5 Apr 2024 11:57:45 -0400 Subject: ahhh sloppy fish, still needs fixing, esp with the vars --- home-config/fish/functions/_tide_item_context.fish | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 home-config/fish/functions/_tide_item_context.fish (limited to 'home-config/fish/functions/_tide_item_context.fish') diff --git a/home-config/fish/functions/_tide_item_context.fish b/home-config/fish/functions/_tide_item_context.fish new file mode 100644 index 0000000..cbdf420 --- /dev/null +++ b/home-config/fish/functions/_tide_item_context.fish @@ -0,0 +1,14 @@ +function _tide_item_context + if set -q SSH_TTY + set -fx tide_context_color $tide_context_color_ssh + else if test "$EUID" = 0 + set -fx tide_context_color $tide_context_color_root + else if test "$tide_context_always_display" = true + set -fx tide_context_color $tide_context_color_default + else + return + end + + string match -qr "^(?(\.?[^\.]*){0,$tide_context_hostname_parts})" @$hostname + _tide_print_item context $USER$h +end -- cgit v1.2.3