5

I was looking through an ArchLinux thread on URxvt, and I came across a setup at post #184 that I am going crazy looking for.

enter image description here

It looks like there's some kind of battery bar in the PS1, with a bitmap there too. I'm not all that new to Linux, but I can't find anything on how that's done.

It's fine if it's only for a specific shell, I would just like to know more about it.

5

It is a zsh shell prompt, and Oblique's configs are shared on github.

The basics of the prompt are:

# prompt theme
setopt prompt_subst
PROMPT='%{$fg[blue]%}[%D{%d/%m/%y} %T]%{$reset_color%} %(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m%{$reset_color%} %{$fg[magenta]%}[%(!.%1~.%~)]%{$reset_color%} $(_git_prompt_info)
%{$fg[red]%}>>%{$reset_color%} '
# use battery status only if we are in linux console
if [[ $TERM = linux* ]]; then
    RPROMPT='$(_battery_status)'
fi

The battery status is a separate script and the graphics are created with unicode characters.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.