cleaned up, refactored irc tty version function

This commit is contained in:
inxi-svn 2011-05-25 23:11:31 +00:00
parent d8e0a8653a
commit 199377f147

14
inxi
View file

@ -2416,7 +2416,14 @@ 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' )
tty_number=$( ps aux | gawk '
BEGIN {
IGNORECASE=1
}
/'${IRC_CLIENT}'/ {
gsub(/[^0-9]/, "", $7)
print $7
}' )
fi
echo $tty_number
eval $LOGFE
@ -2655,7 +2662,7 @@ get_cpu_ht_multicore_smp_data()
# Detect desktop environment in use, logic from: compiz-check
# http://forlong.blogage.de/entries/pages/Compiz-Check
detect_desktop_environment()
get_desktop_environment()
{
eval $LOGFS
@ -3129,6 +3136,7 @@ get_graphics_glx_data()
# if ( $2 ~ / r[3-9][0-9][0-9] / ) {
gsub(/'"$BAN_LIST_NORMAL"'/, "", $2)
gsub(/ [ \t]+/, " ", $2) # get rid of the created white spaces
gsub(/^ +| +$/, "", $0)
a[$2]
# this counter failed in one case, a bug, and is not needed now
# f++
@ -6352,7 +6360,7 @@ print_system_data()
# I think these will work, maybe, if logged in as root and in X
if [[ $B_RUNNING_IN_X == 'true' ]];then
desktop_environment=$( detect_desktop_environment )
desktop_environment=$( get_desktop_environment )
if [[ -z $desktop_environment ]];then
desktop_environment='N/A'
fi