mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
cleaned up, only check file once
This commit is contained in:
parent
bb8f7e279c
commit
1fc7e1ad46
18
inxi
18
inxi
|
@ -3196,16 +3196,18 @@ get_graphics_driver()
|
|||
eval $LOGFS
|
||||
|
||||
local driver_list='apm ark ati chips cirrus cyrix fbdev fglrx glint i128 i740 intel i810 imstt mach64 mga neomagic nsc nv nvidia openchrome nouveau radeon radeonhd rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng unichrome vesa vga via voodoo vmware v4l'
|
||||
local driver='' driver_string='' spacer=''
|
||||
local driver='' driver_string='' spacer='' xorg_log_data=''
|
||||
|
||||
if [[ $B_XORG_LOG == 'true' ]];then
|
||||
for driver in $driver_list
|
||||
do
|
||||
if [[ -n $( grep -s "[[:space:]]Loading.*${driver}_drv.so" $FILE_XORG_LOG ) && -z $( grep -s "[[:space:]]Unloading.*${driver}_drv.so" $FILE_XORG_LOG ) ]];then
|
||||
driver_string="$driver_string$driver$spacer"
|
||||
spacer=' '
|
||||
fi
|
||||
done
|
||||
xorg_log_data="$( cat $FILE_XORG_LOG )"
|
||||
for driver in $driver_list
|
||||
do
|
||||
if [[ -n $( grep -s "[[:space:]]Loading.*${driver}_drv.so" <<< "$xorg_log_data" ) && -z $( grep -s "[[:space:]]Unloading.*${driver}_drv.so" <<< "$xorg_log_data" ) ]];then
|
||||
driver_string="$driver_string$driver$spacer"
|
||||
spacer=' '
|
||||
fi
|
||||
done
|
||||
xorg_log_data='' # dump from ram, does it matter?
|
||||
fi
|
||||
|
||||
echo $driver_string
|
||||
|
|
Loading…
Reference in a new issue