feat(config): fish
This commit is contained in:
parent
90fe253c51
commit
ab93bfa16d
7 changed files with 491 additions and 0 deletions
28
config/fish/functions/prompt_login.fish
Normal file
28
config/fish/functions/prompt_login.fish
Normal file
|
@ -0,0 +1,28 @@
|
|||
function prompt_login --description "display user name for the prompt"
|
||||
if not set -q __fish_machine
|
||||
set -g __fish_machine
|
||||
set -l debian_chroot $debian_chroot
|
||||
|
||||
if test -r /etc/debian_chroot
|
||||
set debian_chroot (cat /etc/debian_chroot)
|
||||
end
|
||||
|
||||
if set -q debian_chroot[1]
|
||||
and test -n "$debian_chroot"
|
||||
set -g __fish_machine "(chroot:$debian_chroot)"
|
||||
end
|
||||
end
|
||||
|
||||
# Prepend the chroot environment if present
|
||||
if set -q __fish_machine[1]
|
||||
echo -n -s (set_color yellow) "$__fish_machine" (set_color normal) ' '
|
||||
end
|
||||
|
||||
# If we're running via SSH, change the host color.
|
||||
set -l color_host "#95d5b2"
|
||||
if set -q SSH_TTY; and set -q fish_color_host_remote
|
||||
set color_host $fish_color_host_remote
|
||||
end
|
||||
|
||||
echo -n -s (set_color "#ffd6ff" green) "$USER" (set_color normal) @ (set_color $color_host) (prompt_hostname) (set_color normal)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue