mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 08:57:57 +00:00
one I think final patch to correct tty res for ancient systems.
This commit is contained in:
parent
1afeb3fc1e
commit
d6aeb2b9ac
18
inxi
18
inxi
|
@ -6502,13 +6502,14 @@ get_graphics_glx_data()
|
||||||
}
|
}
|
||||||
|
|
||||||
## return screen resolution / tty resolution
|
## return screen resolution / tty resolution
|
||||||
|
## args: $1 - reg/tty
|
||||||
get_graphics_res_data()
|
get_graphics_res_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local screen_resolution='' xdpy_data='' screens_count=0 tty_session=''
|
local screen_resolution='' xdpy_data='' screens_count=0 tty_session='' option=$1
|
||||||
|
|
||||||
# if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then
|
# if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then
|
||||||
if [[ $B_SHOW_DISPLAY_DATA == 'true' ]];then
|
if [[ $B_SHOW_DISPLAY_DATA == 'true' && $option != 'tty' ]];then
|
||||||
# Added the two ?'s , because the resolution is now reported without spaces around the 'x', as in
|
# Added the two ?'s , because the resolution is now reported without spaces around the 'x', as in
|
||||||
# 1400x1050 instead of 1400 x 1050. Change as of X.org version 1.3.0
|
# 1400x1050 instead of 1400 x 1050. Change as of X.org version 1.3.0
|
||||||
xdpy_data="$( xdpyinfo $DISPLAY_OPT 2>/dev/null )"
|
xdpy_data="$( xdpyinfo $DISPLAY_OPT 2>/dev/null )"
|
||||||
|
@ -12824,9 +12825,9 @@ print_graphics_data()
|
||||||
local res_tty='Resolution' xorg_data='' display_server_string='' chip_id=''
|
local res_tty='Resolution' xorg_data='' display_server_string='' chip_id=''
|
||||||
local spacer='' driver='' driver_string='' driver_plural='' direct_render_string=''
|
local spacer='' driver='' driver_string='' driver_plural='' direct_render_string=''
|
||||||
local separator_loaded='' separator_unloaded='' separator_failed=''
|
local separator_loaded='' separator_unloaded='' separator_failed=''
|
||||||
local loaded='' unloaded='' failed='' display_server_string=''
|
local loaded='' unloaded='' failed='' display_server_string='' b_force_tty='false'
|
||||||
local line_starter='Graphics:' part_1_data='' part_2_data='' b_advanced='true'
|
local line_starter='Graphics:' part_1_data='' part_2_data='' b_advanced='true'
|
||||||
local screen_resolution="$( get_graphics_res_data )"
|
local screen_resolution="$( get_graphics_res_data 'reg' )"
|
||||||
|
|
||||||
# set A_DISPLAY_SERVER_DATA
|
# set A_DISPLAY_SERVER_DATA
|
||||||
get_graphics_display_server_data
|
get_graphics_display_server_data
|
||||||
|
@ -12905,7 +12906,12 @@ print_graphics_data()
|
||||||
fi
|
fi
|
||||||
# some basic error handling:
|
# some basic error handling:
|
||||||
if [[ -z $screen_resolution ]];then
|
if [[ -z $screen_resolution ]];then
|
||||||
screen_resolution='N/A'
|
screen_resolution="$( get_graphics_res_data 'tty' )"
|
||||||
|
if [[ -z $screen_resolution ]];then
|
||||||
|
screen_resolution='N/A'
|
||||||
|
else
|
||||||
|
b_force_tty='true'
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
# note: fix this, we may find a display server that has no version
|
# note: fix this, we may find a display server that has no version
|
||||||
if [[ -z $display_vendor || -z $display_version ]];then
|
if [[ -z $display_vendor || -z $display_version ]];then
|
||||||
|
@ -12936,7 +12942,7 @@ print_graphics_data()
|
||||||
res_tty='tty size'
|
res_tty='tty size'
|
||||||
fi
|
fi
|
||||||
# || -n ${screen_resolution/*@*/}
|
# || -n ${screen_resolution/*@*/}
|
||||||
if [[ $B_SHOW_DISPLAY_DATA != 'true' || $B_RUNNING_IN_DISPLAY != 'true' ]];then
|
if [[ $b_force_tty == 'true' || $B_SHOW_DISPLAY_DATA != 'true' || $B_RUNNING_IN_DISPLAY != 'true' ]];then
|
||||||
res_tty='tty size'
|
res_tty='tty size'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue