From e6f728dbf92d2220bf634bd4adecc70a858bd7cc Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Tue, 16 Feb 2010 23:02:01 +0000 Subject: [PATCH] fine tuned output, changed app: to either command: or daemon: , app isn't very accurate since it can be many things. --- inxi | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/inxi b/inxi index 49bb750..6f3c651 100755 --- a/inxi +++ b/inxi @@ -3227,6 +3227,7 @@ get_ps_data() PS_THROTTLED=$PS_COUNT PS_COUNT=5 fi + IFS=$'\n' # note that inxi can use a lot of cpu, and can actually show up here as the script runs A_PS_DATA=( $( ps aux --sort $sort_type | grep -Ev "($SCRIPT_NAME|%CPU)" | $head_tail -n $PS_COUNT | gawk ' @@ -4822,7 +4823,7 @@ print_ps_item() { eval $LOGFS local a_ps_data='' ps_data='' line_starter='' line_start_data='' full_line='' - local app_name='' app_pid='' app_cpu='' app_mem='' throttled='' + local app_name='' app_pid='' app_cpu='' app_mem='' throttled='' app_daemon='' local b_print_first=$2 line_counter=0 i=0 count_nu='' extra_data='' if [[ -n $PS_THROTTLED ]];then @@ -4852,7 +4853,15 @@ print_ps_item() IFS="," a_ps_data=(${A_PS_DATA[i]}) IFS="$ORIGINAL_IFS" - app_name=" ${C1}app:${C2} ${a_ps_data[0]}" + + # handle the converted app names, with ~..~ means it didn't have a path + if [[ -n $( grep -E '^~.*~$' <<< ${a_ps_data[0]} ) ]];then + app_daemon='daemon:' + else + app_daemon='command:' + fi + + app_name=" ${C1}$app_daemon${C2} ${a_ps_data[0]}" if [[ ${a_ps_data[0]} != ${a_ps_data[2]} ]];then app_name="$app_name ${C1}(started by:${C2} ${a_ps_data[2]}${C1})${C2}" fi