Fine tuned gfx output, made sections easier to read

This commit is contained in:
inxi-svn 2008-10-30 06:08:06 +00:00
parent 244307e5e3
commit 68de9b023b

17
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 0.1.46 #### version: 0.1.47
#### Date: October 29 2008 #### Date: October 29 2008
######################################################################## ########################################################################
#### inxi is a fork of infobash, the original bash sys info script by locsmif #### inxi is a fork of infobash, the original bash sys info script by locsmif
@ -43,6 +43,8 @@ DISTRO_FILE=''
A_DISTRO_GLOB='' A_DISTRO_GLOB=''
IRC_CLIENT='' IRC_CLIENT=''
IRC_CLIENT_VERSION='' IRC_CLIENT_VERSION=''
X_VENDOR=''
X_NUMBER=''
## primary data array holders ## primary data array holders
A_CPU_DATA='' A_CPU_DATA=''
@ -897,7 +899,7 @@ get_graphics_data()
fi fi
# X vendor and version detection. # X vendor and version detection.
XVENDOR=$( xdpyinfo | gawk -F': +' ' X_VENDOR=$( xdpyinfo | gawk -F': +' '
BEGIN { IGNORECASE=1 } BEGIN { IGNORECASE=1 }
/vendor string/ { /vendor string/ {
gsub(/the|,|inc|foundation|project|coorperation/, "", $2) gsub(/the|,|inc|foundation|project|coorperation/, "", $2)
@ -908,11 +910,11 @@ get_graphics_data()
# new method added since radeon and X.org and the disappearance of <X server name> version : ...etc # new method added since radeon and X.org and the disappearance of <X server name> version : ...etc
# Later on, the normal textual version string returned, e.g. like: X.Org version: 6.8.2 # Later on, the normal textual version string returned, e.g. like: X.Org version: 6.8.2
# A failover mechanism is in place. (if $XVERNUM is empty, the release number is parsed instead) # A failover mechanism is in place. (if $X_VER_NUM is empty, the release number is parsed instead)
XVERNUM=$( xdpyinfo | awk '/version:/ { print $NF }' ) X_VER_NUM=$( xdpyinfo | awk '/version:/ { print $NF }' )
if [ -z "$XVERNUM" ] if [ -z "$X_VER_NUM" ]
then then
XVERNUM=$(xdpyinfo | gawk -F': +' ' X_VER_NUM=$(xdpyinfo | gawk -F': +' '
BEGIN { IGNORECASE=1 } BEGIN { IGNORECASE=1 }
/vendor release number/ { /vendor release number/ {
gsub(/0+$/,"",$2) gsub(/0+$/,"",$2)
@ -925,7 +927,6 @@ get_graphics_data()
#X -version 2>&1 | gawk '/^X Window System Version/ { print $5 }' #X -version 2>&1 | gawk '/^X Window System Version/ { print $5 }'
#This method could be used in the future to detect X when X is not running, #This method could be used in the future to detect X when X is not running,
#however currently infobash ignores X checks when X is not found. #however currently infobash ignores X checks when X is not found.
XVER="$XVENDOR $XVERNUM"
IFS=$'\n' IFS=$'\n'
GLX=($(glxinfo | gawk -F ': ' ' GLX=($(glxinfo | gawk -F ': ' '
@ -1206,7 +1207,7 @@ print_gfx_data()
gfx_data=$( create_print_line "Graphics:" "${C1}$card_one${C2}${A_GFX_DATA[0]}${gfx_data}" ) gfx_data=$( create_print_line "Graphics:" "${C1}$card_one${C2}${A_GFX_DATA[0]}${gfx_data}" )
if [ "$X" -gt 0 ] if [ "$X" -gt 0 ]
then then
gfx_data="${gfx_data} ${C1}$XVER ${CN}[${C2} ${RES} ${CN}]" gfx_data="${gfx_data}${CN}| ${C1}$X_VENDOR${C2} $X_VER_NUM ${CN}| ${C1}Res${C2} ${RES}"
else else
gfx_data="${gfx_data} ${C1} tty resolution ${CN}(${C2} ${RES} ${CN})" gfx_data="${gfx_data} ${C1} tty resolution ${CN}(${C2} ${RES} ${CN})"
fi fi