summaryrefslogtreecommitdiff
path: root/home-config/fish/functions/_tide_item_context.fish
diff options
context:
space:
mode:
authorRyan Schanzenbacher <ryan@rschanz.org>2024-04-05 11:57:45 -0400
committerRyan Schanzenbacher <ryan@rschanz.org>2024-04-05 11:57:45 -0400
commitb88d77fb2d0d5028a6f5670695dee6bec129501f (patch)
tree2536b0461d297e647cf07157641c9b1223339adf /home-config/fish/functions/_tide_item_context.fish
parent776a7ca55d2d2c3f396de91db1c6c3c5065012cd (diff)
ahhh sloppy fish, still needs fixing, esp with the vars
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