From 6c80a3461ce3d9da347a8e3072d3114a08948e58 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Wed, 30 Jul 2014 11:55:47 +0200 Subject: [PATCH] Add support for toor account. Currently fish doesn't recognize toor as special. However, it's likely that on BSD systems, fish shell will be used on toor, not on root (toor is an intentionally existing account to use more advanced shell on, like shell). --- share/functions/fish_prompt.fish | 2 +- share/functions/fish_vi_prompt.fish | 2 +- share/tools/web_config/sample_prompts/classic.fish | 2 +- share/tools/web_config/sample_prompts/classic_git.fish | 2 +- share/tools/web_config/sample_prompts/classic_status.fish | 2 +- share/tools/web_config/sample_prompts/debian_chroot.fish | 2 +- share/tools/web_config/sample_prompts/informative.fish | 4 ++-- share/tools/web_config/sample_prompts/nim.fish | 2 +- share/tools/web_config/sample_prompts/user_host_path.fish | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/share/functions/fish_prompt.fish b/share/functions/fish_prompt.fish index f4aab3442..aaa48c684 100644 --- a/share/functions/fish_prompt.fish +++ b/share/functions/fish_prompt.fish @@ -15,7 +15,7 @@ function fish_prompt --description "Write out the prompt" switch $USER - case root + case root toor if not set -q __fish_prompt_cwd if set -q fish_color_cwd_root diff --git a/share/functions/fish_vi_prompt.fish b/share/functions/fish_vi_prompt.fish index cd70a114c..420ea3cf0 100644 --- a/share/functions/fish_vi_prompt.fish +++ b/share/functions/fish_vi_prompt.fish @@ -27,7 +27,7 @@ function fish_vi_prompt --description "Simple vi prompt" switch $USER - case root + case root toor if not set -q __fish_prompt_cwd if set -q fish_color_cwd_root diff --git a/share/tools/web_config/sample_prompts/classic.fish b/share/tools/web_config/sample_prompts/classic.fish index 9464b778f..64c2fb500 100644 --- a/share/tools/web_config/sample_prompts/classic.fish +++ b/share/tools/web_config/sample_prompts/classic.fish @@ -12,7 +12,7 @@ function fish_prompt --description "Write out the prompt" switch $USER - case root + case root toor if not set -q __fish_prompt_cwd if set -q fish_color_cwd_root diff --git a/share/tools/web_config/sample_prompts/classic_git.fish b/share/tools/web_config/sample_prompts/classic_git.fish index 0d91f5fe0..299faa34a 100644 --- a/share/tools/web_config/sample_prompts/classic_git.fish +++ b/share/tools/web_config/sample_prompts/classic_git.fish @@ -43,7 +43,7 @@ function fish_prompt --description 'Write out the prompt' switch $USER - case root + case root toor if not set -q __fish_prompt_cwd if set -q fish_color_cwd_root diff --git a/share/tools/web_config/sample_prompts/classic_status.fish b/share/tools/web_config/sample_prompts/classic_status.fish index a93ff9f22..4b062c5da 100644 --- a/share/tools/web_config/sample_prompts/classic_status.fish +++ b/share/tools/web_config/sample_prompts/classic_status.fish @@ -22,7 +22,7 @@ function fish_prompt --description 'Write out the prompt' set -l user_prompt '>' switch $USER # Set our root colors, if we're root :) - case root + case root toor set user_prompt '#' if not set -q __fish_prompt_cwd if set -q fish_color_cwd_root diff --git a/share/tools/web_config/sample_prompts/debian_chroot.fish b/share/tools/web_config/sample_prompts/debian_chroot.fish index d800c7441..80acfa9a5 100644 --- a/share/tools/web_config/sample_prompts/debian_chroot.fish +++ b/share/tools/web_config/sample_prompts/debian_chroot.fish @@ -31,7 +31,7 @@ function fish_prompt --description 'Write out the prompt, prepending the Debian switch $USER - case root + case root toor if not set -q __fish_prompt_cwd if set -q fish_color_cwd_root diff --git a/share/tools/web_config/sample_prompts/informative.fish b/share/tools/web_config/sample_prompts/informative.fish index 9095b740f..b0bc601b3 100644 --- a/share/tools/web_config/sample_prompts/informative.fish +++ b/share/tools/web_config/sample_prompts/informative.fish @@ -27,7 +27,7 @@ if not set -q __fish_color_blue switch $USER -case root +case root toor if not set -q __fish_prompt_cwd if set -q fish_color_cwd_root @@ -48,4 +48,4 @@ if not set -q __fish_prompt_cwd printf '[%s] %s%s@%s %s%s %s(%s)%s \f\r> ' (date "+%H:%M:%S") "$__fish_color_blue" $USER $__fish_prompt_hostname "$__fish_prompt_cwd" (pwd) "$__fish_color_status" "$stat" "$__fish_prompt_normal" end -end \ No newline at end of file +end diff --git a/share/tools/web_config/sample_prompts/nim.fish b/share/tools/web_config/sample_prompts/nim.fish index 6eab39e68..87837bf86 100644 --- a/share/tools/web_config/sample_prompts/nim.fish +++ b/share/tools/web_config/sample_prompts/nim.fish @@ -13,7 +13,7 @@ function fish_prompt end set_color -o green echo -n [ - if [ $USER = root ] + if test $USER = root -o $USER = toor set_color -o red else set_color -o yellow diff --git a/share/tools/web_config/sample_prompts/user_host_path.fish b/share/tools/web_config/sample_prompts/user_host_path.fish index c125eea0c..de917ee71 100644 --- a/share/tools/web_config/sample_prompts/user_host_path.fish +++ b/share/tools/web_config/sample_prompts/user_host_path.fish @@ -6,7 +6,7 @@ function fish_prompt -d "Write out the prompt" set -l pwd (echo -n $PWD | sed "s/^$home_escaped/~/" | sed 's/ /%20/g') set -l prompt_symbol '' switch $USER - case root; set prompt_symbol '#' + case root toor; set prompt_symbol '#' case '*'; set prompt_symbol '$' end printf "[%s@%s %s%s%s]%s " $USER (hostname -s) (set_color $fish_color_cwd) $pwd (set_color normal) $prompt_symbol