1

Add a status indicator for SSH sessions

This commit is contained in:
Jessie Hildebrandt 2018-05-04 22:25:53 -04:00
parent f9b952246f
commit b59372af65

View File

@ -22,16 +22,22 @@ function fish_prompt --description 'Write out the prompt'
# Color Definitions # Color Definitions
set -l normal_color (set_color normal) set -l normal_color (set_color normal)
set -l ssh_color (set_color brwhite)
set -l bat_color (set_color bryellow) set -l bat_color (set_color bryellow)
set -l usr_color (set_color brgreen) set -l usr_color (set_color brgreen)
set -l dir_color (set_color brblue) set -l dir_color (set_color brblue)
set -l vcs_color (set_color brblack) set -l vcs_color (set_color brblack)
set -l err_color (set_color red) set -l err_color (set_color red)
# Battery File Location # Battery File Location
set -l bat_file /sys/class/power_supply/BAT0/capacity set -l bat_file /sys/class/power_supply/BAT0/capacity
# SSH Status Formatting
set -l ssh_status ""
if test -n "$SSH_CONNECTION"
set ssh_status "$ssh_color" "[ssh]" "$nromal_color" " "
end
# Battery Status Formatting # Battery Status Formatting
set -l bat_status "" set -l bat_status ""
if test -f $bat_file if test -f $bat_file
@ -64,6 +70,6 @@ function fish_prompt --description 'Write out the prompt'
end end
# Print Prompt # Print Prompt
echo -n -s $bat_status $user_host " " $current_dir $vcs_status $prompt_status $suffix " " echo -n -s $ssh_status $bat_status $user_host " " $current_dir $vcs_status $prompt_status $suffix " "
end end