summaryrefslogtreecommitdiff
path: root/home-config/fish/functions/_tide_item_context.fish
diff options
context:
space:
mode:
Diffstat (limited to 'home-config/fish/functions/_tide_item_context.fish')
-rw-r--r--home-config/fish/functions/_tide_item_context.fish14
1 files changed, 14 insertions, 0 deletions
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 @@
1function _tide_item_context
2 if set -q SSH_TTY
3 set -fx tide_context_color $tide_context_color_ssh
4 else if test "$EUID" = 0
5 set -fx tide_context_color $tide_context_color_root
6 else if test "$tide_context_always_display" = true
7 set -fx tide_context_color $tide_context_color_default
8 else
9 return
10 end
11
12 string match -qr "^(?<h>(\.?[^\.]*){0,$tide_context_hostname_parts})" @$hostname
13 _tide_print_item context $USER$h
14end