From d8e0a8653a0beeb4abebe6a8596551836d68dc03 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Wed, 25 May 2011 22:56:02 +0000 Subject: [PATCH] trying to get tty of console irc client --- inxi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/inxi b/inxi index de3de16..e18bb6d 100755 --- a/inxi +++ b/inxi @@ -2411,6 +2411,17 @@ get_audio_alsa_data() eval $LOGFE } +get_console_irc_tty() +{ + eval $LOGFS + local tty_number='' + if [[ -n ${IRC_CLIENT} ]];then + tty_number=$( ps aux | grep -is "${IRC_CLIENT}" | grep -v 'grep' | gawk '{print $7}' | sed 's/[^0-9]//g' ) + fi + echo $tty_number + eval $LOGFE +} + ## create A_CPU_CORE_DATA, currently with two values: integer core count; core string text ## return value cpu core count string, this helps resolve the multi redundant lines of old style output get_cpu_core_count() @@ -6346,6 +6357,9 @@ print_system_data() desktop_environment='N/A' fi else + if [[ -z $tty_session && $B_CONSOLE_IRC == 'true' ]];then + tty_session=$( get_console_irc_tty ) + fi if [[ -n $tty_session ]];then tty_session=" $tty_session" fi