mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
cleaned up, refactored irc tty version function
This commit is contained in:
parent
d8e0a8653a
commit
199377f147
14
inxi
14
inxi
|
@ -2416,7 +2416,14 @@ get_console_irc_tty()
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local tty_number=''
|
local tty_number=''
|
||||||
if [[ -n ${IRC_CLIENT} ]];then
|
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
|
fi
|
||||||
echo $tty_number
|
echo $tty_number
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
|
@ -2655,7 +2662,7 @@ get_cpu_ht_multicore_smp_data()
|
||||||
|
|
||||||
# Detect desktop environment in use, logic from: compiz-check
|
# Detect desktop environment in use, logic from: compiz-check
|
||||||
# http://forlong.blogage.de/entries/pages/Compiz-Check
|
# http://forlong.blogage.de/entries/pages/Compiz-Check
|
||||||
detect_desktop_environment()
|
get_desktop_environment()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
|
|
||||||
|
@ -3129,6 +3136,7 @@ get_graphics_glx_data()
|
||||||
# if ( $2 ~ / r[3-9][0-9][0-9] / ) {
|
# if ( $2 ~ / r[3-9][0-9][0-9] / ) {
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", $2)
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", $2)
|
||||||
gsub(/ [ \t]+/, " ", $2) # get rid of the created white spaces
|
gsub(/ [ \t]+/, " ", $2) # get rid of the created white spaces
|
||||||
|
gsub(/^ +| +$/, "", $0)
|
||||||
a[$2]
|
a[$2]
|
||||||
# this counter failed in one case, a bug, and is not needed now
|
# this counter failed in one case, a bug, and is not needed now
|
||||||
# f++
|
# f++
|
||||||
|
@ -6352,7 +6360,7 @@ print_system_data()
|
||||||
|
|
||||||
# I think these will work, maybe, if logged in as root and in X
|
# I think these will work, maybe, if logged in as root and in X
|
||||||
if [[ $B_RUNNING_IN_X == 'true' ]];then
|
if [[ $B_RUNNING_IN_X == 'true' ]];then
|
||||||
desktop_environment=$( detect_desktop_environment )
|
desktop_environment=$( get_desktop_environment )
|
||||||
if [[ -z $desktop_environment ]];then
|
if [[ -z $desktop_environment ]];then
|
||||||
desktop_environment='N/A'
|
desktop_environment='N/A'
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue