Fix weird behaviour with prin and --stdout
This commit is contained in:
parent
a69b86a22a
commit
4ad5cf791d
11
fetch
11
fetch
|
@ -1235,7 +1235,7 @@ getbattery () {
|
||||||
# If there's only a single battery and it's battery 0,
|
# If there's only a single battery and it's battery 0,
|
||||||
# don't number the subtitle.
|
# don't number the subtitle.
|
||||||
if [ "${#batteries[@]}" == 1 ] && [ "$battery_num" == 0 ]; then
|
if [ "${#batteries[@]}" == 1 ] && [ "$battery_num" == 0 ]; then
|
||||||
prin "${title}: ${batteries[0]}%"
|
battery="$(prin "${title}: ${batteries[0]}%")"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1858,10 +1858,11 @@ prin () {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Print the info
|
# Print the info
|
||||||
printf "%b%s" "${padding}${string}${clear}"
|
if [ "$stdout" == "on" ]; then
|
||||||
|
printf "%s" "${string}${stdout_seperator}"
|
||||||
# If stdout mode is off, print a newline too.
|
else
|
||||||
[ "$stdout" == "off" ] && printf "\n"
|
printf "%b%s\n" "${padding}${string}${clear}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
Reference in New Issue