diff --git a/inxi b/inxi index 0bae203..137c3da 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.12 +#### Date: 2017-06-06 #### Patch Number: 00 ######################################################################## #### SPECIAL THANKS @@ -2144,7 +2144,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...' @@ -3147,7 +3158,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)." 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." @@ -4453,6 +4464,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,14 +4479,20 @@ get_cpu_data() gsub(/^ +| +$/, "", $NF) if ( $NF ~ "^[0-9]+$" ) { nr = $NF + bProcInt = "true" } else { - if ( $NF ~ "^ARM" ) { + # note: alternate: + # Processor : AArch64 Processor rev 4 (aarch64) + if ( $NF ~ "^(ARM|AArch)" ) { bArm = "true" } - count += 1 - nr = count - 1 - cpu[nr, "model"] = $NF + # this protects against double processor lines, one int, one string + if ( bProcInt == "false" ){ + count += 1 + nr = count - 1 + cpu[nr, "model"] = $NF + } } } /^model name|^cpu\t+:/ { @@ -4795,6 +4813,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 +4828,33 @@ 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" + + } + # 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 } - 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 @@ -6501,7 +6530,19 @@ get_graphics_res_data() get_graphics_display_server_data() { eval $LOGFS - local vendor='' version='' a_temp='' xdpy_info='' a_display_vendor_working='' + 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 # X vendor and version detection. @@ -6532,19 +6573,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 +6598,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='' @@ -12456,7 +12567,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 @@ -12649,7 +12760,7 @@ 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='' @@ -12658,8 +12769,12 @@ print_graphics_data() # 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 local glx_renderer="${A_GLX_DATA[0]}" @@ -12730,11 +12845,19 @@ print_graphics_data() 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 - display_server_string="${C1}Display Server${SEP3}${C2} $display_vendor_string " + if [[ $display_server != '' ]];then + display_server_string="$display_server ($display_server_string)" + fi + + 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 diff --git a/inxi.1 b/inxi.1 index c2cb5ae..48b4e33 100644 --- a/inxi.1 +++ b/inxi.1 @@ -1,4 +1,4 @@ -.TH INXI 1 "2017\-05\-31" inxi "inxi manual" +.TH INXI 1 "2017\-06\-06" inxi "inxi manual" .SH NAME inxi \- Command line system information script for console and IRC .SH SYNOPSIS @@ -126,8 +126,9 @@ those arguments in the command, like: \fBinxi \-Frmxx\fR .B \-G Show Graphic card information. Card(s), Display Server (vendor and version number), for example: \fBDisplay Server: Xorg 1.15.1 \fR -,screen resolution(s), glx renderer, version). At some point Wayland and other display servers -may be added once enough data has been collected. +,screen resolution(s), glx renderer, version). If detected (currently only available if on a desktop: will +attempt to show the server type, ie, x11, wayland, mir. When xorg is present, its version information will show +after the server type in parentheses. Future versions will show compositor information as well. .TP .B \-h The help menu. Features dynamic sizing to fit into terminal window. Set script global \fBCOLS_MAX_CONSOLE\fR @@ -452,7 +453,7 @@ Note that \fBvolts\fR shows the data (if available) as: Voltage Now / Minimum De \- Adds disk serial number. .TP .B \-xx \-G -\- Adds vendor:product ID of each Graphics card. +\- Adds vendor:product ID of each Graphics card. Wayland/Mir only: if found, attempts to show compositor (experimental). .TP .B \-xx \-I \- Show init type version number (and rc if present). diff --git a/inxi.changelog b/inxi.changelog index 07ed26a..3f0df38 100644 --- a/inxi.changelog +++ b/inxi.changelog @@ -1,3 +1,38 @@ +===================================================================================== +Version: 2.3.12 +Patch Version: 00 +Script Date: 2017-06-06 +----------------------------------- +Changes: +----------------------------------- +New version, man page, tarball. ARM cpu core count bug fix. First attempt to add Wayland +and compositor support. + +This finally implements a first try at mir/wayland detection, along with basic handling of actual +display server type output. + +New output for Display Server: Display Server: x11 (X.Org 1.19.0) driver: nvidia + +Note that since almost all current Wayland systems will have X.org also installed, for the time +being, the data in the parentheses will be from X.org regardless of what display server is detected running +the actual desktop. Out of the desktop, console, the only thing that will show is x data.. + +No other data is available to me yet until I get way more debugger data so I can see what information the various +implementations of wayland without x tools actually makes available, my guess is it won't be much. + +Also experimental -xx option: -G shows compositor, but only for wayland/mir currently. + +I have no idea if this will work at all, but it's worth giving it a try as a rough beginning to +start handling the wide range of wayland compositors being created. + +This feature will probably take several versions to get stable. + +Also added new debugger data collector data for wayland information, but the pickings are slim, to +put it mildly. + +----------------------------------- +-- Harald Hope - Tue, 06 Jun 2017 18:43:31 -0700 + ===================================================================================== Version: 2.3.11 Patch Version: 00 @@ -362,7 +397,7 @@ Script Date: 2016-03-30 Changes: ----------------------------------- New version, new tarball. Tiny fix in distro detection, will now default in sequence -on /etc/issue step to first test for os release and not mint, then lsb version and +on /etc/issue step to first test for os release and not mint, then lsb verison and not mint, then /etc/issue. This should keep the mint detection working well, as long as they keep mint string in the /etc/issue file, that is, but that's out of our control. @@ -491,7 +526,7 @@ Script Date: 2015-11-15 ----------------------------------- Changes: ----------------------------------- -New version, new tarball. Try 2 at mmcblk support. I had mmcblock, that's not how it's +New version, new tarball. Try 2 at mmcblk support. I had mmcblock, thats not how it's reported to the system. ----------------------------------- @@ -690,7 +725,7 @@ was by far the best option I've come across, it was done by a deep pocketed corp for pretty good reasons, and was never intended to be a profit center, which is the closest I could see for a non free option. -Setting up svn gui stuff however is a royal pain and requires ongoing maintenance for the life of +Setting up svn gui stuff however is a royal pain and requires ongoing maintainance for the life of the software, which is NOT fun, nor will I sign up for that obligation. I may end up moving to github anyway, even though git truly sucks for inxi and myself, but it's an @@ -2045,7 +2080,7 @@ Changes: ----------------------------------- new version: this is only an optimization release, testing some slightly more efficient methods: -something <<< $variable is significantly slower than: echo $variable | something +something <<< $variable is signficantly slower than: echo $variable | something so I replaced almost all instances of <<< with echo ...| I've seen speed differences of up to 10% but it's not consistent, so this is just @@ -2371,7 +2406,7 @@ test for there in this case. So leaving gtk version bugs unhandled due to no user information or feedback, if you want it fixed or if it works for your distro, let me know and also if it does not work, tell -me the correct command, with its output, to get gtk version. +me the correct commmand, with its output, to get gtk version. That's for inxi -Sx output that is. @@ -2460,7 +2495,7 @@ of debugging output and fix it at that point. This fix repairs an existing xorg bug that is unlikely to get fixed any time soon (the call to load the detected drivers, eg, vesa, intel, is repeated, causing a failure of driver already loaded on the second -occurrence. +occurance. ----------------------------------- -- Harald Hope - Mon, 12 Aug 2013 16:20:51 -0700 @@ -2500,7 +2535,7 @@ Changes: ----------------------------------- New version, new tarball. The recent bug fixes reminded me to check for ARM working, that had some bugs too, so I've updated that. -f for ARM now shows features instead of flags, and the -C regular cpu output does not -show cache/flags for arm cpus because they don't have those features. +show cache/flags for arm cpus becuase they don't have those features. Added some flags passed to various cpu functions and better detections of ARM cpu to handle dual core and other issues that were not handled before as well, or at all.