summaryrefslogtreecommitdiffstats
path: root/inxi
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2017-07-08 00:20:43 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2017-07-08 00:20:43 -0400
commit4899534a5cd63704242f4703ef6f8b12f9a2b7e2 (patch)
tree73005575d3f73bd970da786b861de314fbfe9fa4 /inxi
parent052cce0c187b13923516adbdcaa7168d858fce20 (diff)
downloadinxi-4899534a5cd63704242f4703ef6f8b12f9a2b7e2.tar.bz2
inxi-4899534a5cd63704242f4703ef6f8b12f9a2b7e2.tar.xz
inxi-4899534a5cd63704242f4703ef6f8b12f9a2b7e2.tar.zst
New upstream version 2.3.23upstream/2.3.23
Diffstat (limited to 'inxi')
-rwxr-xr-xinxi546
1 files changed, 401 insertions, 145 deletions
diff --git a/inxi b/inxi
index 2b658e5..12c3636 100755
--- a/inxi
+++ b/inxi
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
########################################################################
#### Script Name: inxi
-#### Version: 2.3.11
-#### Date: 2017-05-31
+#### Version: 2.3.23
+#### Date: 2017-06-29
#### Patch Number: 00
########################################################################
#### SPECIAL THANKS
@@ -417,6 +417,7 @@ DCOPOBJ="default"
DEBUG=0 # Set debug levels from 1-10 (8-10 trigger logging levels)
# Debug Buffer Index, index into a debug buffer storing debug messages until inxi is 'all up'
DEBUG_BUFFER_INDEX=0
+DISPLAY_OPT='' # for console switches
## note: the debugger rerouting to /dev/null has been moved to the end of the get_parameters function
## so -@[number] debug levels can be set if there is a failure, otherwise you can't even see the errors
SED_I='-i' # for gnu sed, will be set to -i '' for bsd sed
@@ -425,7 +426,9 @@ SED_RX='-r' # for gnu sed, will be set to -E for bsd sed for backward compatibil
# default to false, no konversation found, 1 is native konvi (qt3/KDE3) script mode, 2 is /cmd inxi start,
## 3 is Konversation > 1.2 (qt4/KDE4)
KONVI=0
-# NO_CPU_COUNT=0 # Wether or not the string "dual" or similar is found in cpuinfo output. If so, avoid dups.
+NO_SSL=''
+NO_SSL_OPT=''
+# NO_CPU_COUNT=0 # Whether or not the string "dual" or similar is found in cpuinfo output. If so, avoid dups.
# This is a variable that controls how many parameters inxi will parse in a /proc/<pid>/cmdline file before stopping.
PARAMETER_LIMIT=30
SCHEME=0 # set default scheme - do not change this, it's set dynamically
@@ -639,7 +642,7 @@ MAGENTA,DBLUE,NORMAL
## DISTRO DATA/ID ##
# In cases of derived distros where the version file of the base distro can also be found under /etc,
# the derived distro's version file should go first. (Such as with Sabayon / Gentoo)
-DISTROS_DERIVED="antix-version aptosid-version kanotix-version knoppix-version mandrake-release pardus-release porteus-version sabayon-release siduction-version sidux-version slitaz-release solusos-release turbolinux-release zenwalk-version"
+DISTROS_DERIVED="antix-version aptosid-version kanotix-version knoppix-version mandrake-release mx-version pardus-release porteus-version sabayon-release siduction-version sidux-version slitaz-release solusos-release turbolinux-release zenwalk-version"
# debian_version excluded from DISTROS_PRIMARY so Debian can fall through to /etc/issue detection. Same goes for Ubuntu.
DISTROS_EXCLUDE_LIST="debian_version devuan_version ubuntu_version"
DISTROS_PRIMARY="arch-release gentoo-release redhat-release slackware-version SuSE-release"
@@ -919,19 +922,22 @@ initialize_data()
if type -p dig &>/dev/null;then
DNSTOOL='dig'
fi
-
# set downloaders.
if ! type -p wget &>/dev/null;then
# first check for bsd stuff
if type -p fetch &>/dev/null;then
DOWNLOADER='fetch'
+ NO_SSL=' --no-verify-peer'
elif type -p curl &>/dev/null;then
DOWNLOADER='curl'
+ NO_SSL=' --insecure'
elif [[ $BSD_VERSION == 'openbsd' && -n $( type -p ftp ) ]];then
DOWNLOADER='ftp'
else
DOWNLOADER='no-downloader'
fi
+ else
+ NO_SSL=' --no-check-certificate'
fi
if [[ -n $BSD_TYPE ]];then
@@ -1494,10 +1500,10 @@ script_debugger()
{
eval $LOGFS
if [[ $B_SCRIPT_UP == 'true' ]];then
- # only return if debugger is off and no pre start up errors have occured
+ # only return if debugger is off and no pre start up errors have occurred
if [[ $DEBUG -eq 0 && $DEBUG_BUFFER_INDEX -eq 0 ]];then
return 0
- # print out the stored debugging information if errors occured
+ # print out the stored debugging information if errors occurred
elif [[ $DEBUG_BUFFER_INDEX -gt 0 ]];then
for (( DEBUG_BUFFER_INDEX=0; DEBUG_BUFFER_INDEX < ${#A_DEBUG_BUFFER[@]}; DEBUG_BUFFER_INDEX++ ))
do
@@ -1617,16 +1623,16 @@ script_self_updater()
print_screen_output "Updating $SCRIPT_NAME in $SCRIPT_PATH using $2 as download source..."
case $DOWNLOADER in
curl)
- file_contents="$( curl -s $1$SCRIPT_NAME )" || downloader_error=$?
+ file_contents="$( curl $NO_SSL_OPT -s $1$SCRIPT_NAME )" || downloader_error=$?
;;
fetch)
- file_contents="$( fetch -q -o - $1$SCRIPT_NAME )" || downloader_error=$?
+ file_contents="$( fetch $NO_SSL_OPT -q -o - $1$SCRIPT_NAME )" || downloader_error=$?
;;
ftp)
- file_contents="$( ftp -o - $1$SCRIPT_NAME 2>/dev/null )" || downloader_error=$?
+ file_contents="$( ftp $NO_SSL_OPT -o - $1$SCRIPT_NAME 2>/dev/null )" || downloader_error=$?
;;
wget)
- file_contents="$( wget -q -O - $1$SCRIPT_NAME )" || downloader_error=$?
+ file_contents="$( wget $NO_SSL_OPT -q -O - $1$SCRIPT_NAME )" || downloader_error=$?
;;
no-downloader)
downloader_error=1
@@ -1659,7 +1665,7 @@ script_self_updater()
fi
fi
if [[ $DOWNLOADER == 'wget' ]];then
- wget -q --spider $MAN_FILE_DOWNLOAD || downloader_man_error=$?
+ wget $NO_SSL_OPT -q --spider $MAN_FILE_DOWNLOAD || downloader_man_error=$?
fi
if [[ $downloader_man_error -eq 0 ]];then
if [[ $DOWNLOADER == 'wget' ]];then
@@ -1668,16 +1674,16 @@ script_self_updater()
print_screen_output "Downloading Man page file now."
case $DOWNLOADER in
curl)
- curl -s -o $man_file_path $MAN_FILE_DOWNLOAD || downloader_man_error=$?
+ curl $NO_SSL_OPT -s -o $man_file_path $MAN_FILE_DOWNLOAD || downloader_man_error=$?
;;
fetch)
- fetch -q -o $man_file_path $MAN_FILE_DOWNLOAD || downloader_man_error=$?
+ fetch $NO_SSL_OPT -q -o $man_file_path $MAN_FILE_DOWNLOAD || downloader_man_error=$?
;;
ftp)
- ftp -o $man_file_path $MAN_FILE_DOWNLOAD 2>/dev/null || downloader_man_error=$?
+ ftp $NO_SSL_OPT -o $man_file_path $MAN_FILE_DOWNLOAD 2>/dev/null || downloader_man_error=$?
;;
wget)
- wget -q -O $man_file_path $MAN_FILE_DOWNLOAD || downloader_man_error=$?
+ wget $NO_SSL_OPT -q -O $man_file_path $MAN_FILE_DOWNLOAD || downloader_man_error=$?
;;
no-downloader)
downloader_man_error=1
@@ -1972,19 +1978,19 @@ debug_data_collector()
if [[ -f xiin && ! -f $xiin_file ]];then
mv -f xiin $xiin_file
fi
- # -Nc is creating really weird download anomolies, so using -O instead
+ # -Nc is creating really weird download anomalies, so using -O instead
case $DOWNLOADER in
curl)
- xiin_download="$( curl -s $xiin_url )" || downloader_error=$?
+ xiin_download="$( curl $NO_SSL_OPT -s $xiin_url )" || downloader_error=$?
;;
fetch)
- xiin_download="$( fetch -q -o - $xiin_url )" || downloader_error=$?
+ xiin_download="$( fetch $NO_SSL_OPT -q -o - $xiin_url )" || downloader_error=$?
;;
ftp)
- xiin_download="$( ftp -o - $xiin_url 2>/dev/null )" || downloader_error=$?
+ xiin_download="$( ftp $NO_SSL_OPT -o - $xiin_url 2>/dev/null )" || downloader_error=$?
;;
wget)
- xiin_download="$( wget -q -O - $xiin_url )" || downloader_error=$?
+ xiin_download="$( wget $NO_SSL_OPT -q -O - $xiin_url )" || downloader_error=$?
;;
no-downloader)
downloader_error=1
@@ -2076,8 +2082,9 @@ debug_data_collector()
else
touch $debug_data_dir/xprop-absent
fi
- if type -p xprop &>/dev/null; then
- glxinfo &> $debug_data_dir/glxinfo.txt
+ if type -p glxinfo &>/dev/null; then
+ glxinfo &> $debug_data_dir/glxinfo-full.txt
+ glxinfo -B &> $debug_data_dir/glxinfo-B.txt
else
touch $debug_data_dir/glxinfo-absent
fi
@@ -2144,7 +2151,18 @@ debug_data_collector()
echo $XDG_SESSION_DESKTOP &> $debug_data_dir/xdg-session-desktop.txt
echo $DESKTOP_SESSION &> $debug_data_dir/desktop-session.txt
echo $GDMSESSION &> $debug_data_dir/gdmsession.txt
-
+ # wayland data collectors:
+ echo $XDG_SESSION_TYPE &> $debug_data_dir/xdg-session-type.txt
+ echo $WAYLAND_DISPLAY &> $debug_data_dir/wayland-display.txt
+ echo $GDK_BACKEND &> $debug_data_dir/gdk-backend.txt
+ echo $QT_QPA_PLATFORM &> $debug_data_dir/qt-qpa-platform.txt
+ echo $CLUTTER_BACKEND &> $debug_data_dir/clutter-backend.txt
+ echo $SDL_VIDEODRIVER &> $debug_data_dir/sdl-videodriver.txt
+ if type -p loginctl &>/dev/null;then
+ loginctl --no-pager list-sessions &> $debug_data_dir/loginctl-list-sessions.txt
+ else
+ touch $debug_data_dir/loginctl-absent
+ fi
fi
if [[ $1 == 'disk' || $1 == 'all' ]];then
echo 'Collecting dev, label, disk, uuid data, df...'
@@ -3007,6 +3025,18 @@ get_parameters()
33)
B_FORCE_DMIDECODE='true'
;;
+ 34)
+ NO_SSL_OPT=$NO_SSL
+ ;;
+ 40*)
+ DISPLAY=${OPTARG/40/}
+ if [[ $DISPLAY == '' ]];then
+ DISPLAY=':0'
+ fi
+ DISPLAY_OPT="-display $DISPLAY"
+ B_SHOW_DISPLAY_DATA='true'
+ B_RUNNING_IN_DISPLAY='true'
+ ;;
ftp*)
ALTERNATE_FTP="$OPTARG"
;;
@@ -3085,11 +3115,11 @@ show_options()
print_lines_basic "2" "98" "Console IRC not in X"
print_lines_basic "2" "99" "Global - Overrides/removes all settings. Setting specific removes global."
print_lines_basic "1" "-C" "CPU output, including per CPU clockspeed and max CPU speed (if available)."
- print_lines_basic "1" "-d" "Optical drive data. Same as -Dd. See also -x and -xx."
+ print_lines_basic "1" "-d" "Optical drive data (and floppy disks, if present). Same as -Dd. See also -x and -xx."
print_lines_basic "1" "-D" "Full hard Disk info, not only model, ie: /dev/sda ST380817AS 80.0GB. See also -x and -xx. Disk total used percentage includes swap partition size(s)."
print_lines_basic "1" "-f" "All cpu flags, triggers -C. Not shown with -F to avoid spamming. ARM cpus show 'features'."
print_lines_basic "1" "-F" "Full output for $SCRIPT_NAME. Includes all Upper Case line letters, plus -s and -n. Does not show extra verbose options like -d -f -l -m -o -p -r -t -u -x"
- print_lines_basic "1" "-G" "Graphic card information (card, display server type/version, resolution, glx renderer, version)."
+ print_lines_basic "1" "-G" "Graphic card information (card, display server type/version, resolution, renderer, OpenGL version)."
print_lines_basic "1" "-i" "Wan IP address, and shows local interfaces (requires ifconfig
network tool). Same as -Nni. Not shown with -F for user security reasons, you shouldn't paste your local/wan IP."
print_lines_basic "1" "-I" "Information: processes, uptime, memory, irc client (or shell type), $SCRIPT_NAME version."
@@ -3101,7 +3131,7 @@ show_options()
print_lines_basic "1" "-o" "Unmounted $partition_string information (includes UUID and LABEL if available). Shows file system type if you have file installed, if you are root OR if you have added to /etc/sudoers (sudo v. 1.7 or newer) Example:^<username>^ALL^=^NOPASSWD:^/usr/bin/file^"
print_lines_basic "1" "-p" "Full $partition_string information (-P plus all other detected ${partition_string}s)."
print_lines_basic "1" "-P" "Basic $partition_string information (shows what -v^4 would show, but without extra data). Shows, if detected: / /boot /home /opt /tmp /usr /var /var/log /var/tmp . Use -p to see all mounted ${partition_string}s."
- print_lines_basic "1" "-r" "Distro repository data. Supported repo types: APT; PACMAN; PISI; PORTAGE; PORTS (BSDs); SLACKPKG; URPMQ; YUM; ZYPP."
+ print_lines_basic "1" "-r" "Distro repository data. Supported repo types: APK; APT; PACMAN; PISI; PORTAGE; PORTS (BSDs); SLACKPKG; URPMQ; YUM; ZYPP."
print_lines_basic "1" "-R" "RAID data. Shows RAID devices, states, levels, and components, and extra data with -x/-xx. md-raid: If device is resyncing, shows resync progress line as well."
print_lines_basic "1" "-s" "Sensors output (if sensors installed/configured): mobo/cpu/gpu temp; detected fan speeds. Gpu temp only for Fglrx/Nvidia drivers. Nvidia shows screen number for > 1 screens."
print_lines_basic "1" "-S" "System information: host name, kernel, desktop environment (if in X), distro"
@@ -3137,7 +3167,7 @@ show_options()
print_lines_basic "2" "-N -A" "Version/port(s)/driver version (if available) for Network/Audio;"
print_lines_basic "2" "-N -A -G" "Network, audio, graphics, shows PCI Bus ID/Usb ID number of card."
print_lines_basic "2" "-R" "md-raid: Shows component raid id. Adds second RAID Info line: raid level; report on drives (like 5/5); blocks; chunk size; bitmap (if present). Resync line, shows blocks synced/total blocks. zfs-raid: Shows raid array full size; available size; portion allocated to RAID"
- print_lines_basic "2" "-S" "Desktop toolkit if avaliable (GNOME/XFCE/KDE only); Kernel gcc version"
+ print_lines_basic "2" "-S" "Desktop toolkit if available (GNOME/XFCE/KDE only); Kernel gcc version"
print_lines_basic "2" "-t" "Memory use output to cpu (-xt c), and cpu use to memory (-xt m)."
if [[ $B_ALLOW_WEATHER == 'true' ]];then
print_lines_basic "2" "-w -W" "Wind speed and time zone (-w only)."
@@ -3147,7 +3177,7 @@ show_options()
print_lines_basic "2" "-B" "serial number, voltage (if available)."
print_lines_basic "2" "-C" "Minimum CPU speed, if available."
print_lines_basic "2" "-D" "Disk serial number."
- print_lines_basic "2" "-G" "Chip vendor:product ID for each video card."
+ print_lines_basic "2" "-G" "Chip vendor:product ID for each video card; (mir/wayland only) compositor (alpha test); OpenGL compatibility version, if free drivers and available."
print_lines_basic "2" "-I" "Other detected installed gcc versions (if present). System default runlevel. Adds parent program (or tty) for shell info if not in IRC (like Konsole or Gterm). Adds Init/RC (if found) version number."
print_lines_basic "2" "-m" "Manufacturer, Serial Number, single/double bank (if found)."
print_lines_basic "2" "-M" "Chassis information, bios rom size (dmidecode only), if data for either is available."
@@ -3196,6 +3226,8 @@ show_options()
print_lines_basic "1" "-! 31" "Turns off hostname in output. Useful if showing output from servers etc."
print_lines_basic "1" "-! 32" "Turns on hostname in output. Overrides global B_SHOW_HOST='false'"
print_lines_basic "1" "-! 33" "Forces use of dmidecode data instead of /sys where relevant (-M)."
+ print_lines_basic "1" "-! 34" "Skips SSL certificate checks for all downloader activies (wget/fetch/curl only). Must go before other options."
+ print_lines_basic "1" "-! 40" "Will try to get display data out of X. Default gets it from display :0. If you use this format: -! 40:1 it would get it from display 1 instead, or any display you specify as long as there is no space between -! 40 and the :[display-number]."
if [[ $1 == 'full' ]];then
print_screen_output " "
@@ -4453,6 +4485,7 @@ get_cpu_data()
nr = 0
count = 0
bArm = "false"
+ bProcInt = "false" # this will avoid certain double counts with processor/Processor lines
# ARM cpus are erratic in /proc/cpuinfo this hack can sometimes resolve it. Linux only.
sysSpeed="'$(get_cpu_speed_hack)'"
speed = 0
@@ -4467,13 +4500,24 @@ get_cpu_data()
gsub(/^ +| +$/, "", $NF)
if ( $NF ~ "^[0-9]+$" ) {
nr = $NF
+ bProcInt = "true"
}
else {
- if ( $NF ~ "^ARM" ) {
+ # this protects against double processor lines, one int, one string
+ if ( bProcInt == "false" ){
+ count += 1
+ nr = count - 1
+ }
+ # note: alternate:
+ # Processor : AArch64 Processor rev 4 (aarch64)
+ # but no model name type
+ if ( $NF ~ "(ARM|AArch)" ) {
bArm = "true"
}
- count += 1
- nr = count - 1
+ gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
+ gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
+ gsub(/^ +| +$/, "", $NF)
+ gsub(/ [ \t]+/, " ", $NF)
cpu[nr, "model"] = $NF
}
}
@@ -4484,7 +4528,7 @@ get_cpu_data()
gsub(/^ +| +$/, "", $NF)
gsub(/ [ \t]+/, " ", $NF)
cpu[nr, "model"] = $NF
- if ( $NF ~ "^ARM" ) {
+ if ( $NF ~ "^(ARM|AArch)" ) {
bArm = "true"
}
}
@@ -4516,6 +4560,7 @@ get_cpu_data()
}
/^bogomips/ {
cpu[nr, "bogomips"] = $NF
+ # print nr " " cpu[nr, "bogomips"] > "/dev/tty"
}
/vendor_id/ {
gsub(/genuine|authentic/,"",$NF)
@@ -4534,6 +4579,7 @@ get_cpu_data()
}
else if ( cpu[i, "bogomips"] != "" && cpu[i, "speed"] == "" ) {
cpu[i, "speed"] = cpu[i, "bogomips"]
+
}
print cpu[i, "model"] "," cpu[i, "speed"] "," cpu[i, "cache"] "," cpu[i, "flags"] "," cpu[i, "bogomips"] "," cpu[nr, "vendor"] "," bArm
}
@@ -4795,6 +4841,7 @@ get_cpu_ht_multicore_smp_data()
arm_count = 0
nr = 0
bArm = "false"
+ bProcInt = "false" # this will avoid certain double counts with processor/Processor lines
bXeon = "false"
}
# hack to handle xeons which can have buggy /proc/cpuinfo files
@@ -4809,23 +4856,32 @@ get_cpu_ht_multicore_smp_data()
}
}
# array of logical processors, both HT and physical
+ # IMPORTANT: some variants have two lines, one the actual cpu id number,
+ # the other a misnamed model name line.
+ # processor : 0
+ # Processor : AArch64 Processor rev 4 (aarch64)
/^processor/ {
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF)
gsub(/^ +| +$/, "", $NF)
if ( $NF ~ "^[0-9]+$" ) {
a_processor_id[proc_iter] = $NF
proc_iter++
+ bProcInt = "true"
}
else {
# note, for dual core, this can be off by one because the first
# line says: Processor : Arm.. but subsequent say: processor : 0 and so on as usual
- if ( $NF ~ "^ARM" ) {
+ # Processor : AArch64 Processor rev 4 (aarch64)
+ if ( $NF ~ "^(ARM|AArch)" ) {
bArm = "true"
}
- arm_count += 1
- nr = arm_count - 1
- # note: do not iterate because new ARM syntax puts cpu in processsor : 0 syntax
- a_processor_id[proc_iter] = nr
+ # this protects against double processor lines, one int, one string
+ if ( bProcInt == "false" ){
+ arm_count += 1
+ nr = arm_count - 1
+ # note: do not iterate because new ARM syntax puts cpu in processsor : 0 syntax
+ a_processor_id[proc_iter] = nr
+ }
}
}
# array of physical cpu ids, note, this will be unset for vm cpus in many cases
@@ -5051,7 +5107,7 @@ get_desktop_environment()
# did we find it? If not, start the xprop tests
if [[ -z $desktop_environment ]];then
if type -p xprop &>/dev/null;then
- xprop_root="$( xprop -root 2>/dev/null )"
+ xprop_root="$( xprop -root $DISPLAY_OPT 2>/dev/null )"
fi
# note that cinnamon split from gnome, and and can now be id'ed via xprop,
# but it will still trigger the next gnome true case, so this needs to go before gnome test
@@ -5225,7 +5281,8 @@ get_desktop_environment()
fi
fi
# a few manual hacks for things that don't id with xprop, these are just good guesses
- # note that gawk is going to exit after first occurance of search string, so no need for extra
+ # note that gawk is going to exit after first occurrence of search string, so no need for extra
+ # http://www.xwinman.org/ for more possible wm
if [[ -z $desktop_environment ]];then
if [[ -n $( grep -is 'fvwm-crystal' <<< "$Ps_aux_Data" ) ]];then
version=$( get_program_version 'fvwm' '^fvwm' '2' )
@@ -5260,6 +5317,12 @@ get_desktop_environment()
elif [[ -n $( grep -Eis '([[:space:]]|/)jwm' <<< "$Ps_aux_Data" ) ]];then
version=$( get_program_version 'jwm' '^jwm' '2' )
desktop_environment='JWM'
+ elif [[ -n $( grep -is 'sawfish' <<< "$Ps_aux_Data" ) ]];then
+ version=$( get_program_version 'sawfish' '^sawfish' '3' )
+ desktop_environment='Sawfish'
+ elif [[ -n $( grep -is 'afterstep' <<< "$Ps_aux_Data" ) ]];then
+ version=$( get_program_version 'afterstep' '^afterstep' '3' )
+ desktop_environment='AfterStep'
fi
fi
fi
@@ -5280,7 +5343,8 @@ get_program_version()
# mate-about -v = MATE Desktop Environment 1.4.0
case $1 in
- dwm|jwm|mate-about|wmii|wmii2)
+ # legacy fluxbox had no --version, and current -v works
+ dwm|fluxbox|jwm|mate-about|wmii|wmii2)
get_version='-v'
;;
epoch)
@@ -5729,7 +5793,7 @@ get_distro_data()
if [[ $distro_file == 'SuSE-release' ]];then
# leaving off extra data since all new suse have it, in os-release, this file has line breaks, like os-release
# but in case we want it, it's: CODENAME = Mantis | VERSION = 12.2
- # for now, just take first occurance, which should be the first line, which does not use a variable type format
+ # for now, just take first occurrence, which should be the first line, which does not use a variable type format
distro=$( grep -i -m 1 'suse' /etc/$distro_file )
else
distro=$( remove_erroneous_chars "/etc/$distro_file" )
@@ -5919,7 +5983,7 @@ get_distro_lsb_os_release_data()
}
# note: adding the spacing directly to variable to make sure distro output is null if not found
/^PRETTY_NAME/ {
- if ( $2 != "n/a" ) {
+ if ( $2 != "n/a" ) {
prettyName = $2
}
}
@@ -5937,7 +6001,8 @@ get_distro_lsb_os_release_data()
}
}
END {
- if ( prettyName != "" ) {
+ # NOTE: tumbleweed has pretty name but pretty name does not have version id
+ if ( prettyName != "" && regularName !~ /tumbleweed/ ) {
distroName = prettyName
}
else if ( regularName != "" ) {
@@ -6358,13 +6423,12 @@ get_graphics_glx_data()
{
eval $LOGFS
local a_temp=''
- if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then
- IFS=$'\n'
- A_GLX_DATA=( $( glxinfo | gawk -F ': ' '
- # note: function declarations go before BEGIN? It appears so, confirm.
- # the real question here though is why this function is even here, seems
- # just to be a complicated way to pack/print a variable, but maybe the
- # original idea was to handle > 1 cases of detections I guess
+ # if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then
+ if [[ $B_SHOW_DISPLAY_DATA == 'true' ]];then
+ IFS='^'
+ # NOTE: glxinfo -B is not always available, unforunately
+ A_GLX_DATA=( $( eval glxinfo $DISPLAY_OPT 2>/dev/null | gawk -F ': ' '
+ # handle > 1 cases of detections
function join( arr, sep ) {
s=""
i=flag=0
@@ -6379,6 +6443,12 @@ get_graphics_glx_data()
BEGIN {
IGNORECASE=1
+ compatVersion=""
+ # create empty arrays
+ split("", a)
+ split("", b)
+ split("", c)
+ split("", d)
}
/opengl renderer/ {
gsub(/'"$BAN_LIST_NORMAL"'/, "", $2)
@@ -6401,16 +6471,37 @@ get_graphics_glx_data()
# /opengl version/ && ( f || $2 !~ /mesa/ ) {
/opengl version/ {
# fglrx started appearing with this extra string, does not appear to communicate anything of value
- sub(/Compatibility Profile Context/, "- CPC", $2 )
+ sub(/(Compatibility Profile Context|\(Compatibility Profile\))/, "", $2 )
gsub(/ [ \t]+/, " ", $2) # get rid of the created white spaces
gsub(/^ +| +$/, "", $2)
$2 && b[$2]
+ # note: this is going to be off if ever multi opengl versions appear, never seen one
+ compatVersion=gensub(/^([^ \t]+)[ \t].*/,"\\1","g",$2)
+ }
+ /opengl core profile version/ {
+ gsub(/'"$BAN_LIST_NORMAL"'/, "", $2)
+ # fglrx started appearing with this extra string, does not appear to communicate anything of value
+ sub(/(Core Profile Context|\(Core Profile\))/, "", $2 )
+ gsub(/ [ \t]+/, " ", $2) # get rid of the created white spaces
+ gsub(/^ +| +$/, "", $2)
+ $2 && d[$2]
}
/direct rendering/ {
$2 && c[$2]
}
+ # if -B was always available, we could skip this, but it is not
+ /GLX Visuals/ {
+ exit
+ }
END {
- printf( "%s\n%s\n%s\n", join( a, ", " ), join( b, ", " ), join( c, ", " ) )
+ dr = join( c, ", " )
+ oglr = join( a, ", " )
+ oglv = join( b, ", " )
+ oglcpv = join( d, ", " )
+ # output processing done in print functions, important! do not use \n IFS
+ # because Bash treats an empty value surrounded by \n\n as nothing, not an empty array key!
+ # this came up re oglcpv being empty and compatVersion being used instead
+ printf( "%s^%s^%s^%s^%s", oglr, oglv, dr, oglcpv, compatVersion )
}' ) )
IFS="$ORIGINAL_IFS"
@@ -6423,20 +6514,22 @@ get_graphics_glx_data()
}
## return screen resolution / tty resolution
+## args: $1 - reg/tty
get_graphics_res_data()
{
eval $LOGFS
- local screen_resolution='' xdpy_data='' screens_count=0 tty_session=''
-
- if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then
+ 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' && $option != 'tty' ]];then
# 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
- xdpy_data="$( xdpyinfo )"
+ xdpy_data="$( xdpyinfo $DISPLAY_OPT 2>/dev/null )"
xdpy_count=$( grep -c 'dimensions' <<< "$xdpy_data" )
# we get a bit more info from xrandr than xdpyinfo, but xrandr fails to handle
# multiple screens from different video cards
if [[ $xdpy_count -eq 1 ]];then
- screen_resolution=$( xrandr | gawk '
+ screen_resolution=$( xrandr $DISPLAY_OPT 2>/dev/null | gawk '
/\*/ {
res[++m] = gensub(/^.* ([0-9]+) ?x ?([0-9]+)[_ ].* ([0-9\.]+)\*.*$/,"\\1x\\2@\\3hz","g",$0)
}
@@ -6472,6 +6565,16 @@ get_graphics_res_data()
screen_resolution=$( stty -F $( readlink /proc/$PPID/fd/0 ) size | gawk '{
print $2"x"$1
}' )
+ # really old systems may not support the above method
+ if [[ -z $screen_resolution ]];then
+ screen_resolution=$( stty -a | gawk -F ';' '
+ /^speed/ {
+ gsub(/[[:space:]]*(rows|columns)[[:space:]]*/,"",$0)
+ gsub(/[[:space:]]*/,"",$2)
+ gsub(/[[:space:]]*/,"",$3)
+ print $3"x"$2
+ }' )
+ fi
# note: this works fine for all systems but keeping the above for now since
# the above is probably more accurate for linux systems.
else
@@ -6501,16 +6604,28 @@ get_graphics_res_data()
get_graphics_display_server_data()
{
eval $LOGFS
- local vendor='' version='' a_temp='' xdpy_info='' a_display_vendor_working=''
-
- if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then
+ local vendor='' vendor_version='' a_temp='' xdpy_info='' a_display_vendor_working=''
+ # note: this may not always be set, it won't be out of X, for example
+ local server=$XDG_SESSION_TYPE compositor='' compositor_version=''
+
+ if [[ $B_EXTRA_EXTRA_DATA == 'true' ]];then
+ compositor=$(get_graphics_display_compositor) compositor_version=''
+ fi
+
+ if [[ $server == '' ]];then
+ if [[ -n $WAYLAND_DISPLAY ]];then
+ server='wayland'
+ fi
+ fi
+ # if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then
+ if [[ $B_SHOW_DISPLAY_DATA == 'true' ]];then
# X vendor and version detection.
# 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
# A failover mechanism is in place. (if $version is empty, the release number is parsed instead)
# xdpy_info="$( xdpyinfo )"
IFS=","
- a_display_vendor_working=( $( xdpyinfo | gawk -F': +' '
+ a_display_vendor_working=( $( xdpyinfo $DISPLAY_OPT 2>/dev/null | gawk -F': +' '
BEGIN {
IGNORECASE=1
vendorString=""
@@ -6532,19 +6647,22 @@ get_graphics_display_server_data()
gsub(/0+/, ".", $2)
vendorRelease = $2
}
+ /(supported pixmap|keycode range|number of extensions|^screen)/ {
+ exit # we are done with the info we want, no reason to read the rest
+ }
END {
print vendorString "," version "," vendorRelease
}' ) )
vendor=${a_display_vendor_working[0]}
- version=${a_display_vendor_working[1]}
+ vendor_version=${a_display_vendor_working[1]}
# this gives better output than the failure last case, which would only show:
# for example: X.org: 1.9 instead of: X.org: 1.9.0
- if [[ -z $version ]];then
- version=$( get_graphics_display_server_version )
+ if [[ -z $vendor_version ]];then
+ vendor_version=$( get_graphics_display_x_version )
fi
- if [[ -z $version ]];then
- version=${a_display_vendor_working[2]}
+ if [[ -z $vendor_version ]];then
+ vendor_version=${a_display_vendor_working[2]}
fi
# some distros, like fedora, report themselves as the xorg vendor, so quick check
@@ -6554,22 +6672,89 @@ get_graphics_display_server_data()
fi
IFS="$ORIGINAL_IFS"
A_DISPLAY_SERVER_DATA[0]="$vendor"
- A_DISPLAY_SERVER_DATA[1]="$version"
+ A_DISPLAY_SERVER_DATA[1]="$vendor_version"
+ A_DISPLAY_SERVER_DATA[2]="$server"
+ A_DISPLAY_SERVER_DATA[3]="$compositor"
+ A_DISPLAY_SERVER_DATA[4]="$compositor_version"
else
- version=$( get_graphics_display_server_version )
- if [[ -n $version ]];then
+ vendor_version=$( get_graphics_display_x_version )
+ if [[ -n $vendor_version ]];then
vendor='X.org'
A_DISPLAY_SERVER_DATA[0]="$vendor"
- A_DISPLAY_SERVER_DATA[1]="$version"
+ A_DISPLAY_SERVER_DATA[1]="$vendor_version"
+ A_DISPLAY_SERVER_DATA[2]="$server"
+ A_DISPLAY_SERVER_DATA[3]="$compositor"
+ A_DISPLAY_SERVER_DATA[4]="$compositor_version"
fi
fi
a_temp=${A_DISPLAY_SERVER_DATA[@]}
log_function_data "A_DISPLAY_SERVER_DATA: $a_temp"
eval $LOGFE
}
+get_graphics_display_compositor()
+{
+ eval $LOGFS
+ local compositor=''
+ local ps_aux="$( ps aux)"
+
+ if [[ -n $( grep 'mutter' <<< "$ps_aux" ) ]];then
+ compositor='mutter'
+ elif [[ -n $( grep 'gnome-shell' <<< "$ps_aux" ) ]];then
+ compositor='gnome-shell'
+ elif [[ -n $( grep 'kwin' <<< "$ps_aux" ) ]];then
+ compositor='kwin'
+ elif [[ -n $( grep 'moblin' <<< "$ps_aux" ) ]];then
+ compositor='moblin'
+ elif [[ -n $( grep 'kmscon' <<< "$ps_aux" ) ]];then
+ compositor='kmscon'
+ elif [[ -n $( grep 'sway' <<< "$ps_aux" ) ]];then
+ compositor='sway'
+ elif [[ -n $( grep 'grefson' <<< "$ps_aux" ) ]];then
+ compositor='grefson'
+ elif [[ -n $( grep 'westford' <<< "$ps_aux" ) ]];then
+ compositor='westford'
+ elif [[ -n $( grep 'rustland' <<< "$ps_aux" ) ]];then
+ compositor='rustland'
+ elif [[ -n $( grep 'fireplace' <<< "$ps_aux" ) ]];then
+ compositor='fireplace'
+ elif [[ -n $( grep 'wayhouse' <<< "$ps_aux" ) ]];then
+ compositor='wayhouse'
+ elif [[ -n $( grep 'weston' <<< "$ps_aux" ) ]];then
+ compositor='weston'
+ elif [[ -n $( grep 'compton' <<< "$ps_aux" ) ]];then
+ compositor='compton'
+ elif [[ -n $( grep 'compiz' <<< "$ps_aux" ) ]];then
+ compositor='compiz'
+ elif [[ -n $( grep 'swc' <<< "$ps_aux" ) ]];then
+ compositor='swc'
+ elif [[ -n $( grep 'dwc' <<< "$ps_aux" ) ]];then
+ compositor='dwc'
+ fi
+
+ log_function_data "compositor: $compositor"
+ echo $compositor
+ eval $LOGFE
+}
+# $1 - compositor
+get_graphics_display_wayland_version()
+{
+ eval $LOGFS
+
+ local version=''
+
+ case $1 in
+ mutter)
+ :
+ ;;
+ esac
+ log_function_data "version: $version"
+ echo $version
+
+ eval $LOGFE
+}
# if other tests fail, try this one, this works for root, out of X also
-get_graphics_display_server_version()
+get_graphics_display_x_version()
{
eval $LOGFS
local version='' x_data=''
@@ -8000,7 +8185,7 @@ get_networking_usb_data()
get_networking_wan_ip_data()
{
eval $LOGFS
- local ip='' ip_data='' downloader_error=0 ua='' b_ipv4_good=true
+ local ip='' ip_data='' downloader_error=0 ua='' b_ipv4_good=true no_check_ssl=''
# get ip using wget redirect to stdout. This is a clean, text only IP output url,
# single line only, ending in the ip address. May have to modify this in the future
@@ -8020,19 +8205,19 @@ get_networking_wan_ip_data()
if [[ -n $( grep 'smxi.org' <<< $WAN_IP_URL ) ]];then
ua="-A s-tools/inxi-ip"
fi
- ip_data="$( curl $ua -y $DL_TIMEOUT -s $WAN_IP_URL )" || downloader_error=$?
+ ip_data="$( curl $NO_SSL_OPT $ua -y $DL_TIMEOUT -s $WAN_IP_URL )" || downloader_error=$?
;;
fetch)
- ip_data="$( fetch -T $DL_TIMEOUT -q -o - $WAN_IP_URL )" || downloader_error=$?
+ ip_data="$( fetch $NO_SSL_OPT -T $DL_TIMEOUT -q -o - $WAN_IP_URL )" || downloader_error=$?
;;
ftp)
- ip_data="$( ftp -o - $WAN_IP_URL 2>/dev/null )" || downloader_error=$?
+ ip_data="$( ftp $NO_SSL_OPT -o - $WAN_IP_URL 2>/dev/null )" || downloader_error=$?
;;
wget)
if [[ -n $( grep 'smxi.org' <<< $WAN_IP_URL ) ]];then
ua="-U s-tools/inxi-ip"
fi
- ip_data="$( wget $ua -T $DL_TIMEOUT -q -O - $WAN_IP_URL )" || downloader_error=$?
+ ip_data="$( wget $NO_SSL_OPT $ua -T $DL_TIMEOUT -q -O - $WAN_IP_URL )" || downloader_error=$?
;;
no-downloader)
downloader_error=1
@@ -8255,7 +8440,7 @@ get_optical_drive_data()
local a_temp='' sys_uevent_path='' proc_cdrom='' link_list=''
local separator='' linked='' working_disk='' disk='' item_string='' proc_info_string=''
local dev_disks_full=''
- dev_disks_full="$( ls /dev/dvd* /dev/cd* /dev/scd* /dev/sr* 2>/dev/null | grep -vE 'random' )"
+ dev_disks_full="$( ls /dev/dvd* /dev/cd* /dev/scd* /dev/sr* /dev/fd[0-9] 2>/dev/null | grep -vE 'random' )"
## Not using this now because newer kernel is NOT linking all optical drives. Some, but not all
# Some systems don't support xargs -L plus the unlinked optical drive unit make this not a good option
# get the actual disk dev location, first try default which is easier to run, need to preserve line breaks
@@ -10180,7 +10365,7 @@ get_repo_data()
local bsd_pkg_dir='/usr/local/etc/pkg/repos/' slackpkg_file='/etc/slackpkg/mirrors'
local netbsd_file='/usr/pkg/etc/pkgin/repositories.conf' freebsd_file='/etc/freebsd-update.conf'
local freebsd_pkg_file='/etc/pkg/FreeBSD.conf' slackpkg_plus_file='/etc/slackpkg/slackpkgplus.conf'
- local portage_repo_dir='/etc/portage/repos.conf/'
+ local portage_repo_dir='/etc/portage/repos.conf/' apk_file='/etc/apk/repositories'
# apt - debian, buntus, also sometimes some yum/rpm repos may create apt repos here as well
if [[ -f $apt_file || -d $apt_file.d ]];then
@@ -10505,6 +10690,21 @@ get_repo_data()
done <<< "$REPO_DATA"
# echo and execute the line breaks inserted
REPO_DATA="$( echo -e $repo_data_working )"
+ # alpine linux
+ elif [[ -f $apk_file ]];then
+ # note, only one file, but loop it in case more are added in future
+ for repo_file in $apk_file
+ do
+ if [[ -n $1 ]];then
+ cat $repo_file &> $1/repo-data_${repo_file//\//-}.txt
+ fi
+ repo_data_working="$( gawk -v repoFile="$repo_file" '
+ !/^[[:space:]]*$|^[[:space:]]*#/ {
+ print "APK repo^" repoFile "^" $0
+ }' $repo_file )"
+ get_repo_builder "$repo_data_working"
+ done
+ repo_data_working=''
elif [[ -f $ports_conf || -f $freebsd_file || -d $bsd_pkg_dir ]];then
if [[ -f $ports_conf ]];then
if [[ -n $1 ]];then
@@ -11239,8 +11439,8 @@ get_unmounted_partition_data()
if [[ $B_RAID_SET != 'true' ]];then
get_raid_data
fi
- # sr0 type cd drives are showing up now as unmounted partitions
- mounted_partitions="scd[0-9]+|sr[0-9]+|cdrom[0-9]*|cdrw[0-9]*|dvd[0-9]*|dvdrw[0-9]*"
+ # sr0 type cd drives are showing up now as unmounted partitions.
+ mounted_partitions="scd[0-9]+|sr[0-9]+|cdrom[0-9]*|cdrw[0-9]*|dvd[0-9]*|dvdrw[0-9]*|fd[0-9]|ram[0-9]*"
# create list for slicing out the mounted partitions
for (( i=0; i < ${#A_PARTITION_DATA[@]}; i++ ))
do
@@ -11263,18 +11463,18 @@ get_unmounted_partition_data()
mounted_partitions="$mounted_partitions$separator$raid_partitions"
fi
done
-
- A_UNMOUNTED_PARTITION_DATA=( $( grep -Ev '[[:space:]]('$mounted_partitions')$' $FILE_PARTITIONS | gawk '
+ # grep -Ev '[[:space:]]('$mounted_partitions')$' $FILE_PARTITIONS |
+ A_UNMOUNTED_PARTITION_DATA=( $( gawk '
BEGIN {
IGNORECASE=1
}
# note that size 1 means it is a logical extended partition container
# lvm might have dm-1 type syntax
# need to exclude loop type file systems, squashfs for example
- /[a-z][0-9]+$|dm-[0-9]+$/ && $3 != 1 && $NF !~ /loop/ {
+ /[a-z][0-9]+$|dm-[0-9]+$/ && $3 != 1 && $NF !~ /loop/ && $NF !~ /('$mounted_partitions')/ {
size = sprintf( "%.2f", $3*1024/1000**3 )
print $4 "," size "G"
- }' ) )
+ }' $FILE_PARTITIONS ) )
for (( i=0; i < ${#A_UNMOUNTED_PARTITION_DATA[@]}; i++ ))
do
@@ -11378,16 +11578,16 @@ get_weather_data()
if [[ $b_test_loc != 'true' ]];then
case $DOWNLOADER in
curl)
- location_data="$( curl -y $DL_TIMEOUT -s $location_site )" || downloader_error=$?
+ location_data="$( curl $NO_SSL_OPT -y $DL_TIMEOUT -s $location_site )" || downloader_error=$?
;;
fetch)
- location_data="$( fetch -T $DL_TIMEOUT -q -o - $location_site )" || downloader_error=$?
+ location_data="$( fetch $NO_SSL_OPT -T $DL_TIMEOUT -q -o - $location_site )" || downloader_error=$?
;;
ftp)
- location_data="$( ftp -o - $location_site 2>/dev/null )" || downloader_error=$?
+ location_data="$( ftp $NO_SSL_OPT -o - $location_site 2>/dev/null )" || downloader_error=$?
;;
wget)
- location_data="$( wget -t 1 -T $DL_TIMEOUT -q -O - $location_site )" || downloader_error=$?
+ location_data="$( wget $NO_SSL_OPT -t 1 -T $DL_TIMEOUT -q -O - $location_site )" || downloader_error=$?
;;
no-downloader)
downloader_error=100
@@ -11515,16 +11715,16 @@ get_weather_data()
if [[ $b_test_weather != 'true' ]];then
case $DOWNLOADER in
curl)
- weather_data="$( curl -y $DL_TIMEOUT -s $weather_feed"$location" )" || downloader_error=$?
+ weather_data="$( curl $NO_SSL_OPT -y $DL_TIMEOUT -s $weather_feed"$location" )" || downloader_error=$?
;;
fetch)
- weather_data="$( fetch -T $DL_TIMEOUT -q -o - $weather_feed"$location" )" || downloader_error=$?
+ weather_data="$( fetch $NO_SSL_OPT -T $DL_TIMEOUT -q -o - $weather_feed"$location" )" || downloader_error=$?
;;
ftp)
- weather_data="$( ftp -o - $weather_feed"$location" 2>/dev/null )" || downloader_error=$?
+ weather_data="$( ftp $NO_SSL_OPT -o - $weather_feed"$location" 2>/dev/null )" || downloader_error=$?
;;
wget)
- weather_data="$( wget -t 1 -T $DL_TIMEOUT -q -O - $weather_feed"$location" )" || downloader_error=$?
+ weather_data="$( wget $NO_SSL_OPT -t 1 -T $DL_TIMEOUT -q -O - $weather_feed"$location" )" || downloader_error=$?
;;
no-downloader)
downloader_error=100
@@ -12456,7 +12656,7 @@ print_cpu_data()
cpu_data="$cpu_data${C2} ${C1}cache$SEP3${C2} $cpu_cache"
cpu_2_data="$cpu_flags$bmip_data"
else
- cpu_data="$cpu_data${C2} (ARM)$bmip_data"
+ cpu_data="$cpu_data${C2} (ARM) $bmip_data"
fi
fi
# we don't this printing out extra line unless > 1 cpu core
@@ -12638,7 +12838,7 @@ print_dmidecode_error()
elif [[ $2 == 'dmidecode-error-no-battery-data' ]];then
error_message="${sysDmiError}dmidecode: no battery data available."
elif [[ $2 == 'dmidecode-error-unknown-error' ]];then
- error_message="${sysDmiError}dmidecode: unknown error occured"
+ error_message="${sysDmiError}dmidecode: unknown error occurred"
fi
echo $error_message
eval $LOGFE
@@ -12649,24 +12849,31 @@ print_graphics_data()
eval $LOGFS
local graphics_data='' card_id='' i='' root_alert='' root_x_string='' a_graphics_working=''
local b_is_mesa='false' display_full_string='' card_bus_id='' card_data=''
- local res_tty='Resolution' xorg_data='' display_vendor_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 separator_loaded='' separator_unloaded='' separator_failed=''
- local loaded='' unloaded='' failed='' display_server_string=''
- local line_starter='Graphics:' part_1_data='' part_2_data=''
- local screen_resolution="$( get_graphics_res_data )"
+ 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 screen_resolution="$( get_graphics_res_data 'reg' )"
# set A_DISPLAY_SERVER_DATA
get_graphics_display_server_data
+
local display_vendor=${A_DISPLAY_SERVER_DATA[0]}
local display_version=${A_DISPLAY_SERVER_DATA[1]}
+ local display_server=${A_DISPLAY_SERVER_DATA[2]}
+ local compositor=${A_DISPLAY_SERVER_DATA[3]} compositor_string=''
+
# set A_GLX_DATA
get_graphics_glx_data
+ # oglr, oglv, dr, oglcpv, compatVersion
local glx_renderer="${A_GLX_DATA[0]}"
local glx_version="${A_GLX_DATA[1]}"
# this can contain a long No case debugging message, so it's being sliced off
# note: using grep -ioE '(No|Yes)' <<< ${A_GLX_DATA[2]} did not work in Arch, no idea why
- local glx_direct_render=$( gawk '{print $1}' <<< "${A_GLX_DATA[2]}" )
+ local direct_rendering=$( gawk '{print $1}' <<< "${A_GLX_DATA[2]}" )
+ local glx_core_version="${A_GLX_DATA[3]}"
+ local glx_compat_version_nu="${A_GLX_DATA[4]}"
# set A_GRAPHICS_CARD_DATA
if [[ $BSD_TYPE == 'bsd' ]];then
@@ -12726,27 +12933,45 @@ print_graphics_data()
fi
# some basic error handling:
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
# note: fix this, we may find a display server that has no version
if [[ -z $display_vendor || -z $display_version ]];then
- display_vendor_string="N/A"
+ display_server_string="N/A"
else
- display_vendor_string="$display_vendor $display_version"
+ display_server_string="$display_vendor $display_version"
+ fi
+ if [[ $display_server != '' ]];then
+ display_server_string="$display_server ($display_server_string)"
fi
- display_server_string="${C1}Display Server${SEP3}${C2} $display_vendor_string "
+
+ if [[ $B_EXTRA_EXTRA_DATA == '' && $compositor != '' ]] &&\
+ [[ $display_server == 'wayland' || $display_server == 'mir' ]];then
+ compositor_string="${C1}compositor$SEP3${C2} $compositor "
+ fi
+ display_server_string="${C1}Display Server${SEP3}${C2} $display_server_string $compositor_string"
driver_string="${C1}driver$driver_plural$SEP3${C2}$driver "
- if [[ $B_ROOT == 'true' ]];then
+ if [[ $glx_renderer == '' && $B_ROOT == 'true' ]];then
root_x_string='for root '
- if [[ $B_IRC == 'false' || $B_CONSOLE_IRC == 'true' ]];then
- res_tty='tty size'
- fi
+ b_advanced='false'
+# if [[ $B_IRC == 'false' || $B_CONSOLE_IRC == 'true' ]];then
+# res_tty='tty size'
+# fi
fi
if [[ $B_RUNNING_IN_DISPLAY != 'true' ]];then
root_x_string="${root_x_string}out of X"
res_tty='tty size'
fi
+ # || -n ${screen_resolution/*@*/}
+ if [[ $b_force_tty == 'true' || $B_SHOW_DISPLAY_DATA != 'true' || $B_RUNNING_IN_DISPLAY != 'true' ]];then
+ res_tty='tty size'
+ fi
if [[ -n $root_x_string ]];then
root_x_string="${C1}Advanced Data$SEP3${C2} N/A $root_x_string"
@@ -12845,21 +13070,33 @@ print_graphics_data()
## note: if glx render or display_version have no content, then mesa is true
# if [[ $B_SHOW_DISPLAY_DATA == 'true' ]] && [[ $b_is_mesa != 'true' ]];then
- 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' && $b_advanced == 'true' ]];then
if [[ -z $glx_renderer ]];then
glx_renderer='N/A'
fi
- if [[ -z $glx_version ]];then
+ if [[ -z $glx_version ]];then
glx_version='N/A'
+ else
+ # non free drivers once filtered and cleaned show the same for core and compat
+ if [[ -n $glx_core_version && $glx_core_version != $glx_version ]];then
+ glx_version=$glx_core_version
+ if [[ $B_EXTRA_EXTRA_DATA == 'true' ]];then
+ if [[ $glx_compat_version_nu != '' ]];then
+ glx_version="$glx_version (compat-v$SEP3 $glx_compat_version_nu)"
+ fi
+ fi
+ fi
fi
- if [[ -z $glx_direct_render ]];then
- glx_direct_render='N/A'
+
+ if [[ -z $direct_rendering ]];then
+ direct_rendering='N/A'
fi
if [[ $B_HANDLE_CORRUPT_DATA == 'true' || $B_EXTRA_DATA == 'true' ]];then
- direct_render_string=" ${C1}Direct Rendering$SEP3${C2} $glx_direct_render"
+ direct_render_string=" ${C1}Direct Render$SEP3${C2} $direct_rendering"
fi
- part_1_data="${C1}GLX Renderer$SEP3${C2} $glx_renderer "
- part_2_data="${C1}GLX Version$SEP3${C2} $glx_version$direct_render_string"
+ part_1_data="${C1}OpenGL$SEP3 renderer$SEP3${C2} $glx_renderer "
+ part_2_data="${C1}version$SEP3${C2} $glx_version$direct_render_string"
# echo $line_starter
if [[ $( calculate_line_length "$part_1_data$part_2_data" ) -gt $COLS_INNER ]];then
graphics_data=$( create_print_line "$line_starter" "$part_1_data" )
@@ -13535,7 +13772,7 @@ print_network_advanced_data()
if [[ -n ${a_network_working[6]} ]];then
oper_state=${a_network_working[6]}
fi
- # no print out for wifi since it doesn't have duplex/speed data availabe
+ # no print out for wifi since it doesn't have duplex/speed data available
# note that some cards show 'unknown' for state, so only testing explicitly
# for 'down' string in that to skip showing speed/duplex
if [[ $b_is_wifi != 'true' && $oper_state != 'down' ]];then
@@ -13699,6 +13936,7 @@ print_optical_drive_data()
local a_drives='' drive_data='' counter='' dev_string='/dev/' speed_string='x'
local drive_id='' drive_links='' vendor='' speed='' multisession='' mcn='' audio=''
local dvd='' state='' rw_support='' rev='' separator='' drive_string='' part_2_data=''
+ local drive_type='Optical' fd_counter=0 opt_counter=0 b_floppy='false'
if [[ -z $BSD_TYPE ]];then
get_optical_drive_data
else
@@ -13734,43 +13972,56 @@ print_optical_drive_data()
drive_string="No optical drives detected."
B_SHOW_FULL_OPTICAL='false'
else
- if [[ ${#A_OPTICAL_DRIVE_DATA[@]} -gt 1 ]];then
- counter="-$(( i + 1 ))"
+ if [[ -n ${a_drives[0]/fd*/} ]];then
+ opt_counter=$(( $opt_counter + 1 ))
+ counter="-$opt_counter"
+ drive_type='Optical'
+ b_floppy='false'
+ else
+ fd_counter=$(( $fd_counter + 1 ))
+ counter="-$fd_counter"
+ drive_type='Floppy'
+ b_floppy='true'
fi
if [[ -z ${a_drives[0]} ]];then
drive_id='N/A'
else
drive_id="$dev_string${a_drives[0]}"
fi
- drive_links=$( sed 's/~/,/g' <<< ${a_drives[1]} )
- if [[ -z $drive_links ]];then
- drive_links='N/A'
- fi
- if [[ -n ${a_drives[2]} ]];then
- vendor=${a_drives[2]}
- if [[ -n ${a_drives[3]} ]];then
- vendor="$vendor ${a_drives[3]}"
+ if [[ $b_floppy == 'false' ]];then
+ drive_links=$( sed 's/~/,/g' <<< ${a_drives[1]} )
+ if [[ -z $drive_links ]];then
+ drive_links='N/A'
fi
- fi
- if [[ -z $vendor ]];then
- if [[ -n ${a_drives[3]} ]];then
- vendor=${a_drives[3]}
- else
- vendor='N/A'
+ if [[ -n ${a_drives[2]} ]];then
+ vendor=${a_drives[2]}
+ if [[ -n ${a_drives[3]} ]];then
+ vendor="$vendor ${a_drives[3]}"
+ fi
fi
- fi
- if [[ $B_EXTRA_DATA == 'true' ]];then
- if [[ -n ${a_drives[4]} ]];then
- rev=${a_drives[4]}
- else
- rev='N/A'
+ if [[ -z $vendor ]];then
+ if [[ -n ${a_drives[3]} ]];then
+ vendor=${a_drives[3]}
+ else
+ vendor='N/A'
+ fi
+ fi
+ if [[ $B_EXTRA_DATA == 'true' ]];then
+ if [[ -n ${a_drives[4]} ]];then
+ rev=${a_drives[4]}
+ else
+ rev='N/A'
+ fi
+ rev="${C1}rev$SEP3${C2} $rev "
fi
- rev="${C1}rev$SEP3${C2} $rev "
+ drive_string="$drive_id ${C1}model$SEP3${C2} $vendor "
+ part_2_data="$rev${C1}dev-links$SEP3${C2} $drive_links"
+ else
+ drive_string="$drive_id"
+ part_2_data=''
fi
- drive_string="$drive_id ${C1}model$SEP3${C2} $vendor "
- part_2_data="$rev${C1}dev-links$SEP3${C2} $drive_links"
fi
- drive_data="${C1}Optical${counter}$SEP3${C2} $drive_string"
+ drive_data="${C1}$drive_type${counter}$SEP3${C2} $drive_string"
if [[ $( calculate_line_length "$drive_data$part_2_data" ) -lt $COLS_INNER ]];then
drive_data=$( create_print_line "$Line_Starter" "$drive_data$part_2_data" )
print_screen_output "$drive_data"
@@ -13812,7 +14063,7 @@ print_optical_drive_data()
# 12 - dvdr
# 13 - dvdram
# 14 - state
- if [[ $B_SHOW_FULL_OPTICAL == 'true' ]];then
+ if [[ $B_SHOW_FULL_OPTICAL == 'true' && $b_floppy == 'false' ]];then
if [[ -z ${a_drives[5]} ]];then
speed='N/A'
else
@@ -14877,7 +15128,7 @@ print_system_data()
local system_data='' bits='' desktop_environment='' dm_data='' de_extra_data=''
local de_string='' distro_string='' line_starter='System:'
local host_kernel_string='' host_string='' desktop_type='Desktop'
- local host_name=$HOSTNAME
+ local host_name=$HOSTNAME
local current_kernel=$( get_kernel_version )
local distro="$( get_distro_data )"
local tty_session='' compiler_string='' distro_os='Distro'
@@ -14899,8 +15150,13 @@ print_system_data()
de_extra_data=" ${C1}info$SEP3${C2} $de_extra_data"
fi
fi
- else
+ fi
+ # handle separately since some systems will have no root desktop data
+ if [[ $B_RUNNING_IN_DISPLAY == 'false' ]] || [[ $desktop_environment == 'N/A' && $B_ROOT == 'true' ]];then
tty_session=$( get_tty_number )
+ if [[ $desktop_environment == 'N/A' ]];then
+ de_extra_data=''
+ fi
if [[ -z $tty_session && $B_CONSOLE_IRC == 'true' ]];then
tty_session=$( get_tty_console_irc )
fi