function fish_right_prompt set last_status $status # check for which color to use if test $last_status -eq 0 set color white else set color red end # set battery capacity in bat set bat $(cat /sys/class/power_supply/BAT0/capacity) # move up a line echo -e "\e[1A" # print prompt echo -e (set_color red)"( "(set_color $color)"$last_status"(set_color red)" |" \ (set_color white)"$bat%"(set_color red)" )"(set_color normal) echo -e "\e[1B" end