Skip to content

Displaying the percent sign (%) at the end of the right prompt #153

Answered by reobin
bound-variable asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @Pound-Hash !

That is actually a great use of the prefix function!

Try doubling your percentage sign:

battery() {
  local capacity=$(cat /sys/class/power_supply/BAT0/capacity)
  echo "${capacity}%%"
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bound-variable
Comment options

Answer selected by reobin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants