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).
This commit is contained in:
Konrad Borowski 2014-07-30 11:55:47 +02:00
parent 5591afff6e
commit 6c80a3461c
No known key found for this signature in database
GPG key ID: BD0728B4A67A3DF0
9 changed files with 10 additions and 10 deletions

View file

@ -15,7 +15,7 @@ function fish_prompt --description "Write out the prompt"
switch $USER switch $USER
case root case root toor
if not set -q __fish_prompt_cwd if not set -q __fish_prompt_cwd
if set -q fish_color_cwd_root if set -q fish_color_cwd_root

View file

@ -27,7 +27,7 @@ function fish_vi_prompt --description "Simple vi prompt"
switch $USER switch $USER
case root case root toor
if not set -q __fish_prompt_cwd if not set -q __fish_prompt_cwd
if set -q fish_color_cwd_root if set -q fish_color_cwd_root

View file

@ -12,7 +12,7 @@ function fish_prompt --description "Write out the prompt"
switch $USER switch $USER
case root case root toor
if not set -q __fish_prompt_cwd if not set -q __fish_prompt_cwd
if set -q fish_color_cwd_root if set -q fish_color_cwd_root

View file

@ -43,7 +43,7 @@ function fish_prompt --description 'Write out the prompt'
switch $USER switch $USER
case root case root toor
if not set -q __fish_prompt_cwd if not set -q __fish_prompt_cwd
if set -q fish_color_cwd_root if set -q fish_color_cwd_root

View file

@ -22,7 +22,7 @@ function fish_prompt --description 'Write out the prompt'
set -l user_prompt '>' set -l user_prompt '>'
switch $USER switch $USER
# Set our root colors, if we're root :) # Set our root colors, if we're root :)
case root case root toor
set user_prompt '#' set user_prompt '#'
if not set -q __fish_prompt_cwd if not set -q __fish_prompt_cwd
if set -q fish_color_cwd_root if set -q fish_color_cwd_root

View file

@ -31,7 +31,7 @@ function fish_prompt --description 'Write out the prompt, prepending the Debian
switch $USER switch $USER
case root case root toor
if not set -q __fish_prompt_cwd if not set -q __fish_prompt_cwd
if set -q fish_color_cwd_root if set -q fish_color_cwd_root

View file

@ -27,7 +27,7 @@ if not set -q __fish_color_blue
switch $USER switch $USER
case root case root toor
if not set -q __fish_prompt_cwd if not set -q __fish_prompt_cwd
if set -q fish_color_cwd_root if set -q fish_color_cwd_root

View file

@ -13,7 +13,7 @@ function fish_prompt
end end
set_color -o green set_color -o green
echo -n [ echo -n [
if [ $USER = root ] if test $USER = root -o $USER = toor
set_color -o red set_color -o red
else else
set_color -o yellow set_color -o yellow

View file

@ -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 pwd (echo -n $PWD | sed "s/^$home_escaped/~/" | sed 's/ /%20/g')
set -l prompt_symbol '' set -l prompt_symbol ''
switch $USER switch $USER
case root; set prompt_symbol '#' case root toor; set prompt_symbol '#'
case '*'; set prompt_symbol '$' case '*'; set prompt_symbol '$'
end end
printf "[%s@%s %s%s%s]%s " $USER (hostname -s) (set_color $fish_color_cwd) $pwd (set_color normal) $prompt_symbol printf "[%s@%s %s%s%s]%s " $USER (hostname -s) (set_color $fish_color_cwd) $pwd (set_color normal) $prompt_symbol