Fix code indentation
This commit is contained in:
parent
9235358bb0
commit
f9b952246f
77
config.fish
77
config.fish
@ -17,54 +17,53 @@ set fish_key_bindings fish_default_key_bindings
|
|||||||
|
|
||||||
function fish_prompt --description 'Write out the prompt'
|
function fish_prompt --description 'Write out the prompt'
|
||||||
|
|
||||||
# Get Exit Status
|
# Get Exit Status
|
||||||
set -l last_status $status
|
set -l last_status $status
|
||||||
|
|
||||||
# Color Definitions
|
# Color Definitions
|
||||||
set -l normal_color (set_color normal)
|
set -l normal_color (set_color normal)
|
||||||
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 DISABLED
|
set -l bat_file /sys/class/power_supply/BAT0/capacity
|
||||||
set -l bat_file /sys/class/power_supply/BAT0/capacity
|
|
||||||
|
|
||||||
# Battery Status Formatting
|
# Battery Status Formatting
|
||||||
set -l bat_status ""
|
set -l bat_status ""
|
||||||
if test -f $bat_file
|
if test -f $bat_file
|
||||||
set -l bat_capacity (cat $bat_file)
|
set -l bat_capacity (cat $bat_file)
|
||||||
set bat_status "$bat_color" "$bat_capacity" "%" "$normal_color" " "
|
set bat_status "$bat_color" "$bat_capacity" "%" "$normal_color" " "
|
||||||
end
|
end
|
||||||
|
|
||||||
# User/Hostname Formatting
|
# User/Hostname Formatting
|
||||||
set -l user_host $usr_color $USER "@" (hostname -s) "$normal_color"
|
set -l user_host $usr_color $USER "@" (hostname -s) "$normal_color"
|
||||||
|
|
||||||
# Working Directory Formatting
|
# Working Directory Formatting
|
||||||
set -l home_escaped (echo -n $HOME | sed 's/\//\\\\\//g')
|
set -l home_escaped (echo -n $HOME | sed 's/\//\\\\\//g')
|
||||||
set -l pwd (echo -n $PWD | sed "s/^$home_escaped/~/")
|
set -l pwd (echo -n $PWD | sed "s/^$home_escaped/~/")
|
||||||
set -l current_dir "$dir_color" "$pwd" "$normal_color"
|
set -l current_dir "$dir_color" "$pwd" "$normal_color"
|
||||||
|
|
||||||
# Suffix Symbol Selection
|
# Suffix Symbol Selection
|
||||||
set -l suffix ""
|
set -l suffix ""
|
||||||
switch $USER
|
switch $USER
|
||||||
case root toor; set suffix "#"
|
case root toor; set suffix "#"
|
||||||
case "*"; set suffix ">"
|
case "*"; set suffix ">"
|
||||||
end
|
end
|
||||||
|
|
||||||
# VCS Status Formatting
|
# VCS Status Formatting
|
||||||
set -l vcs_status "$vcs_color" (__fish_vcs_prompt) "$normal_color"
|
set -l vcs_status "$vcs_color" (__fish_vcs_prompt) "$normal_color"
|
||||||
|
|
||||||
# Exit Status Formatting
|
# Exit Status Formatting
|
||||||
set -l prompt_status
|
set -l prompt_status
|
||||||
if test $last_status -ne 0
|
if test $last_status -ne 0
|
||||||
set prompt_status " " "$err_color" "[$last_status]" "$normal_color"
|
set prompt_status " " "$err_color" "[$last_status]" "$normal_color"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Print Prompt
|
# Print Prompt
|
||||||
echo -n -s $bat_status $user_host " " $current_dir $vcs_status $prompt_status $suffix " "
|
echo -n -s $bat_status $user_host " " $current_dir $vcs_status $prompt_status $suffix " "
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user