Stdout mode: Replace the printinfo function instead of disabling it.
This commit is contained in:
parent
6f69aed92e
commit
943a5493c3
1 changed files with 22 additions and 25 deletions
47
fetch
47
fetch
|
@ -1825,7 +1825,7 @@ info () {
|
||||||
|
|
||||||
# Unset the vars containg escape codes as lemonbar doesn't
|
# Unset the vars containg escape codes as lemonbar doesn't
|
||||||
# support them.
|
# 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
|
underline_color title_color at_color
|
||||||
|
|
||||||
# Show/Hide subtitles
|
# Show/Hide subtitles
|
||||||
|
@ -1873,19 +1873,21 @@ prin () {
|
||||||
# Stdout {{{
|
# Stdout {{{
|
||||||
|
|
||||||
stdout () {
|
stdout () {
|
||||||
index=1
|
printinfo () {
|
||||||
for func in "${args[@]}"; do
|
index=1
|
||||||
|
for func in "${args[@]}"; do
|
||||||
|
|
||||||
case "$func" in
|
case "$func" in
|
||||||
"--stdout") continue ;;
|
"--stdout") continue ;;
|
||||||
"--"*) break ;;
|
"--"*) break ;;
|
||||||
*)
|
*)
|
||||||
case "${args[$((index + 1))]}" in "--"*) unset stdout_seperator ;; esac
|
case "${args[$((index + 1))]}" in "--"*) unset stdout_seperator ;; esac
|
||||||
info "$func"
|
info "$func"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
index=$((index + 1))
|
index=$((index + 1))
|
||||||
done
|
done
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
@ -2212,13 +2214,12 @@ while [ "$1" ]; do
|
||||||
--stdout)
|
--stdout)
|
||||||
case "$2" in
|
case "$2" in
|
||||||
"--"* | "") stdout="on" ;;
|
"--"* | "") stdout="on" ;;
|
||||||
*) stdout="on"; stdout_args="on" ;;
|
*) stdout="on"; stdout_args="on"; args=("$@"); stdout ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
unset info_color
|
unset info_color colors
|
||||||
image="off"
|
image="off"
|
||||||
color_blocks="off"
|
color_blocks="off"
|
||||||
args=("$@")
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# Other
|
# Other
|
||||||
|
@ -2284,16 +2285,12 @@ fi
|
||||||
# Move cursor to the top
|
# Move cursor to the top
|
||||||
[ "$image" != "off" ] && printf "\033[0H"
|
[ "$image" != "off" ] && printf "\033[0H"
|
||||||
|
|
||||||
if [ "$stdout_args" == "on" ]; then
|
# Get colors / bold
|
||||||
stdout
|
colors 2>/dev/null
|
||||||
else
|
bold
|
||||||
# Get colors / bold
|
|
||||||
colors
|
|
||||||
bold
|
|
||||||
|
|
||||||
# Print the info
|
# Print the info
|
||||||
printinfo
|
printinfo
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$image" != "off" ]; then
|
if [ "$image" != "off" ]; then
|
||||||
# Get cursor position
|
# Get cursor position
|
||||||
|
|
Loading…
Reference in a new issue