Stdout mode: Replace the printinfo function instead of disabling it.

This commit is contained in:
Dylan 2016-02-06 10:21:12 +11:00
parent 6f69aed92e
commit 943a5493c3

15
fetch
View file

@ -1825,7 +1825,7 @@ info () {
# Unset the vars containg escape codes as lemonbar doesn't
# support them.
unset bold subtitle_color clear colon_color info_color \
unset -v bold subtitle_color clear colon_color info_color \
underline_color title_color at_color
# Show/Hide subtitles
@ -1873,6 +1873,7 @@ prin () {
# Stdout {{{
stdout () {
printinfo () {
index=1
for func in "${args[@]}"; do
@ -1887,6 +1888,7 @@ stdout () {
index=$((index + 1))
done
}
}
# }}}
@ -2212,13 +2214,12 @@ while [ "$1" ]; do
--stdout)
case "$2" in
"--"* | "") stdout="on" ;;
*) stdout="on"; stdout_args="on" ;;
*) stdout="on"; stdout_args="on"; args=("$@"); stdout ;;
esac
unset info_color
unset info_color colors
image="off"
color_blocks="off"
args=("$@")
;;
# Other
@ -2284,16 +2285,12 @@ fi
# Move cursor to the top
[ "$image" != "off" ] && printf "\033[0H"
if [ "$stdout_args" == "on" ]; then
stdout
else
# Get colors / bold
colors
colors 2>/dev/null
bold
# Print the info
printinfo
fi
if [ "$image" != "off" ]; then
# Get cursor position