From 78ef972de7719844c7eb8fdc0ef37b9e6a92bce6 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 27 Sep 2022 00:04:46 +0200 Subject: [PATCH] Change detections --- functions/fish_prompt.fish | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index cfcf394..8a4ef6f 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -9,15 +9,12 @@ function fish_prompt case "/root" # Root set_color brred - case "/srv/*" - # System account - set_color brpurple case "/home/*" # Regular user set_color brgreen case "*" # Temporary account - set_color brcyan + set_color brpurple end echo -n "$USER" @@ -36,10 +33,12 @@ function fish_prompt # Hostname - if test -z "$SSH_CLIENT" - set_color green - else + if test -n "$SSH_CLIENT" set_color cyan + else if test -n "$SUDO_COMMAND" + set_color purple + else + set_color green end echo -n (prompt_hostname)