mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
first real try to create good konvi output
This commit is contained in:
parent
be487b8fe3
commit
8efcaa874b
19
inxi
19
inxi
|
@ -331,31 +331,25 @@ script_debugger()
|
||||||
|
|
||||||
# inxi speaks through here. When run by Konversation, uses DCOP
|
# inxi speaks through here. When run by Konversation, uses DCOP
|
||||||
# for dcop to work, must use 'say' operator, AND colors must be evaluated by echo -e
|
# for dcop to work, must use 'say' operator, AND colors must be evaluated by echo -e
|
||||||
# print_working_output prior to final output
|
|
||||||
print_screen_output()
|
print_screen_output()
|
||||||
{
|
{
|
||||||
|
local print_data=$( echo -e "$1" )
|
||||||
|
|
||||||
if [[ $DEBUG -gt 5 ]];then
|
if [[ $DEBUG -gt 5 ]];then
|
||||||
if [[ $KONVI -eq 1 ]];then
|
if [[ $KONVI -eq 1 ]];then
|
||||||
dcop "$DCPORT" "$DCOPOBJ" say "$DCSERVER" "$DCTARGET" "konvi='$KONVI' saying : '$@'"
|
dcop "$DCPORT" "$DCOPOBJ" say "$DCSERVER" "$DCTARGET" "konvi='$KONVI' saying : '$print_data'"
|
||||||
else
|
else
|
||||||
echo "konvi='$KONVI' saying : '$@'"
|
echo "konvi='$KONVI' saying : '$print_data'"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $KONVI -eq 1 ]];then
|
if [[ $KONVI -eq 1 ]];then
|
||||||
dcop "$DCPORT" "$DCOPOBJ" say "$DCSERVER" "$DCTARGET" "$1"
|
dcop "$DCPORT" "$DCOPOBJ" say "$DCSERVER" "$DCTARGET" "$print_data"
|
||||||
else
|
else
|
||||||
echo -ne "$1\n"
|
echo -ne "$print_data\n"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# args: $1 - string to evaluate. This is required for dcop colors output, if no echo -e
|
|
||||||
# is used, the colors fail to render. Always use this before you actually output the line.
|
|
||||||
print_working_output()
|
|
||||||
{
|
|
||||||
echo -e "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
## this handles all verbose line construction with indentation/line starter
|
## this handles all verbose line construction with indentation/line starter
|
||||||
## args: $1 - null (, actually: " ") or line starter; $2 - line content
|
## args: $1 - null (, actually: " ") or line starter; $2 - line content
|
||||||
create_print_line()
|
create_print_line()
|
||||||
|
@ -2127,7 +2121,6 @@ print_short_data()
|
||||||
if [[ $SCHEME -gt 0 ]];then
|
if [[ $SCHEME -gt 0 ]];then
|
||||||
short_data="${short_data} $NORMAL"
|
short_data="${short_data} $NORMAL"
|
||||||
fi
|
fi
|
||||||
short_data=$( print_working_output "$short_data" )
|
|
||||||
print_screen_output "$short_data"
|
print_screen_output "$short_data"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue