From cf75791ea41ce645a4bc3dd9c5365ea5cfacf0b0 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Mon, 25 Jul 2011 22:43:47 +0000 Subject: [PATCH] cleaned up konvi code, function for perl/python detection. --- inxi | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/inxi b/inxi index 7014bfc..b89e1c8 100755 --- a/inxi +++ b/inxi @@ -2504,29 +2504,11 @@ get_start_client() esac done B_CONSOLE_IRC='true' - if [[ -z $IRC_CLIENT_VERSION ]];then - # this is a hack to try to show konversation if inxi is running but started via /cmd - if [[ -n $( ps aux | grep -i 'konversation' | grep -v 'grep' ) && $B_RUNNING_IN_X == 'true' ]];then - IRC_CLIENT='Konversation' - IRC_CLIENT_VERSION=" $( konversation --version 2>/dev/null | gawk '/^Konversation/ {print $2}' )" - B_CONSOLE_IRC='false' - else - IRC_CLIENT="Unknown $app_working_name client" - fi - fi + set_perl_python_konvi ;; python*) # B_CONSOLE_IRC='true' # are there even any python type console irc clients? check. - if [[ -z $IRC_CLIENT_VERSION ]];then - # this is a hack to try to show konversation if inxi is running but started via /cmd - if [[ -n $( ps aux | grep -i 'konversation' | grep -v 'grep' ) && $B_RUNNING_IN_X == 'true' ]];then - IRC_CLIENT='Konversation' - IRC_CLIENT_VERSION=" $( konversation --version 2>/dev/null | gawk '/^Konversation/ {print $2}' )" - B_CONSOLE_IRC='false' - else - IRC_CLIENT="Unknown $app_working_name client" - fi - fi + set_perl_python_konvi ;; # then unset, set unknown data *) @@ -2569,6 +2551,20 @@ get_start_client() eval $LOGFE } +set_perl_python_konvi() +{ + if [[ -z $IRC_CLIENT_VERSION ]];then + # this is a hack to try to show konversation if inxi is running but started via /cmd + if [[ -n $( ps aux | grep -i 'konversation' | grep -v 'grep' ) && $B_RUNNING_IN_X == 'true' ]];then + IRC_CLIENT='Konversation' + IRC_CLIENT_VERSION=" $( konversation --version 2>/dev/null | gawk '/^Konversation/ {print $2}' )" + B_CONSOLE_IRC='false' + else + IRC_CLIENT="Unknown $app_working_name client" + fi + fi +} + ## try to infer the use of Konversation >= 1.2, which shows $PPID improperly ## no known method of finding Kovni >= 1.2 as parent process, so we look to see if it is running, ## and all other irc clients are not running.