Update inxi to version 2.3.0
authorMichael Marley <michael@michaelmarley.com>
Mon, 6 Jun 2016 21:46:02 +0000 (17:46 -0400)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 28 Feb 2018 22:09:21 +0000 (23:09 +0100)
Closes GH-204.

(cherry picked from commit 83923d7c121dbcf514d4ff5b0ac2abb6eb08c6b9)

data/scripts/inxi [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 0c55bb8..fc9550f
@@ -1,8 +1,8 @@
 #!/usr/bin/env bash
 ########################################################################
 ####  Script Name: inxi
-####  Version: 2.1.2
-####  Date: 2014-03-14
+####  Version: 2.3.0
+####  Date: 2016-04-18
 ####  Patch Number: 00
 ########################################################################
 ####  SPECIAL THANKS
 ####  Gaim/Pidgin, Weechat, KVIrc and Kopete.
 ####  Original infobash author and copyright holder:
 ####  Copyright (C) 2005-2007  Michiel de Boer a.k.a. locsmif
-####  inxi version: Copyright (C) 2008-2014 Scott Rogers & Harald Hope
+####  inxi version: Copyright (C) 2008-2016 Scott Rogers & Harald Hope
 ####  Further fixes (listed as known): Horst Tritremmel <hjt at sidux.com>
 ####  Steven Barrett (aka: damentz) - usb audio patch; swap percent used patch
 ####  Jarett.Stevens - dmidecde -M patch for older systems with the /sys 
 ####
-####  Current script home page/wiki/svn: http://inxi.googlecode.com
+####  Current script home page/wiki/git: https://github.com/smxi/inxi 
+####  Documentation/wiki pages will move to http://smxi.org soon.
 ####  Script forums: http://techpatterns.com/forums/forum-33.html
 ####  IRC support: irc.oftc.net channel #smxi
+####  Version control:
+####   * https://github.com/smxi/inxi
+####   * git: git pull https://github.com/smxi/inxi master
+####   * svn checkout url: https://github.com/smxi/inxi
 ####
 ####  This program is free software; you can redistribute it and/or modify
 ####  it under the terms of the GNU General Public License as published by
@@ -45,6 +50,9 @@
 ####  If you don't understand what Free Software is, please read (or reread)
 ####  this page: http://www.gnu.org/philosophy/free-sw.html
 ########################################################################
+
+####
+#### PACKAGE NAME NOTES
 ####  * Package names in (...) are the Debian Squeeze package name. Check your 
 ####    distro for proper package name by doing this: which <application> 
 ####    then find what package owns that application file. Or run --recommends
@@ -53,8 +61,8 @@
 ####  DEPENDENCIES
 ####  * bash >=3.0 (bash); df, readlink, stty, tr, uname, wc (coreutils);
 ####    gawk (gawk); grep (grep); lspci (pciutils);
-####    ps, uptime (procps); find (findutils)
-####  * Also the proc filesystem should be present and mounted
+####    ps, find (findutils)
+####  * Also the proc filesystem should be present and mounted for Linux
 ####  * Some features, like -M and -d will not work, or will work incompletely,
 ####    if /sys is missing
 ####
@@ -74,7 +82,9 @@
 ####  -G - full graphics output requires:  glxinfo (mesa-utils); xdpyinfo (X11-utils);
 ####       xrandr (x11-xserver-utils)
 ####  -i - IP information, local/wan - ip (iproute) legacy, not used if ip present: ifconfig (net-tools)
+####  -I - uptime (procps, check Debian if changed)
 ####  -Ix - view current runlevel while not in X window system (or with -x): runlevel (sysvinit)
+####  -m - all systems, dmidecode, unless someone can find a better way.
 ####  -M - for older systems whose kernel does not have /sys data for machine, dmidecode (dmidecode)
 ####  -o - for unmounted file system information in unmounted drives (root only default): file (file)
 ####       Note: requires user action for this feature to run as user (edit /etc/sudoers file)
 ####  * Note: [[ -n $something ]] - double brackets does not require quotes for variables: ie, "$something".
 ####  * Always use quotes, double or single, for all string values.
 ####  * All new code/methods must be in a function.
+
 ####  * For all boolean tests, use 'true' / 'false'.
 ####    !! Do NOT use 0 or 1 unless it's a function return. 
 ####  * Avoid complicated tests in the if condition itself.
 ####  * To 'return' a value in a function, use 'echo <var>'.
 ####  * For gawk: use always if ( num_of_cores > 1 ) { hanging { starter for all blocks
 ####    This lets us use one method for all gawk structures, including BEGIN/END, if, for, etc
+####  * Using ${VAR} is about 30% slower than $VAR because bash has to check the stuff for actions
+####  SUBSHELLS ARE EXPENSIVE! - run these two if you do not believe me.
+####  time for (( i=0; i<1000; i++ )) do ff='/usr/local/bin/foo.pid';ff=${ff##*/};ff=${ff%.*};done;echo $ff
+####  time for (( i=0; i<1000; i++ )) do ff='/usr/local/bin/foo.pid';ff=$( basename $ff | cut -d '.' -f 1 );done;echo $ff
 ####
 ####  VARIABLE/FUNCTION NAMING:
 ####  * All functions should follow standard naming--verb adjective noun. 
 ####    ln -s <path to inxi> /usr/share/apps/konversation/scripts/inxi
 ####    DCOP doesn't like \n, so avoid using it for most output unless required, as in error messages.
 ####  * print_screen_output " " # requires space, not null, to avoid error in for example in irssi
-####  * For logging of array data, array must be placed into the temp_array, otherwise only the first key logs
+####  * For logging of array data, array must be placed into the a_temp, otherwise only the first key logs
 ####  * In gawk search patterns, . is a wildcard EXCEPT in [0-9.] type containers, then it's a literal
 ####    So outside of bracketed items, it must be escaped, \. but inside, no need. Outside of gawk it should 
 ####    be escaped in search patterns if you are using it as a literal.
@@ -211,9 +226,12 @@ FILTER_STRING='<filter>'
 # widths will be dynamically set in main() based on cols in term/console
 COLS_MAX_CONSOLE='115'
 COLS_MAX_IRC='105'
+# note, this is console out of x/display server, will also be set dynamically
+# not used currently, but maybe in future
+COLS_MAX_NO_DISPLAY='140'
 PS_COUNT=5
 # change to less, or more if you have very slow connection
-WGET_TIMEOUT=8
+DL_TIMEOUT=8
 ### END USER CONFIGS ###
 
 ### LOCALIZATION - DO NOT CHANGE! ###
@@ -236,6 +254,7 @@ ORIGINAL_IFS="$IFS"
 ## Initialize
 A_ALSA_DATA=''
 A_AUDIO_DATA=''
+A_BATTERY_DATA=''
 A_CMDL=''
 A_CPU_CORE_DATA=''
 A_CPU_DATA=''
@@ -249,6 +268,7 @@ A_HDD_DATA=''
 A_INIT_DATA=''
 A_INTERFACES_DATA=''
 A_MACHINE_DATA=''
+A_MEMORY_DATA=''
 A_NETWORK_DATA=''
 A_OPTICAL_DRIVE_DATA=''
 A_PARTITION_DATA=''
@@ -262,6 +282,7 @@ A_DISPLAY_SERVER_DATA=''
 
 ### BOOLEANS ###
 ## standard boolean flags ##
+B_BSD_DISK_SET='false'
 B_BSD_RAID='false'
 B_COLOR_SCHEME_SET='false'
 B_CONSOLE_IRC='false'
@@ -273,11 +294,14 @@ B_DBUS_CLIENT='false'
 B_DCOP='false'
 # Debug flood override: make 'true' to allow long debug output
 B_DEBUG_FLOOD='false'
+# for special -i debugging cases
+B_DEBUG_I='false'
 B_DMIDECODE_SET='false'
 # show extra output data
 B_EXTRA_DATA='false'
 # triggered by -xx
 B_EXTRA_EXTRA_DATA='false'
+B_FORCE_DMIDECODE='false'
 B_ID_SET='false'
 # override certain errors due to currupted data
 B_HANDLE_CORRUPT_DATA='false'
@@ -298,9 +322,9 @@ B_ROOT='false'
 B_RUN_COLOR_SELECTOR='false'
 B_RUNNING_IN_DISPLAY='false' # in x type display server
 if tty >/dev/null;then
-       B_RUNNING_IN_SHELL='true'
+       B_IRC='false'
 else
-       B_RUNNING_IN_SHELL='false'
+       B_IRC='true'
 fi
 # this sets the debug buffer
 B_SCRIPT_UP='false'
@@ -311,6 +335,8 @@ B_SHOW_BASIC_RAID='false'
 B_SHOW_BASIC_CPU='false'
 B_SHOW_BASIC_DISK='false'
 B_SHOW_BASIC_OPTICAL='false'
+B_SHOW_BATTERY='false'
+B_SHOW_BATTERY_FORCED='false'
 B_SHOW_CPU='false'
 B_SHOW_DISPLAY_DATA='false'
 B_SHOW_DISK_TOTAL='false'
@@ -325,6 +351,7 @@ B_SHOW_INFO='false'
 B_SHOW_IP='false'
 B_SHOW_LABELS='false'
 B_SHOW_MACHINE='false'
+B_SHOW_MEMORY='false'
 B_SHOW_NETWORK='false'
 # either -v > 3 or -P will show partitions
 B_SHOW_PARTITIONS='false'
@@ -440,22 +467,23 @@ ALTERNATE_WEATHER_LOCATION='' # weather alternate location
 LOG_FILE="$SCRIPT_DATA_DIR/inxi.log"
 LOG_FILE_1="$SCRIPT_DATA_DIR/inxi.1.log"
 LOG_FILE_2="$SCRIPT_DATA_DIR/inxi.2.log"
-MAN_FILE_DOWNLOAD='http://inxi.googlecode.com/svn/trunk/inxi.1.gz'
+MAN_FILE_DOWNLOAD='https://github.com/smxi/inxi/raw/master/inxi.1.gz'
 MAN_FILE_LOCATION='/usr/share/man/man1'
 SCRIPT_NAME='inxi'
 SCRIPT_PATCH_NUMBER=''
 SCRIPT_PATH='' #filled-in in Main
 SCRIPT_VERSION_NUMBER=""       #filled-in in Main
-SCRIPT_DOWNLOAD='http://inxi.googlecode.com/svn/trunk/'
-SCRIPT_DOWNLOAD_BRANCH_1='http://inxi.googlecode.com/svn/branches/one/'
-SCRIPT_DOWNLOAD_BRANCH_2='http://inxi.googlecode.com/svn/branches/two/'
-SCRIPT_DOWNLOAD_BRANCH_3='http://inxi.googlecode.com/svn/branches/three/'
-SCRIPT_DOWNLOAD_BRANCH_4='http://inxi.googlecode.com/svn/branches/four/'
-SCRIPT_DOWNLOAD_BRANCH_BSD='http://inxi.googlecode.com/svn/branches/bsd/'
-SCRIPT_DOWNLOAD_BRANCH_GNUBSD='http://inxi.googlecode.com/svn/branches/gnubsd/'
+SCRIPT_DOWNLOAD='https://github.com/smxi/inxi/raw/master/'
+SCRIPT_DOWNLOAD_BRANCH_1='https://github.com/smxi/inxi/raw/one/'
+SCRIPT_DOWNLOAD_BRANCH_2='https://github.com/smxi/inxi/raw/two/'
+SCRIPT_DOWNLOAD_BRANCH_3='https://github.com/smxi/inxi/raw/three/'
+SCRIPT_DOWNLOAD_BRANCH_4='https://github.com/smxi/inxi/raw/four/'
+SCRIPT_DOWNLOAD_BRANCH_BSD='https://github.com/smxi/inxi/raw/bsd/'
+SCRIPT_DOWNLOAD_BRANCH_GNUBSD='https://github.com/smxi/inxi/raw/gnubsd/'
 SCRIPT_DOWNLOAD_DEV='http://smxi.org/test/'
 # note, you can use any ip url here as long as it's the only line on the output page.
-# Also the ip address must be the last thing on that line.
+# Also the ip address must be the last thing on that line. If you abuse this ip tool 
+# you will be banned from further access. Most > 24x daily automated queries to it are abuse.
 WAN_IP_URL='http://smxi.org/opt/ip.php'
 KONVI_CFG="konversation/scripts/$SCRIPT_NAME.conf" # relative path to $(kde-config --path data)
 
@@ -469,6 +497,8 @@ DEV_DISK_LABEL=''
 DEV_DISK_MAPPER=''
 DEV_DISK_UUID=''
 DMIDECODE_DATA=''
+DNSTOOL=''
+DOWNLOADER='wget'
 IRC_CLIENT=''
 IRC_CLIENT_VERSION=''
 PS_THROTTLED=''
@@ -483,6 +513,8 @@ SEP2=' '
 SEP3_IRC=''
 SEP3_CONSOLE=':'
 SEP3='' # do not set, will be set dynamically
+LINE1='---------------------------------------------------------------------------'
+LINE2='- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'
 
 # Default indentation level. NOTE: actual indent is 1 greater to allow for spacing
 INDENT=10
@@ -491,22 +523,10 @@ INDENT=10
 COLS_INNER='' ## for width minus INDENT
 COLS_MAX=''
 
+# these will be set dynamically in main()
 TERM_COLUMNS=80
 TERM_LINES=100
 
-## sometimes will trigger an error (mageia) if not in shell
-if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
-       if [[ -n $( type -p tput ) ]];then
-               TERM_COLUMNS=$(tput cols)
-               TERM_LINES=$(tput lines)
-       fi
-       # double check, just in case it's missing functionality or whatever
-       if [[ -n ${TERM_COLUMNS##[0-9]*} ]];then
-               TERM_COLUMNS=80
-               TERM_LINES=100
-       fi
-fi
-
 # Only for legacy user config files se we can test and convert the var name
 LINE_MAX_CONSOLE=''
 LINE_MAX_IRC=''
@@ -523,6 +543,7 @@ C2=''
 CN=''
 ## Always leave these blank, these are only going to be set in inxi.conf files, that makes testing
 ## for user changes easier after sourcing the files
+ESC='\x1b'
 GLOBAL_COLOR_SCHEME=''
 IRC_COLOR_SCHEME=''
 IRC_CONS_COLOR_SCHEME=''
@@ -585,8 +606,21 @@ MAGENTA,YELLOW,NORMAL
 RED,CYAN,NORMAL
 RED,WHITE,NORMAL 
 BLUE,WHITE,NORMAL
+
+RED,BLUE,NORMAL 
+RED,DBLUE,NORMAL
+BLACK,BLUE,NORMAL
+BLACK,DBLUE,NORMAL
+NORMAL,BLUE,NORMAL
+BLUE,MAGENTA,NORMAL
+DBLUE,MAGENTA,NORMAL
+BLACK,MAGENTA,NORMAL
+MAGENTA,BLUE,NORMAL
+MAGENTA,DBLUE,NORMAL
 )
 
+#echo ${#A_COLOR_SCHEMES[@]};exit
+
 # WARNING: In the main part below (search for 'KONVI')
 # there's a check for Konversation-specific config files.
 # Any one of these can override the above if inxi is run
@@ -595,14 +629,14 @@ BLUE,WHITE,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 sabayon-release siduction-version sidux-version solusos-release turbolinux-release zenwalk-version"
+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"
 # debian_version excluded from DISTROS_PRIMARY so Debian can fall through to /etc/issue detection. Same goes for Ubuntu.
-DISTROS_EXCLUDE_LIST="debian_version ubuntu_version"
+DISTROS_EXCLUDE_LIST="debian_version devuan_version ubuntu_version"
 DISTROS_PRIMARY="arch-release gentoo-release redhat-release slackware-version SuSE-release"
 DISTROS_LSB_GOOD="mandrake-release mandriva-release mandrakelinux-release"
 # this is being used both by core distros and derived distros now, eg, solusos 1 uses it for solusos id, while
 # debian, solusos base, uses it as well, so we have to know which it is.
-DISTROS_OS_RELEASE_GOOD="arch-release SuSE-release"
+DISTROS_OS_RELEASE_GOOD="arch-release SuSE-release "
 ## Distros with known problems
 # DSL (Bash 2.05b: grep -m doesn't work; arrays won't work) --> unusable output
 # Puppy Linux 4.1.2 (Bash 3.0: arrays won't work) --> works partially
@@ -610,10 +644,15 @@ DISTROS_OS_RELEASE_GOOD="arch-release SuSE-release"
 ## OUTPUT FILTERS/SEARCH ##
 # Note that \<ltd\> bans only words, not parts of strings; in \<corp\> you can't use punctuation characters like . or ,
 # we're saving about 10+% of the total script exec time by hand building the ban lists here, using hard quotes.
-BAN_LIST_NORMAL='chipset|components|computing|computer|corporation|communications|electronics|electrical|electric|gmbh|group|industrial|international|revision|semiconductor|software|technologies|technology|ltd\.|\<ltd\>|inc\.|\<inc\>|intl\.|co\.|\<co\>|corp\.|\<corp\>|\(tm\)|\(r\)|®|\(rev ..\)'
-BAN_LIST_CPU='@|cpu deca|dual core|dual-core|tri core|tri-core|quad core|quad-core|ennea|genuine|hepta|hexa|multi|octa|penta|processor|single|triple|[0-9\.]+ *[MmGg][Hh][Zz]'
 
-SENSORS_GPU_SEARCH='intel|radeon|nouveau'
+BAN_LIST_NORMAL='chipset|components|computing|computer|corporation|communications|electronics|electrical|electric|gmbh|group|incorporation|industrial|international|nee|revision|semiconductor|software|technologies|technology|ltd\.|\<ltd\>|inc\.|\<inc\>|intl\.|co\.|\<co\>|corp\.|\<corp\>|\(tm\)|\(r\)|®|\(rev ..\)'
+BAN_LIST_CPU='@||cpu |cpu deca|dual core|dual-core|tri core|tri-core|quad core|quad-core|ennea|genuine|hepta|hexa|multi|octa|penta|processor|single|triple|[0-9\.]+ *[MmGg][Hh][Zz]'
+# See github issue 75 for more details on value: *, triggers weird behaviors if present in value
+# /sys/devices/virtual/dmi/id/product_name:['*']
+# this is for bash arrays AND avoiding * in arrays: ( fred * greg ) expands to the contents of the directory
+BAN_LIST_ARRAY=',|\*'
+
+SENSORS_GPU_SEARCH='amdgpu|intel|radeon|nouveau'
 
 ### USB networking search string data, because some brands can have other products than
 ### wifi/nic cards, they need further identifiers, with wildcards.
@@ -631,7 +670,7 @@ main()
 {
        eval $LOGFS
        
-       local color_scheme=''
+       local color_scheme='' kde_config_app=''
        # this will be used by all functions following
        local Ps_aux_Data="$( ps aux )"
 
@@ -647,35 +686,11 @@ main()
        if [[ -s $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf ]];then
                source $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf
        fi
-       # Convert to new variable names if set in config files, legacy test
-       if [[ -n $LINE_MAX_CONSOLE ]];then
-               COLS_MAX_CONSOLE=$LINE_MAX_CONSOLE
-       fi
-       if [[ -n $LINE_MAX_IRC ]];then
-               COLS_MAX_IRC=$LINE_MAX_IRC
-       fi
-       # TERM_COLUMNS is set in top globals, using tput cols
-       if [[ $TERM_COLUMNS -lt $COLS_MAX_CONSOLE ]];then
-               COLS_MAX_CONSOLE=$TERM_COLUMNS
-       fi
-       # adjust, some terminals will wrap if output cols == term cols
-       COLS_MAX_CONSOLE=$(( $COLS_MAX_CONSOLE - 2 ))
-       
-       # comes after source for user set stuff
-       if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
-               COLS_MAX=$COLS_MAX_CONSOLE
-               SEP3=$SEP3_CONSOLE
-       else
-               # too hard to read if no colors, so force that for users on irc
-               if [[ $SCHEME == 0 ]];then
-                       SEP3=$SEP3_CONSOLE
-               else
-                       SEP3=$SEP3_IRC
-               fi
-               COLS_MAX=$COLS_MAX_IRC
-       fi
+       set_display_width 'live' # can be reset with -y
        
-       COLS_INNER=$(( $COLS_MAX - $INDENT - 1 ))
+       # echo SCHEME $SCHEME
+       # echo B_IRC $B_IRC
+       # echo sep3: $SEP3
        # Check for dependencies BEFORE running ANYTHING else except above functions
        # Not all distro's have these depends installed by default. Don't want to run
        # this if the user is requesting to see this information in the first place
@@ -698,7 +713,7 @@ main()
 
        # note: this only works if it's run from inside konversation as a script builtin or something
        # only do this if inxi has been started as a konversation script, otherwise bypass this 
-#      KONVI=3 ## for testing puroses
+       #       KONVI=3 ## for testing puroses
        if [[ $KONVI -eq 1 || $KONVI -eq 3 ]];then
                if [[ $KONVI -eq 1 ]]; then ## dcop Konversation (ie 1.x < 1.2(qt3))    
                        DCPORT="$1"
@@ -710,18 +725,28 @@ main()
                        DCTARGET="$2" ##dbus testing
                        shift 2
                fi
-
+               # always have the current stable kde version tested first, 
+               # then use fallbacks and future proofing
+               if type -p kde4-config &>/dev/null;then
+                       kde_config_app='kde4-config'
+               elif type -p kde5-config &>/dev/null;then
+                       kde_config_app='kde5-config'
+               elif type -p kde-config &>/dev/null;then
+                       kde_config_app='kde-config'
+               fi
                # The section below is on request of Argonel from the Konversation developer team:
                # it sources config files like $HOME/.kde/share/apps/konversation/scripts/inxi.conf
-               IFS=":"
-               for kde_config in $( kde-config --path data )
-               do
-                       if [[ -r ${kde_config}${KONVI_CFG} ]];then
-                               source "${kde_config}${KONVI_CFG}"
-                               break
-                       fi
-               done
-               IFS="$ORIGINAL_IFS"
+               if [[ -n $kde_config_app ]];then
+                       IFS=":"
+                       for kde_config in $( $kde_config_app --path data )
+                       do
+                               if [[ -r $kde_config$KONVI_CFG ]];then
+                                       source "$kde_config$KONVI_CFG"
+                                       break
+                               fi
+                       done
+                       IFS="$ORIGINAL_IFS"
+               fi
        fi
 
        ## leave this for debugging dcop stuff if we get that working
@@ -749,7 +774,7 @@ main()
                        if [[ -n $GLOBAL_COLOR_SCHEME ]];then
                                color_scheme=$GLOBAL_COLOR_SCHEME
                        else
-                               if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
+                               if [[ $B_IRC == 'false' ]];then
                                        if [[ -n $CONSOLE_COLOR_SCHEME && -z $DISPLAY ]];then
                                                color_scheme=$CONSOLE_COLOR_SCHEME
                                        elif [[ -n $VIRT_TERM_COLOR_SCHEME ]];then
@@ -768,6 +793,16 @@ main()
                        set_color_scheme $color_scheme
                fi
        fi
+       if [[ $B_IRC == 'false' ]];then
+               SEP3=$SEP3_CONSOLE
+       else
+               # too hard to read if no colors, so force that for users on irc
+               if [[ $SCHEME == 0 ]];then
+                       SEP3=$SEP3_CONSOLE
+               else
+                       SEP3=$SEP3_IRC
+               fi
+       fi
        
        # all the pre-start stuff is in place now
        B_SCRIPT_UP='true'
@@ -776,10 +811,6 @@ main()
        # then create the output
        print_it_out
 
-       ## last steps
-       if [[ $B_RUNNING_IN_SHELL == 'true' && $SCHEME -gt 0 ]];then
-               echo -n "\e[0m"
-       fi
        eval $LOGFE
        # weechat's executor plugin forced me to do this, and rightfully so, because else the exit code
        # from the last command is taken..
@@ -799,16 +830,21 @@ initialize_data()
 {
        eval $LOGFS
        BSD_VERSION=$( uname -s 2>/dev/null | tr '[A-Z]' '[a-z]' )
-       
        # note: archbsd says they are a freebsd distro, so assuming it's the same as freebsd
-       if [[ -n $( grep 'bsd' <<< "$BSD_VERSION" ) ]];then
+       if [[ -z ${BSD_VERSION/*bsd*/} || -z ${BSD_VERSION/*dragonfly*/} || -z ${BSD_VERSION/*darwin*/} ]];then
+               if [[ -z ${BSD_VERSION/*openbsd*/} ]];then
+                       BSD_VERSION='openbsd'
+               elif [[ -z ${BSD_VERSION/*darwin*/} ]];then
+                       BSD_VERSION='darwin'
+               fi
                # GNU/kfreebsd will by definition have GNU tools like sed/grep
-               if [[ -n $( grep 'kfreebsd' <<< "$BSD_VERSION" ) ]];then
+               if [[ -z ${BSD_VERSION/*kfreebsd*/} ]];then
                        BSD_TYPE='debian-bsd' # debian gnu bsd
                else
                        BSD_TYPE='bsd' # all other bsds
                        SED_I="-i ''"
                        SED_RX='-E'
+                       ESC=$(echo | tr '\n' '\033')
                fi
        fi
        # now set the script BOOLEANS for files required to run features
@@ -823,64 +859,69 @@ initialize_data()
        
        initialize_paths
        
+       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'
+               elif type -p curl &>/dev/null;then
+                       DOWNLOADER='curl'
+               elif [[ $BSD_VERSION == 'openbsd' && -n $( type -p ftp ) ]];then
+                       DOWNLOADER='ftp'
+               else
+                       DOWNLOADER='no-downloader'
+               fi
+       fi
+       
        if [[ -n $BSD_TYPE ]];then
                if [[ -e $FILE_DMESG_BOOT ]];then
                        B_DMESG_BOOT_FILE='true'
                fi
        else
                # found a case of battery existing but having nothing in it on desktop mobo
-               # not all laptops show the first
-               if [[ -n $( ls /proc/acpi/battery 2>/dev/null ) ]];then
+               # not all laptops show the first. /proc/acpi/battery is deprecated.
+               if [[ -n $( ls /proc/acpi/battery 2>/dev/null ) || -n $( ls /sys/class/power_supply/ 2>/dev/null )  ]];then
                        B_PORTABLE='true'
                fi
        fi
-       
-       
        if [[ -e $FILE_CPUINFO ]]; then
                B_CPUINFO_FILE='true'
        fi
-
        if [[ -e $FILE_MEMINFO ]];then
                B_MEMINFO_FILE='true'
        fi
-
        if [[ -e $FILE_ASOUND_DEVICE ]];then
                B_ASOUND_DEVICE_FILE='true'
        fi
-
        if [[ -e $FILE_ASOUND_VERSION ]];then
                B_ASOUND_VERSION_FILE='true'
        fi
-
        if [[ -f $FILE_LSB_RELEASE ]];then
                B_LSB_FILE='true'
        fi
-       
        if [[ -f $FILE_OS_RELEASE ]];then
                B_OS_RELEASE_FILE='true'
        fi
-
        if [[ -e $FILE_SCSI ]];then
                B_SCSI_FILE='true'
        fi
-
        if [[ -n $DISPLAY ]];then
                B_SHOW_DISPLAY_DATA='true'
                B_RUNNING_IN_DISPLAY='true'
        fi
-       
        if [[ -e $FILE_MDSTAT ]];then
                B_MDSTAT_FILE='true'
        fi
-
        if [[ -e $FILE_MODULES ]];then
                B_MODULES_FILE='true'
        fi
-
        if [[ -e $FILE_MOUNTS ]];then
                B_MOUNTS_FILE='true'
        fi
-
        if [[ -e $FILE_PARTITIONS ]];then
                B_PARTITIONS_FILE='true'
        fi
@@ -889,7 +930,7 @@ initialize_data()
                B_XORG_LOG='true'
        else
                # Detect location of the Xorg log file
-               if [[ -n $( type -p xset ) ]]; then
+               if type -p xset &>/dev/null; then
                        FILE_XORG_LOG=$( xset q 2>/dev/null | grep -i 'Log file' | gawk '{print $3}')
                        if [[ -e $FILE_XORG_LOG ]];then
                                B_XORG_LOG='true'
@@ -903,6 +944,56 @@ initialize_data()
        eval $LOGFE
 }
 
+# args: $1 - default OR override default cols max integer count
+set_display_width()
+{
+       local cols_max_override=$1
+       
+       if [[ $cols_max_override == 'live' ]];then
+               ## sometimes tput will trigger an error (mageia) if irc client
+               if [[ $B_IRC == 'false' ]];then
+                       if type -p tput &>/dev/null;then
+                               TERM_COLUMNS=$(tput cols)
+                               TERM_LINES=$(tput lines)
+                       fi
+                       # double check, just in case it's missing functionality or whatever
+                       if [[ -z $TERM_COLUMNS || -n ${TERM_COLUMNS//[0-9]/} ]];then
+                               TERM_COLUMNS=80
+                               TERM_LINES=100
+                       fi
+               fi
+               # Convert to new variable names if set in config files, legacy test
+               if [[ -n $LINE_MAX_CONSOLE ]];then
+                       COLS_MAX_CONSOLE=$LINE_MAX_CONSOLE
+               fi
+               if [[ -n $LINE_MAX_IRC ]];then
+                       COLS_MAX_IRC=$LINE_MAX_IRC
+               fi
+               # this lets you set different widths for in or out of display server
+       #       if [[ $B_RUNNING_IN_DISPLAY == 'false' && -n $COLS_MAX_NO_DISPLAY ]];then
+       #               COLS_MAX_CONSOLE=$COLS_MAX_NO_DISPLAY
+       #       fi
+               # TERM_COLUMNS is set in top globals, using tput cols
+               # echo tc: $TERM_COLUMNS cmc: $COLS_MAX_CONSOLE
+               if [[ $TERM_COLUMNS -lt $COLS_MAX_CONSOLE ]];then
+                       COLS_MAX_CONSOLE=$TERM_COLUMNS
+               fi
+               # adjust, some terminals will wrap if output cols == term cols
+               COLS_MAX_CONSOLE=$(( $COLS_MAX_CONSOLE - 2 ))
+               # echo cmc: $COLS_MAX_CONSOLE
+               # comes after source for user set stuff
+               if [[ $B_IRC == 'false' ]];then
+                       COLS_MAX=$COLS_MAX_CONSOLE
+               else
+                       COLS_MAX=$COLS_MAX_IRC
+               fi
+       else
+               COLS_MAX=$cols_max_override
+       fi
+       COLS_INNER=$(( $COLS_MAX - $INDENT - 1 ))
+       # echo cm: $COLS_MAX ci: $COLS_INNER
+}
+
 # arg: $1 - version number: main/patch/date
 parse_version_data()
 {
@@ -911,22 +1002,22 @@ parse_version_data()
        # note, using ####[[:space:]]+ to avoid having this function also trip the version datas
        case $1 in
                date)
-                       version_data="$( gawk -F ': ' '
+                       version_data=$( gawk -F ': ' '
                        /####[[:space:]]+Date:/ {
                                print $NF
-                       }' $SCRIPT_PATH/$SCRIPT_NAME )"
+                       }' "$SCRIPT_PATH/$SCRIPT_NAME" )
                        ;;
                main)
-                       version_data="$( gawk '
+                       version_data=$( gawk '
                        /####[[:space:]]+Version:/ {
                                print $3
-                       }' $SCRIPT_PATH/$SCRIPT_NAME )"
+                       }' "$SCRIPT_PATH/$SCRIPT_NAME" )
                        ;;
                patch)
-                       version_data="$( gawk '
+                       version_data=$( gawk '
                        /####[[:space:]]+Patch Number:/ {
                                print $4
-                       }' $SCRIPT_PATH/$SCRIPT_NAME )"
+                       }' "$SCRIPT_PATH/$SCRIPT_NAME" )
                        ;;
        esac
        echo $version_data
@@ -936,10 +1027,10 @@ initialize_paths()
 {
        local path='' added_path='' b_path_found='' sys_path=''
        # Extra path variable to make execute failures less likely, merged below
-       local extra_paths="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
+       local extra_paths="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/local/bin"
        
        # this needs to be set here because various options call the parent initialize function directly.
-       SCRIPT_PATH=$( dirname $0 )
+       SCRIPT_PATH=$( dirname "$0" )
 
        # Fallback paths put into $extra_paths; This might, among others, help on gentoo.
        # Now, create a difference of $PATH and $extra_paths and add that to $PATH:
@@ -959,11 +1050,10 @@ initialize_paths()
        done
 
        IFS="$ORIGINAL_IFS"
-       PATH="${PATH}${added_path}"
-       ##echo "PATH='$PATH'"
+       PATH="$PATH$added_path"
+       # echo "PATH='$PATH'"
        ##/bin/sh -c 'echo "PATH in subshell=\"$PATH\""'
 }
-
 # No args taken.
 check_recommended_apps()
 {
@@ -982,22 +1072,22 @@ check_recommended_apps()
                script_debugger "Suggestion: update to Bash v3.1 for optimal inxi output"
        fi
        # test for a few apps that bsds may not have after initial tests
-       if [[ -n $( type -p lspci ) ]];then
+       if type -p lspci &>/dev/null;then
                B_LSPCI='true'
        fi
        if [[ -n $BSD_TYPE ]];then
-               if [[ -n $( type -p sysctl ) ]];then
+               if type -p sysctl &>/dev/null;then
                        B_SYSCTL='true'
                fi
-               if [[ -n $( type -p pciconf ) ]];then
+               if type -p pciconf &>/dev/null;then
                        B_PCICONF='true'
                fi
        fi
        # now setting qdbus/dcop for first run, some systems can have both by the way
-       if [[ -n $( type -p qdbus ) ]];then
+       if type -p qdbus &>/dev/null;then
                B_QDBUS='true'
        fi
-       if [[ -n $( type -p dcop ) ]];then
+       if type -p dcop &>/dev/null;then
                B_DCOP='true'
        fi
        eval $LOGFE
@@ -1008,9 +1098,9 @@ check_recommended_apps()
 check_required_apps()
 {
        eval $LOGFS
-       local app_name='' app_path=''
+       local app_name=''
        # bc removed from deps for now
-       local depends="df gawk grep ps readlink tr uname uptime wc"
+       local depends="df gawk grep ps readlink tr uname wc"
        
        if [[ -z $BSD_TYPE  ]];then
                depends="$depends lspci"
@@ -1027,8 +1117,7 @@ check_required_apps()
        if [[ $B_RUNNING_IN_DISPLAY == 'true' ]];then
                for app_name in $x_apps
                do
-                       app_path=$( type -p $app_name )
-                       if [[ -z $app_path ]];then
+                       if ! type -p $app_name &>/dev/null;then
                                script_debugger "Resuming in non X mode: $app_name not found. For package install advice run: $SCRIPT_NAME --recommends"
                                B_SHOW_DISPLAY_DATA='false'
                                break
@@ -1040,8 +1129,7 @@ check_required_apps()
 
        for app_name in $depends
        do
-               app_path=$( type -p $app_name )
-               if [[ -z $app_path ]];then
+               if ! type -p $app_name &>/dev/null;then
                        error_handler 5 "$app_name"
                fi
        done
@@ -1084,7 +1172,7 @@ set_color_scheme()
        fi
        # Set a global variable to allow checking for chosen scheme later
        SCHEME="$1"
-       if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
+       if [[ $B_IRC == 'false' ]];then
                a_color_codes=( $ANSI_COLORS )
        else
                a_color_codes=( $IRC_COLORS )
@@ -1101,6 +1189,11 @@ set_color_scheme()
        C2="${!a_output_colors[1]}"
        CN="${!a_output_colors[2]}"
        # ((COLOR_SCHEME++)) ## note: why is this? ##
+       # handle some explicit colors that are used for no color 0
+       if [[ $SCHEME -eq 0 ]];then
+               NORMAL=''
+               RED=''
+       fi
        eval $LOGFE
 }
 
@@ -1133,23 +1226,22 @@ select_default_color_scheme()
        fi
        
        # don't want these printing in irc since they show literally
-       if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
+       if [[ $B_IRC == 'true' ]];then
                irc_clear=''
        fi
        # first make output neutral so it's just plain default for console client
        set_color_scheme "0"
-       if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
-               print_screen_output "Welcome to $SCRIPT_NAME! Please select the default $COLOR_SELECTION color scheme."
+       # print_lines_basic "0" "" ""
+       if [[ $B_IRC == 'false' ]];then
+               print_lines_basic "0" "" "Welcome to $SCRIPT_NAME! Please select the default $COLOR_SELECTION color scheme."
                # print_screen_output "You will see this message only one time per user account, unless you set preferences in: /etc/$SCRIPT_NAME.conf"
                print_screen_output " "
        fi
-       print_screen_output "Because there is no way to know your $COLOR_SELECTION foreground/background colors, you can"
-       print_screen_output "set your color preferences from color scheme option list below. 0 is no colors, 1 neutral."
-       print_screen_output "After these, there are 3 sets: 1-dark or light backgrounds; 2-light backgrounds; 3-dark backgrounds."
-       if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
-               print_screen_output "Please note that this will set the $COLOR_SELECTION preferences only for user: $(whoami)"
+       print_lines_basic "0" "" "Because there is no way to know your $COLOR_SELECTION foreground/background colors, you can set your color preferences from color scheme option list below. 0 is no colors, 1 neutral. After these, there are 4 sets: 1-dark or light backgrounds; 2-light backgrounds; 3-dark backgrounds; 4-miscellaneous."
+       if [[ $B_IRC == 'false' ]];then
+               print_lines_basic "0" "" "Please note that this will set the $COLOR_SELECTION preferences only for user: $(whoami)"
        fi
-       print_screen_output "------------------------------------------------------------------------------"
+       print_screen_output "$LINE1"
        for (( i=0; i < ${#A_COLOR_SCHEMES[@]}; i++ ))
        do
                if [[ $i -gt 9 ]];then
@@ -1168,21 +1260,21 @@ select_default_color_scheme()
        done
        set_color_scheme 0
        
-       if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
+       if [[ $B_IRC == 'false' ]];then
                echo -n "\e[0m"
+               
                print_screen_output "$irc_clear $i)${spacer}Remove all color settings. Restore $SCRIPT_NAME default."
                print_screen_output "$irc_clear $(($i+1)))${spacer}Continue, no changes or config file setting."
                print_screen_output "$irc_clear $(($i+2)))${spacer}Exit, use another terminal, or set manually."
-               print_screen_output "------------------------------------------------------------------------------"
-               print_screen_output "Simply type the number for the color scheme that looks best to your eyes for your $COLOR_SELECTION settings"
-               print_screen_output "and hit ENTER. NOTE: You can bring this option list up by starting $SCRIPT_NAME with option: -c plus one of these numbers:"
-               print_screen_output "94 (console, no X - $console); 95 (terminal, X - $virt_term); 96 (irc, gui, X - $irc_gui);"
-               print_screen_output "97 (irc, X, in terminal - $irc_x_term); 98 (irc, no X - $irc_console); 99 (global - $global)"
+               print_screen_output "$LINE1"
+               print_lines_basic "0" "" "Simply type the number for the color scheme that looks best to your eyes for your $COLOR_SELECTION settings and hit ENTER. NOTE: You can bring this option list up by starting $SCRIPT_NAME with option: -c plus one of these numbers:"
+               print_lines_basic "0" "" "94^(console,^no X^-^$console); 95^(terminal,^X^-^$virt_term); 96^(irc,^gui,^X^-^$irc_gui); 97^(irc,^X,^in^terminal^-^$irc_x_term); 98^(irc,^no^X^-^$irc_console); 99^(global^-^$global)"
+               print_lines_basic "0" "" ""
                print_screen_output "Your selection(s) will be stored here: $config_file"
-               print_screen_output "Global overrides all individual color schemes. Individual schemes remove the global setting."
-               print_screen_output "------------------------------------------------------------------------------"
+               print_lines_basic "0" "" "Global overrides all individual color schemes. Individual schemes remove the global setting."
+               print_screen_output "$LINE1"
                read user_selection
-               if [[ -n $( grep -Es '^([0-9]+)$' <<< "$user_selection" ) && $user_selection -lt $i ]];then
+               if [[ "$user_selection" =~ ^([0-9]+)$ && $user_selection -lt $i ]];then
                        case $COLOR_SELECTION in
                                irc)
                                        config_variable='IRC_COLOR_SCHEME'
@@ -1212,7 +1304,7 @@ select_default_color_scheme()
                                touch $config_file
                        fi
                        if [[ -z $( grep -s "$config_variable=" $config_file ) ]];then
-                               print_screen_output "Creating and updating config file for $COLOR_SELECTION color scheme now..."
+                               print_lines_basic "0" "" "Creating and updating config file for $COLOR_SELECTION color scheme now..."
                                echo "$config_variable=$user_selection" >> $config_file
                        else
                                print_screen_output "Updating config file for $COLOR_SELECTION color scheme now..."
@@ -1234,7 +1326,7 @@ select_default_color_scheme()
                        -e '/IRC_COLOR_SCHEME=/d' -e '/IRC_CONS_COLOR_SCHEME=/d' -e '/IRC_X_TERM_COLOR_SCHEME=/d' $config_file
                        set_color_scheme $DEFAULT_COLOR_SCHEME
                elif [[ $user_selection == $(( $i+1 )) ]];then
-                       print_screen_output "Ok, continuing $SCRIPT_NAME unchanged. You can set the colors anytime by starting with: -c 95 to 99"
+                       print_lines_basic "0" "" "Ok, continuing $SCRIPT_NAME unchanged. You can set the colors anytime by starting with: -c 95 to 99"
                        if [[ -n $CONSOLE_COLOR_SCHEME && -z $DISPLAY ]];then
                                set_color_scheme $CONSOLE_COLOR_SCHEME
                        elif [[ -n $VIRT_TERM_COLOR_SCHEME ]];then
@@ -1252,9 +1344,8 @@ select_default_color_scheme()
                        select_default_color_scheme
                fi
        else
-               print_screen_output "------------------------------------------------------------------------------"
-               print_screen_output "After finding the scheme number you like, simply run this again in a terminal to set the configuration"
-               print_screen_output "data file for your irc client. You can set color schemes for the following: start inxi with -c plus:"
+               print_screen_output "$LINE1"
+               print_lines_basic "0" "" "After finding the scheme number you like, simply run this again in a terminal to set the configuration data file for your irc client. You can set color schemes for the following: start inxi with -c plus:"
                print_screen_output "94 (console, no X - $console); 95 (terminal, X - $virt_term); 96 (irc, gui, X - $irc_gui);"
                print_screen_output "97 (irc, X, in terminal - $irc_x_term); 98 (irc, no X - $irc_console); 99 (global - $global)"
                exit 0
@@ -1292,7 +1383,7 @@ error_handler()
                        ;;
                7)      error_message="One of the options you entered in your script parameters: $2\nis not supported.The option may require extra arguments to work.\nFor supported options (and their arguments), check the help menu: $SCRIPT_NAME -h"
                        ;;
-               8)      error_message="the self-updater failed, wget exited with error: $2.\nYou probably need to be root.\nHint, to make for easy updates without being root, do: chown <user name> $SCRIPT_PATH/$SCRIPT_NAME"
+               8)      error_message="the self-updater failed, $DOWNLOADER exited with error: $2.\nYou probably need to be root.\nHint, to make for easy updates without being root, do: chown <user name> $SCRIPT_PATH/$SCRIPT_NAME"
                        ;;
                9)      error_message="unsupported debugging level: $2"
                        ;;
@@ -1303,7 +1394,7 @@ error_handler()
                        error_message="unsupported testing option argument: -! $2"
                        ;;
                12)
-                       error_message="the svn branch download url: $2\nappears to be empty currently. Make sure there is an actual svn branch version\nactive before you try this again. Check http://code.google.com/p/inxi\nto verify the branch status."
+                       error_message="the git branch download url: $2\nappears to be empty currently. Make sure there is an actual svn branch version\nactive before you try this again. Check https://github.com/smxi/inxi\nto verify the branch status."
                        ;;
                13)
                        error_message="The -t option requires the following extra arguments (no spaces between letters/numbers):\nc m cm [required], for example: -t cm8 OR -t cm OR -t c9\n(numbers: 1-20, > 5 throttled to 5 in irc clients) You entered: $2"
@@ -1329,6 +1420,9 @@ error_handler()
                20)
                        error_message="The option you selected has been deprecated. $2\nSee the -h (help) menu for currently supported options."
                        ;;
+               21)
+                       error_message="Width option requires an integer value of 80 or more.\nYou entered: $2"
+                       ;;
                *)      error_message="error unknown: $@"
                        set -- 99
                        ;;
@@ -1397,7 +1491,10 @@ log_function_data()
                                ;;
                        cat)
                                if [[ $B_LOG_FULL_DATA == 'true' ]];then
-                                       logged_data="\n$line\nFull file data: cat $2\n\n$( cat $2 )\n$line\n"
+                                       for cat_file in $2
+                                       do
+                                               logged_data="$logged_data\n$line\nFull file data: cat $cat_file\n\n$( cat $cat_file )\n$line\n"
+                                       done
                                        spacer=''
                                fi
                                ;;
@@ -1454,10 +1551,10 @@ create_rotate_logfiles()
 script_self_updater()
 {
        eval $LOGFS
-       local wget_error=0 file_contents='' wget_man_error=0 
+       local downloader_error=0 file_contents='' downloader_man_error=0 
        local man_file_path="$MAN_FILE_LOCATION/inxi.1.gz"
        
-       if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
+       if [[ $B_IRC == 'true' ]];then
                print_screen_output "Sorry, you can't run the $SCRIPT_NAME self updater option (-$3) in an IRC client."
                exit 1
        fi
@@ -1466,10 +1563,26 @@ script_self_updater()
        print_screen_output "Currently running $SCRIPT_NAME version number: $SCRIPT_VERSION_NUMBER"
        print_screen_output "Current version patch number: $SCRIPT_PATCH_NUMBER"
        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=$?
+                       ;;
+               fetch)
+                       file_contents="$( fetch -q -o - $1$SCRIPT_NAME )" || downloader_error=$?
+                       ;;
+               ftp)
+                       file_contents="$( ftp -o - $1$SCRIPT_NAME 2>/dev/null )" || downloader_error=$?
+                       ;;
+               wget)
+                       file_contents="$( wget -q -O - $1$SCRIPT_NAME )" || downloader_error=$?
+                       ;;
+               no-downloader)
+                       downloader_error=1
+                       ;;
+       esac
 
-       file_contents="$( wget -q -O - $1$SCRIPT_NAME )" || wget_error=$?
        # then do the actual download
-       if [[  $wget_error -eq 0 ]];then
+       if [[  $downloader_error -eq 0 ]];then
                # make sure the whole file got downloaded and is in the variable
                if [[ -n $( grep '###\*\*EOF\*\*###' <<< "$file_contents" ) ]];then
                        echo "$file_contents" > $SCRIPT_PATH/$SCRIPT_NAME || error_handler 14 "$?"
@@ -1489,18 +1602,38 @@ script_self_updater()
                                        if [[ -f /usr/share/man/man8/inxi.8.gz ]];then
                                                print_screen_output "Updating man page location to man1."
                                                mv -f /usr/share/man/man8/inxi.8.gz /usr/share/man/man1/inxi.1.gz 
-                                               if [[ -n $( type -p mandb ) ]];then
+                                               if type -p mandb &>/dev/null;then
                                                        exec $( type -p mandb ) -q 
                                                fi
                                        fi
-                                       wget -q --spider $MAN_FILE_DOWNLOAD || wget_man_error=$?
-                                       if [[ $wget_man_error -eq 0 ]];then
-                                               print_screen_output "Man file download URL verified: $MAN_FILE_DOWNLOAD"
+                                       if [[ $DOWNLOADER == 'wget' ]];then
+                                               wget -q --spider $MAN_FILE_DOWNLOAD || downloader_man_error=$?
+                                       fi
+                                       if [[ $downloader_man_error -eq 0 ]];then
+                                               if [[ $DOWNLOADER == 'wget' ]];then
+                                                       print_screen_output "Man file download URL verified: $MAN_FILE_DOWNLOAD"
+                                               fi
                                                print_screen_output "Downloading Man page file now."
-                                               wget -q -O $man_file_path $MAN_FILE_DOWNLOAD || wget_man_error=$?
-                                               if [[ $wget_man_error -gt 0 ]];then
+                                               case $DOWNLOADER in
+                                                       curl)
+                                                               curl -s -o $man_file_path $MAN_FILE_DOWNLOAD || downloader_man_error=$?
+                                                               ;;
+                                                       fetch)
+                                                               fetch -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=$?
+                                                               ;;
+                                                       wget)
+                                                               wget -q -O $man_file_path $MAN_FILE_DOWNLOAD || downloader_man_error=$?
+                                                               ;;
+                                                       no-downloader)
+                                                               downloader_man_error=1
+                                                               ;;
+                                               esac
+                                               if [[ $downloader_man_error -gt 0 ]];then
                                                        print_screen_output "Oh no! Something went wrong downloading the Man gz file at: $MAN_FILE_DOWNLOAD"
-                                                       print_screen_output "Check the error messages for what happened. Error: $wget_man_error"
+                                                       print_screen_output "Check the error messages for what happened. Error: $downloader_man_error"
                                                else
                                                        print_screen_output "Download/install of man page successful. Check to make sure it works: man inxi"
                                                fi
@@ -1519,7 +1652,7 @@ script_self_updater()
        # now run the error handlers on any wget failure
        else
                if [[ $2 == 'svn server' ]];then
-                       error_handler 8 "$wget_error"
+                       error_handler 8 "$downloader_error"
                elif [[ $2 == 'alt server' ]];then
                        error_handler 10 "$1"
                else
@@ -1533,18 +1666,33 @@ script_self_updater()
 debug_data_collector()
 {
        local xiin_app='' xiin_data_file='' xiin_download='' error='' b_run_xiin='false'
-       local debug_data_dir='' bsd_string=''
+       local debug_data_dir='' bsd_string='' xorg_d_files='' xorg_file='' a_distro_ids=''
        local completed_gz_file='' xiin_file='xiin.py' ftp_upload='ftp.techpatterns.com/incoming'
-       local Line='-------------------------'
+       local xiin_url="https://github.com/smxi/inxi/raw/xiin/$xiin_file"
+       local Line='-------------------------' root_string=''
        local start_directory=$( pwd )
+       local host=$( tr '[A-Z]' '[a-z]' <<< "$HOSTNAME" )
+       local downloader_error=0 debug_i=''
        
+       if [[ $B_DEBUG_I == 'true' ]];then
+               debug_i='i'
+       fi
+       
+       if [[ -n $host ]];then
+               host=${host// /-}
+       else
+               host="-no-host"
+       fi
        if [[ -n $BSD_TYPE ]];then
-               bsd_string="$BSD_TYPE-"
+               bsd_string="-$BSD_TYPE-$BSD_VERSION"
+       fi
+       if [[ $( whoami ) == 'root' ]];then
+               root_string='-root'
        fi
        
-       debug_data_dir="inxi-$bsd_string$(tr ' ' '-' <<< $HOSTNAME | tr '[A-Z]' '[a-z]' )-$1-$(date +%Y%m%d)
+       debug_data_dir="inxi$bsd_string-$host-$(date +%Y%m%d-%H%M%S)-$1$root_string
        
-       if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
+       if [[ $B_IRC == 'false' ]];then
                if [[ -n $ALTERNATE_FTP ]];then
                        ftp_upload=$ALTERNATE_FTP
                fi
@@ -1568,29 +1716,150 @@ debug_data_collector()
                echo 'Collecting system info: sensors, lsusb, lspci, lspci -v data, plus /proc data'
                echo 'also checking for dmidecode data: note, you must be root to have dmidecode work.'
                echo "Data going into: $SCRIPT_DATA_DIR/$debug_data_dir"
-               # bsd tools
-               pciconf -vl &> $debug_data_dir/bsd-pciconf-vl.txt
-               sysctl -a &> $debug_data_dir/bsd-sysctl-a.txt
-               
+               # bsd tools http://cb.vu/unixtoolbox.xhtml
+               # freebsd
+               if type -p pciconf &>/dev/null;then
+                       pciconf -l -cv &> $debug_data_dir/bsd-pciconf-cvl.txt
+                       pciconf -vl &> $debug_data_dir/bsd-pciconf-vl.txt
+                       pciconf -l &> $debug_data_dir/bsd-pciconf-l.txt
+               else
+                       touch $debug_data_dir/bsd-pciconf-absent
+               fi
+               # openbsd
+               if type -p pcidump &>/dev/null;then
+                       pcidump &> $debug_data_dir/bsd-pcidump-openbsd.txt
+                       pcidump -v &> $debug_data_dir/bsd-pcidump-v-openbsd.txt
+               else
+                       touch $debug_data_dir/bsd-pcidump-openbsd-absent
+               fi
+               # netbsd
+               if type -p pcictl &>/dev/null;then
+                       pcictl list &> $debug_data_dir/bsd-pcictl-list-netbsd.txt
+                       pcictl list -n &> $debug_data_dir/bsd-pcictl-list-n-netbsd.txt
+               else
+                       touch $debug_data_dir/bsd-pcictl-netbsd-absent
+               fi
+               if type -p sysctl &>/dev/null;then
+                       sysctl -a &> $debug_data_dir/bsd-sysctl-a.txt
+               else
+                       touch $debug_data_dir/bsd-sysctl-absent
+               fi
+               if type -p usbdevs &>/dev/null;then
+                       usbdevs -v  &> $debug_data_dir/bsd-usbdevs-v.txt
+               else
+                       touch $debug_data_dir/bsd-usbdevs-absent
+               fi
+               if type -p kldstat &>/dev/null;then
+                       kldstat  &> $debug_data_dir/bsd-kldstat.txt
+               else
+                       touch $debug_data_dir/bsd-kldstat-absent
+               fi
+               # diskinfo -v <disk>
+               # fdisk <disk>
                dmidecode &> $debug_data_dir/dmidecode.txt
                
+               get_repo_data "$SCRIPT_DATA_DIR/$debug_data_dir"
+               
+               if type -p shopt &>/dev/null;then
+                       shopt -s nullglob
+                       a_distro_ids=(/etc/*[-_]{release,version})
+                       shopt -u nullglob
+                       echo ${a_distro_ids[@]} &> $debug_data_dir/etc-distro-files.txt
+                       for distro_file in ${a_distro_ids[@]} /etc/issue
+                       do
+                               if [[ -f $distro_file ]];then
+                                       cat $distro_file &> $debug_data_dir/distro-file${distro_file//\//-}
+                               fi
+                       done
+               fi
+               dmesg &> $debug_data_dir/dmesg.txt
                lscpu &> $debug_data_dir/lscpu.txt
                lspci &> $debug_data_dir/lspci.txt
+               lspci -k &> $debug_data_dir/lspci-k.txt
+               lspci -knn &> $debug_data_dir/lspci-knn.txt
                lspci -n &> $debug_data_dir/lspci-n.txt
+               lspci -nn &> $debug_data_dir/lspci-nn.txt
+               lspci -mm &> $debug_data_dir/lspci-mm.txt
+               lspci -mmnn &> $debug_data_dir/lspci-mmnn.txt
+               lspci -mmnnv &> $debug_data_dir/lspci-mmnnv.txt
                lspci -v &> $debug_data_dir/lspci-v.txt
                lsusb &> $debug_data_dir/lsusb.txt
+               if type -p hciconfig &>/dev/null;then
+                       hciconfig -a &> $debug_data_dir/hciconfig-a.txt
+               else
+                       touch $debug_data_dir/hciconfig-absent
+               fi
+               ls /sys &> $debug_data_dir/ls-sys.txt
                ps aux &> $debug_data_dir/ps-aux.txt
+               ps -e &> $debug_data_dir/ps-e.txt
+               ps -p 1 &> $debug_data_dir/ps-p-1.txt
+               cat /proc/1/comm &> $debug_data_dir/proc-1-comm.txt
                runlevel &> $debug_data_dir/runlevel.txt
-               systemctl list-units &> $debug_data_dir/systemctl-list-units.txt
-               systemctl list-units --type=target &> $debug_data_dir/systemctl-list-units-target.txt
-               initctl list &> $debug_data_dir/initctl-list.txt
+               if type -p rc-status &>/dev/null;then
+                       rc-status -a &> $debug_data_dir/rc-status-a.txt
+                       rc-status -l &> $debug_data_dir/rc-status-l.txt
+                       rc-status -r &> $debug_data_dir/rc-status-r.txt
+               else
+                       touch $debug_data_dir/rc-status-absent
+               fi
+               if type -p systemctl &>/dev/null;then
+                       systemctl list-units &> $debug_data_dir/systemctl-list-units.txt
+                       systemctl list-units --type=target &> $debug_data_dir/systemctl-list-units-target.txt
+               else
+                       touch $debug_data_dir/systemctl-absent
+               fi
+               if type -p initctl &>/dev/null;then
+                       initctl list &> $debug_data_dir/initctl-list.txt
+               else
+                       touch $debug_data_dir/initctl-absent
+               fi
                sensors &> $debug_data_dir/sensors.txt
-               strings --version  &> $debug_data_dir/strings.txt
-               nvidia-smi -q &> $debug_data_dir/nvidia-smi-q.txt
-               nvidia-smi -q -x &> $debug_data_dir/nvidia-smi-xq.txt
+               if type -p strings &>/dev/null;then
+                       touch $debug_data_dir/strings-present
+               else
+                       touch $debug_data_dir/strings-absent
+               fi
+               local id_dir='/sys/class/power_supply/' 
+               local ids=$( ls $id_dir 2>/dev/null )
+               if [[ -n $ids ]];then
+                       for batid in $ids 
+                       do
+                               cat $id_dir$batid'/uevent' &> $debug_data_dir/sys-power-supply-$batid.txt
+                       done
+               else
+                       touch $debug_data_dir/sys-power-supply-none
+               fi
                
+               # leaving this commented out to remind that some systems do not
+               # support strings --version, but will just simply hang at that command
+               # which you can duplicate by simply typing: strings then hitting enter, you will get hang.
+               # strings --version  &> $debug_data_dir/strings.txt
+               if type -p nvidia-smi &>/dev/null;then
+                       nvidia-smi -q &> $debug_data_dir/nvidia-smi-q.txt
+                       nvidia-smi -q -x &> $debug_data_dir/nvidia-smi-xq.txt
+               else
+                       touch $debug_data_dir/nvidia-smi-absent
+               fi
+               head -n 1 /proc/asound/card*/codec* &> $debug_data_dir/proc-asound-card-codec.txt
+               if [[ -f /proc/version ]];then
+                       cat /proc/version &> $debug_data_dir/proc-version.txt
+               else
+                       touch $debug_data_dir/proc-version-absent
+               fi
+               echo $CC &> $debug_data_dir/cc-content.txt
                ls /usr/bin/gcc* &> $debug_data_dir/gcc-sys-versions.txt
-               gcc --version &> $debug_data_dir/gcc-version.txt
+               if type -p gcc &>/dev/null;then
+                       gcc --version &> $debug_data_dir/gcc-version.txt
+               else
+                       touch $debug_data_dir/gcc-absent
+               fi
+               if type -p clang &>/dev/null;then
+                       clang --version &> $debug_data_dir/clang-version.txt
+               else
+                       touch $debug_data_dir/clang-absent
+               fi
+               cat /etc/src.conf &> $debug_data_dir/bsd-etc-src-conf.txt
+               cat /etc/make.conf &> $debug_data_dir/bsd-etc-make-conf.txt
                cat /etc/issue &> $debug_data_dir/etc-issue.txt
                cat $FILE_LSB_RELEASE &> $debug_data_dir/lsb-release.txt
                cat $FILE_OS_RELEASE &> $debug_data_dir/os-release.txt
@@ -1602,6 +1871,7 @@ debug_data_collector()
                cat /proc/net/arp &> $debug_data_dir/proc-net-arp.txt 
                # bsd data
                cat /var/run/dmesg.boot &> $debug_data_dir/bsd-var-run-dmesg.boot.txt 
+               echo $COLS_INNER &> $debug_data_dir/cols-inner.txt
                
                check_recommends_user_output &> $debug_data_dir/check-recommends-user-output.txt
                # first download and verify xiin
@@ -1612,9 +1882,25 @@ debug_data_collector()
                                mv -f xiin $xiin_file
                        fi
                        # -Nc is creating really weird download anomolies, so using -O instead
-                       xiin_download="$( wget -q -O - http://inxi.googlecode.com/svn/branches/xiin/$xiin_file )"
+                       case $DOWNLOADER in
+                               curl)
+                                       xiin_download="$( curl -s $xiin_url )" || downloader_error=$?
+                                       ;;
+                               fetch)
+                                       xiin_download="$( fetch -q -o - $xiin_url )" || downloader_error=$?
+                                       ;;
+                               ftp)
+                                       xiin_download="$( ftp -o - $xiin_url 2>/dev/null )" || downloader_error=$?
+                                       ;;
+                               wget)
+                                       xiin_download="$( wget -q -O - $xiin_url )" || downloader_error=$?
+                                       ;;
+                               no-downloader)
+                                       downloader_error=1
+                                       ;;
+                       esac
                        # if nothing got downloaded kick out error, otherwise we'll use an older version
-                       if [[ $? -gt 0 && ! -f $xiin_file ]];then
+                       if [[ $downloader_error -gt 0 && ! -f $xiin_file ]];then
                                echo -e "ERROR: Failed to download required file: $xiin_file\nMaybe the remote site is down or your networking is broken?"
                                echo "Continuing with incomplete data collection."
                                echo "$xiin_file download failed and no existing $xiin_file" >> $debug_data_dir/xiin-error.txt
@@ -1666,31 +1952,103 @@ debug_data_collector()
                        if [[ -e $FILE_XORG_LOG ]];then
                                cat $FILE_XORG_LOG &> $debug_data_dir/xorg-log-file.txt
                        else
-                               touch $debug_data_dir/no-xorg-log-file
+                               touch $debug_data_dir/xorg-log-file-absent
                        fi
                        if [[ -e /etc/X11/xorg.conf ]];then
-                               cp /etc/X11/xorg.conf $SCRIPT_DATA_DIR/$debug_data_dir
+                               cat /etc/X11/xorg.conf &> $debug_data_dir/xorg-conf.txt
                        else
-                               touch $debug_data_dir/no-xorg-conf-file
+                               touch $debug_data_dir/xorg-conf-file-absent
                        fi
                        if [[ -n $( ls /etc/X11/xorg.conf.d/ 2>/dev/null ) ]];then
                                ls /etc/X11/xorg.conf.d &> $debug_data_dir/ls-etc-x11-xorg-conf-d.txt
-                               cp /etc/X11/xorg.conf.d $SCRIPT_DATA_DIR/$debug_data_dir
+                               xorg_d_files=$(ls /etc/X11/xorg.conf.d)
+                               for xorg_file in $xorg_d_files
+                               do
+                                       cat /etc/X11/xorg.conf.d/$xorg_file &> $debug_data_dir/xorg-conf-d-$xorg_file.txt
+                               done
+                       else
+                               touch $debug_data_dir/xorg-conf-d-files-absent
+                       fi
+                       echo 'Collecting X, xprop, glxinfo, xrandr, xdpyinfo data, wayland, weston...'
+                       if type -p weston-info &>/dev/null; then
+                               weston-info &> $debug_data_dir/weston-info.txt
+                       else
+                               touch $debug_data_dir/weston-info-absent
+                       fi
+                       if type -p weston &>/dev/null; then
+                               weston --version &> $debug_data_dir/weston-version.txt
+                       else
+                               touch $debug_data_dir/weston-absent
+                       fi
+                       if type -p xprop &>/dev/null; then
+                               xprop -root &> $debug_data_dir/xprop_root.txt
                        else
-                               touch $debug_data_dir/no-xorg-conf-d-files
-                       fi
-                       echo 'Collecting X, xprop, glxinfo, xrandr, xdpyinfo data...'
-                       xprop -root &> $debug_data_dir/xprop_root.txt
-                       glxinfo &> $debug_data_dir/glxinfo.txt
-                       xdpyinfo &> $debug_data_dir/xdpyinfo.txt
-                       xrandr &> $debug_data_dir/xrandr.txt
-                       X -version &> $debug_data_dir/x-version.txt
-                       Xorg -version &> $debug_data_dir/xorg-version.txt
+                               touch $debug_data_dir/xprop-absent
+                       fi
+                       if type -p xprop &>/dev/null; then
+                               glxinfo &> $debug_data_dir/glxinfo.txt
+                       else
+                               touch $debug_data_dir/glxinfo-absent
+                       fi
+                       if type -p xdpyinfo &>/dev/null; then
+                               xdpyinfo &> $debug_data_dir/xdpyinfo.txt
+                       else
+                               touch $debug_data_dir/xdpyinfo-absent
+                       fi
+                       if type -p xrandr &>/dev/null; then
+                               xrandr &> $debug_data_dir/xrandr.txt
+                       else
+                               touch $debug_data_dir/xrandr-absent
+                       fi
+                       if type -p X &>/dev/null; then
+                               X -version &> $debug_data_dir/x-version.txt
+                       else
+                               touch $debug_data_dir/x-absent
+                       fi
+                       if type -p Xorg &>/dev/null; then
+                               Xorg -version &> $debug_data_dir/xorg-version.txt
+                       else
+                               touch $debug_data_dir/xorg-absent
+                       fi
+                       
                        echo $GNOME_DESKTOP_SESSION_ID &> $debug_data_dir/gnome-desktop-session-id.txt
                        # kde 3 id
-                       echo $KDE_FULL_SESSION &> $debug_data_dir/kde3-ful-session.txt
-                       echo $KDE_SESSION_VERSION &> $debug_data_dir/kde456-session-version.txt
-                       echo "$(kded$KDE_SESSION_VERSION --version )" &> $debug_data_dir/kde-version-data.txt
+                       echo $KDE_FULL_SESSION &> $debug_data_dir/kde3-full-session.txt
+                       echo $KDE_SESSION_VERSION &> $debug_data_dir/kde-gte-4-session-version.txt
+                       if type -p kf5-config &>/dev/null; then
+                               kf5-config --version &> $debug_data_dir/kde-kf5-config-version-data.txt
+                       elif type -p kf6-config &>/dev/null; then
+                               kf6-config --version &> $debug_data_dir/kde-kf6-config-version-data.txt
+                       elif type -p kf$KDE_SESSION_VERSION-config &>/dev/null; then
+                               kf$KDE_SESSION_VERSION-config --version &> $debug_data_dir/kde-kf$KDE_SESSION_VERSION-KSV-config-version-data.txt
+                       else
+                               touch $debug_data_dir/kde-kf-config-absent
+                       fi
+                       if type -p plasmashell &>/dev/null; then
+                               plasmashell --version &> $debug_data_dir/kde-plasmashell-version-data.txt
+                       else
+                               touch $debug_data_dir/kde-plasmashell-absent
+                       fi
+                       if type -p kwin_x11 &>/dev/null; then
+                               kwin_x11 --version &> $debug_data_dir/kde-kwin_x11-version-data.txt
+                       else
+                               touch $debug_data_dir/kde-kwin_x11-absent
+                       fi
+                       if type -p kded4 &>/dev/null; then
+                               kded4 --version &> $debug_data_dir/kded4-version-data.txt
+                       elif type -p kded5 &>/dev/null; then
+                               kded5 --version &> $debug_data_dir/kded5-version-data.txt
+                       elif type -p kded &>/dev/null; then
+                               kded --version &> $debug_data_dir/kded-version-data.txt
+                       else
+                               touch $debug_data_dir/kded-$KDE_SESSION_VERSION-absent
+                       fi
+                       # kde 5/plasma desktop 5, this is maybe an extra package and won't be used
+                       if type -p about-distro &>/dev/null; then
+                               about-distro &> $debug_data_dir/kde-about-distro.txt
+                       else
+                               touch $debug_data_dir/kde-about-distro-absent
+                       fi
                        echo $XDG_CURRENT_DESKTOP &> $debug_data_dir/xdg-current-desktop.txt
                fi
                if [[ $1 == 'disk' || $1 == 'all' ]];then
@@ -1700,21 +2058,31 @@ debug_data_collector()
                        ls -l /dev/disk/by-id &> $debug_data_dir/dev-disk-id-data.txt
                        ls -l /dev/disk/by-label &> $debug_data_dir/dev-disk-label-data.txt
                        ls -l /dev/disk/by-uuid &> $debug_data_dir/dev-disk-uuid-data.txt
+                       # http://comments.gmane.org/gmane.linux.file-systems.zfs.user/2032
+                       ls -l /dev/disk/by-wwn &> $debug_data_dir/dev-disk-wwn-data.txt
                        ls -l /dev/disk/by-path &> $debug_data_dir/dev-disk-path-data.txt
                        ls -l /dev/mapper &> $debug_data_dir/dev-disk-mapper-data.txt
                        readlink /dev/root &> $debug_data_dir/dev-root.txt
                        df -h -T -P --exclude-type=aufs --exclude-type=squashfs --exclude-type=unionfs --exclude-type=devtmpfs --exclude-type=tmpfs --exclude-type=iso9660 --exclude-type=devfs --exclude-type=linprocfs --exclude-type=sysfs --exclude-type=fdescfs &> $debug_data_dir/df-h-T-P-excludes.txt
                        df -T -P --exclude-type=aufs --exclude-type=squashfs --exclude-type=unionfs --exclude-type=devtmpfs --exclude-type=tmpfs --exclude-type=iso9660 --exclude-type=devfs --exclude-type=linprocfs --exclude-type=sysfs --exclude-type=fdescfs &> $debug_data_dir/df-T-P-excludes.txt
-                       df -H -T &> $debug_data_dir/bsd-df-H-T-no-excludes.txt
-                       df -H &> $debug_data_dir/bsd-df-H-no-excludes.txt
+                       df -T -P --exclude-type=aufs --exclude-type=squashfs --exclude-type=unionfs --exclude-type=devtmpfs --exclude-type=tmpfs --exclude-type=iso9660 --exclude-type=devfs --exclude-type=linprocfs --exclude-type=sysfs --exclude-type=fdescfs --total &> $debug_data_dir/df-T-P-excludes-total.txt
+                       df -h -T &> $debug_data_dir/bsd-df-h-T-no-excludes.txt
+                       df -h &> $debug_data_dir/bsd-df-h-no-excludes.txt
+                       df -k -T &> $debug_data_dir/bsd-df-k-T-no-excludes.txt
+                       df -k &> $debug_data_dir/bsd-df-k-no-excludes.txt
+                       atacontrol list &> $debug_data_dir/bsd-atacontrol-list.txt
+                       camcontrol devlist &> $debug_data_dir/bsd-camcontrol-devlist.txt
                        # bsd tool
                        mount &> $debug_data_dir/mount.txt
+                       btrfs filesystem show  &> $debug_data_dir/btrfs-filesystem-show.txt
+                       btrfs filesystem show --mounted  &> $debug_data_dir/btrfs-filesystem-show-mounted.txt
+                       # btrfs filesystem show --all-devices  &> $debug_data_dir/btrfs-filesystem-show-all-devices.txt
                        gpart list &> $debug_data_dir/bsd-gpart-list.txt
                        gpart show &> $debug_data_dir/bsd-gpart-show.txt
                        gpart status &> $debug_data_dir/bsd-gpart-status.txt
-                       swapctl -l &> $debug_data_dir/bsd-swapctl-l.txt
+                       swapctl -l -k &> $debug_data_dir/bsd-swapctl-l-k.txt
                        swapon -s &> $debug_data_dir/swapon-s.txt
-                       sysctl -b kern.geom.conftxt  &> $debug_data_dir/bsd-sysctl-b-kern.geom.conftxt.txt
+                       sysctl -b kern.geom.conftxt &> $debug_data_dir/bsd-sysctl-b-kern.geom.conftxt.txt
                        sysctl -b kern.geom.confxml &> $debug_data_dir/bsd-sysctl-b-kern.geom.confxml.txt
                        zfs list &> $debug_data_dir/bsd-zfs-list.txt
                        zpool list &> $debug_data_dir/bsd-zpool-list.txt
@@ -1734,7 +2102,7 @@ debug_data_collector()
                echo 'Creating inxi output file now. This can take a few seconds...'
                echo "Starting $SCRIPT_NAME from: $start_directory"
                cd $start_directory
-               $SCRIPT_PATH/$SCRIPT_NAME -FRploudxxx -c 0 -@ 8 > $SCRIPT_DATA_DIR/$debug_data_dir/inxi-FRploudxxx.txt
+               $SCRIPT_PATH/$SCRIPT_NAME -F${debug_i}Rfrploudmxxx -c 0 -@ 8 -y 120 > $SCRIPT_DATA_DIR/$debug_data_dir/inxi-F${debug_i}Rfrploudmxxxy120.txt
                cp $LOG_FILE $SCRIPT_DATA_DIR/$debug_data_dir
                if [[ -f $SCRIPT_DATA_DIR/$debug_data_dir.tar.gz ]];then
                        echo "Found and removing previous tar.gz data file: $debug_data_dir.tar.gz"
@@ -1785,34 +2153,37 @@ debug_data_collector()
 
 check_recommends_user_output()
 {
-       local Line='-----------------------------------------------------------------------------------------'
+       local Line=$LINE1
        local gawk_version='N/A' sed_version='N/A' sudo_version='N/A' python_version='N/A'
+       local downloaders_bsd=''
        
-       if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
+       if [[ $B_IRC == 'true' ]];then
                print_screen_output "Sorry, you can't run this option in an IRC client."
                exit 1
        fi
-       
+       if [[ -n $BSD_TYPE ]];then
+               downloaders_bsd='
+               fetch:BSD-only~BSD-only~BSD-only~:-i_wan_ip;-w/-W;-U/-!_[11-15]_(BSDs)
+               ftp:ftp-OpenBSD-only~ftp-OpenBSD-only~ftp-OpenBSD-only~:-i_wan_ip;-w/-W;-U/-!_[11-15]_(OpenBSD_only)'
+       fi
        initialize_paths
-       
-       echo "$SCRIPT_NAME will now begin checking for the programs it needs to operate. First a check of"
-       echo "the main languages and tools $SCRIPT_NAME uses. Python is only for debugging data collection."
+       print_lines_basic "0" "" "$SCRIPT_NAME will now begin checking for the programs it needs to operate. First a check of the main languages and tools $SCRIPT_NAME uses. Python is only for debugging data collection."
        echo $Line
        echo "Bash version: $( bash --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^GNU bash/ {print $4}' )"
-       if [[ -n $( type -p gawk ) ]];then
+       if type -p gawk &>/dev/null;then
                gawk_version=$( gawk --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^GNU Awk/ {print $3}' )
        fi
-       if [[ -n $( type -p sed ) ]];then
+       if type -p sed &>/dev/null;then
                sed_version=$( sed --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^GNU sed version/ {print $4}' )
                if [[ -z $sed_version ]];then
                        # note: bsd sed shows error with --version flag
                        sed_version=$( sed --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^sed: illegal option/ {print "BSD sed"}' )
                fi
        fi
-       if [[ -n $( type -p sudo ) ]];then
+       if type -p sudo &>/dev/null;then
                sudo_version=$( sudo -V 2>&1 | awk 'BEGIN {IGNORECASE=1} /^Sudo version/ {print $3}' )
        fi
-       if [[ -n $( type -p python ) ]];then
+       if type -p python &>/dev/null;then
                python_version=$( python --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^Python/ {print $2}' )
        fi
        echo "Gawk version: $gawk_version"
@@ -1820,26 +2191,44 @@ check_recommends_user_output()
        echo "Sudo version: $sudo_version"
        echo "Python version: $python_version"
        echo $Line
-       echo "Test One: Required System Directories."
-       echo "If one of these system directories is missing, $SCRIPT_NAME cannot operate:"
+       
+       echo "Test One: Required System Directories (Linux Only)."
+       print_lines_basic "0" "" "If one of these system directories is missing, $SCRIPT_NAME cannot operate:"
        echo 
        check_recommends_items 'required-dirs'
+       
        echo "Test Two: Required Core Applications."
-       echo "If one of these applications is missing, $SCRIPT_NAME cannot operate:"
+       print_lines_basic "0" "" "If one of these applications is missing, $SCRIPT_NAME cannot operate:"
        echo 
        check_recommends_items 'required-apps'
-       echo 'Test Three: Script Recommends for Graphics Features. If you do not use X these do not matter.'
-       echo "If one of these applications is missing, $SCRIPT_NAME will have incomplete output:"
+       
+       print_lines_basic "0" "" "Test Three: Script Recommends for Graphics Features."
+       print_lines_basic "0" "" "NOTE: If you do not use X these do not matter (like a headless server). Otherwise, if one of these applications is missing, $SCRIPT_NAME will have incomplete output:"
        echo 
        check_recommends_items 'recommended-x-apps'
+       
        echo 'Test Four: Script Recommends for Remaining Features.' 
-       echo "If one of these applications is missing, $SCRIPT_NAME will have incomplete output:"
+       print_lines_basic "0" "" "If one of these applications is missing, $SCRIPT_NAME will have incomplete output:"
        echo 
        check_recommends_items 'recommended-apps'
-       echo 'Test Five: System Directories for Various Information.' 
-       echo "If one of these directories is missing, $SCRIPT_NAME will have incomplete output:"
+       
+       echo 'Test Five: Script Recommends for Remaining Features.' 
+       print_lines_basic "0" "" "One of these downloaders needed for options -i/-w/-W (-U/-! [11-15], if supported):"
+       echo 
+       check_recommends_items 'downloaders'
+       
+       echo 'Test Six: System Directories for Various Information.'
+       echo '(Unless otherwise noted, these are for GNU/Linux systems)' 
+       print_lines_basic "0" "" "If one of these directories is missing, $SCRIPT_NAME may have incomplete output:"
        echo 
        check_recommends_items 'system-dirs'
+       
+       echo 'Test Seven: System Files for Various Information.'
+       echo '(Unless otherwise noted, these are for GNU/Linux systems)' 
+       print_lines_basic "0" "" "If one of these files is missing, $SCRIPT_NAME may have incomplete output:"
+       echo 
+       check_recommends_items 'system-files'
+       
        echo 'All tests completed.' 
 }
 # args: $1 - check item
@@ -1848,7 +2237,7 @@ check_recommends_items()
        local item='' item_list='' item_string='' missing_items='' missing_string=''
        local package='' application='' feature='' type='' starter='' finisher=''
        local package_deb='' package_pacman='' package_rpm='' 
-       local print_string='' separator=''
+       local print_string='' separator='' width=56
        local required_dirs='/proc /sys'
        # package-owner: 1 - debian/ubuntu; 2 - arch; 3 - yum/rpm
        # pardus: pisi sf -q /usr/bin/package
@@ -1862,7 +2251,6 @@ check_recommends_items()
        sed:sed~sed~sed~:string_replace 
        tr:coreutils~coreutils~coreutils~:character_replace 
        uname:uname~coreutils~coreutils~:kernel_data 
-       uptime:procps~procps~procps~: 
        wc:coreutils~coreutils~coreutils~:word_character_count
        '
        local x_recommends='
@@ -1872,8 +2260,10 @@ check_recommends_items()
        xrandr:x11-xserver-utils~xrandr~x11-server-utils~:-G_single_screen_resolution
        '
        local recommended_apps='
-       dmidecode:dmidecode~dmidecode~dmidecode~:-M_if_no_sys_machine_data 
+       dig:dnsutils~dnsutils~bind-utils:-i_first_wlan_ip_default_test
+       dmidecode:dmidecode~dmidecode~dmidecode~:-M_if_no_sys_machine_data;_-m_memory 
        file:file~file~file~:-o_unmounted_file_system
+       hciconfig:bluez~bluez-utils~bluez-utils~:-n_-i_bluetooth_data
        hddtemp:hddtemp~hddtemp~hddtemp~:-Dx_show_hdd_temp 
        ifconfig:net-tools~net-tools~net-tools~:-i_ip_lan-deprecated
        ip:iproute~iproute2~iproute~:-i_ip_lan
@@ -1883,46 +2273,94 @@ check_recommends_items()
        modinfo:module-init-tools~module-init-tools~module-init-tools~:-Ax,-Nx_module_version 
        runlevel:sysvinit~sysvinit~systemd~:-I_runlevel
        sudo:sudo~sudo~sudo~:-Dx_hddtemp-user;-o_file-user
+       uptime:procps~procps~procps~:-I_uptime_(check_which_package_owns_Debian)
        '
+       
+       local downloaders="
+       wget:wget~wget~wget~:-i_wan_ip;-w/-W;-U/-!_[11-15]_(if_supported)
+       curl:curl~curl~curl~:-i_wan_ip;-w/-W;-U/-!_[11-15]_(if_supported)
+       $downloaders_bsd
+       "
        local recommended_dirs='
        /sys/class/dmi/id:-M_system,_motherboard,_bios
        /dev:-l,-u,-o,-p,-P,-D_disk_partition_data
        /dev/disk/by-label:-l,-o,-p,-P_partition_labels
        /dev/disk/by-uuid:-u,-o,-p,-P_partition_uuid
-       /var/run/dmesg.boot:-C,-f_(BSD_only)
        '
+       local recommended_files="
+       $FILE_ASOUND_DEVICE:-A_sound_card_data
+       $FILE_ASOUND_VERSION:-A_ALSA_data
+       $FILE_CPUINFO:-C_cpu_data
+       $FILE_LSB_RELEASE:-S_distro_version_data_[deprecated]
+       $FILE_MDSTAT:-R_mdraid_data
+       $FILE_MEMINFO:-I_memory_data
+       $FILE_OS_RELEASE:-S_distro_version_data
+       $FILE_PARTITIONS:-p,-P_partitions_data
+       $FILE_MODULES:-G_module_data
+       $FILE_MOUNTS:-P,-p_partition_advanced_data
+       $FILE_DMESG_BOOT:-D,-d_disk_data_[BSD_only]
+       $FILE_SCSI:-D_Advanced_hard_disk_data_[used_rarely]
+       $FILE_XORG_LOG:-G_graphics_driver_load_status
+       "
+       
+       if [[ -n $COLS_INNER ]];then
+               if [[ $COLS_INNER -ge 90 ]];then
+                       width=${#LINE1} # match width of $LINE1
+               elif [[ $COLS_INNER -ge 78 ]];then
+                       width=$(( $COLS_INNER - 11 ))
+               fi
+       fi
        
        case $1 in
+               downloaders)
+                       item_list=$downloaders
+                       item_string='Downloaders'
+                       item_string=''
+                       missing_string='downloaders, and their corresponding packages,'
+                       type='applications'
+                       ;;
                required-dirs)
                        item_list=$required_dirs
                        item_string='Required file system'
+                       item_string=''
                        missing_string='system directories'
                        type='directories'
                        ;;
                required-apps)
                        item_list=$required_apps
                        item_string='Required application'
+                       item_string=''
                        missing_string='applications, and their corresponding packages,'
                        type='applications'
                        ;;
                recommended-x-apps)
                        item_list=$x_recommends
                        item_string='Recommended X application'
+                       item_string=''
                        missing_string='applications, and their corresponding packages,'
                        type='applications'
                        ;;
                recommended-apps)
                        item_list=$recommended_apps
                        item_string='Recommended application'
+                       item_string=''
                        missing_string='applications, and their corresponding packages,'
                        type='applications'
                        ;;
                system-dirs)
                        item_list=$recommended_dirs
                        item_string='System directory'
+                       item_string=''
                        missing_string='system directories'
                        type='directories'
                        ;;
+               system-files)
+                       item_list=$recommended_files
+                       item_string='System file'
+                       item_string=''
+                       missing_string='system files'
+                       type='files'
+                       ;;
        esac
        # great trick from: http://ideatrash.net/2011/01/bash-string-padding-with-sed.html
        # left pad: sed -e :a -e 's/^.\{1,80\}$/& /;ta'
@@ -1952,13 +2390,13 @@ check_recommends_items()
                        fi
                fi
                if [[ -n $feature ]];then
-                       print_string="$item_string$application (info: $( sed 's/_/ /g' <<< $feature ))"
+                       print_string="$item_string$application (info: $( sed 's/_/ /g' <<< $feature ))"
                else
-                       print_string="$item_string$application"
+                       print_string="$item_string$application"
                fi
                
-               starter="$( sed -e :a -e 's/^.\{1,75\}$/&./;ta' <<< $print_string )"
-               if [[ -z $( grep '^/' <<< $application ) && -n $location ]] || [[ -d $application ]];then
+               starter="$( sed -e :a -e 's/^.\{1,'$width'\}$/&./;ta' <<< $print_string )"
+               if [[ -z $( grep '^/' <<< $application ) && -n $location ]] || [[ -d $application || -f $application ]];then
                        if [[ -n $location ]];then
                                finisher=" $location"
                        else
@@ -1979,21 +2417,22 @@ check_recommends_items()
                do
                        application=$( cut -d ':' -f 1 <<< $item )
                        if [[ $type == 'applications' ]];then
-                               # echo '--------------------------------------------------------'
                                echo
                                package=$( cut -d ':' -f 2 <<< $item )
                                package_deb=$( cut -d '~' -f 1 <<< $package )
                                package_pacman=$( cut -d '~' -f 2 <<< $package )
                                package_rpm=$( cut -d '~' -f 3 <<< $package )
                                echo "Application: $application"
-                               echo "To add to your system, install the proper distribution package for your system:"
-                               echo "Debian/Ubuntu: $package_deb :: Arch Linux: $package_pacman :: Redhat/Fedora/Suse: $package_rpm"
-                       else
+                               print_lines_basic "0" "" "To add to your system, install the proper distribution package for your system:"
+                               print_lines_basic "0" "" "Debian/Ubuntu:^$package_deb^:: Arch Linux:^$package_pacman^:: Redhat/Fedora/Suse:^$package_rpm"
+                       elif [[ $type == 'directories' ]];then
                                echo "Directory: $application"
+                       elif [[ $type == 'files' ]];then
+                               echo "File: $application"
                        fi
                done
                if [[ $item_string == 'System directory' ]];then
-                       echo "These directories are created by the kernel, so don't worry if they are not present."
+                       print_lines_basic "0" "" "These directories are created by the kernel, so don't worry if they are not present."
                fi
        else
                echo "All the $( cut -d ' ' -f 1 <<< $item_string | sed -e 's/Re/re/' -e 's/Sy/sy/' ) $type are present."
@@ -2032,18 +2471,14 @@ print_screen_output()
                        print_data="P: $print_data"
                fi
        fi
-
        if [[ $KONVI -eq 1 && $B_DCOP == 'true' ]]; then ## dcop Konversation (<= 1.1 (qt3))
                # konvi doesn't seem to like \n characters, it just prints them literally
                $print_data="$( tr '\n' ' ' <<< "$print_data" )"
                dcop "$DCPORT" "$DCOPOBJ" say "$DCSERVER" "$DCTARGET" "$print_data"
-
        elif [[ $KONVI -eq 3 && $B_QDBUS == 'true' ]]; then ## dbus Konversation (> 1.2 (qt4))
                qdbus org.kde.konversation /irc say "$DCSERVER" "$DCTARGET" "$print_data"
-
 #      elif [[ $IRC_CLIENT == 'X-Chat' ]]; then
 #              qdbus org.xchat.service print "$print_data\n"
-
        else
                # the -n is needed to avoid double spacing of output in terminal
                echo -ne "$print_data\n"
@@ -2056,8 +2491,9 @@ print_screen_output()
 create_print_line()
 {
        eval $LOGFS
-       local line=$2
-       printf "${C1}%-${INDENT}s${C2} %s" "$1" "$line"
+       # convoluted, yes, but it works to trim spaces off end
+       local line=${2%${2##*[![:space:]]}}
+       printf "${C1}%-${INDENT}s${C2} %s" "$1" "$line${CN}"
        eval $LOGFE
 }
 
@@ -2093,13 +2529,12 @@ remove_erroneous_chars()
 get_parameters()
 {
        eval $LOGFS
-       local opt='' wget_test='' debug_data_type='' weather_flag='wW:' 
+       local opt='' downloader_test='' debug_data_type='' weather_flag='wW:' 
        local use_short='true' # this is needed to trigger short output, every v/d/F/line trigger sets this false
 
        # if distro maintainers don't want the weather feature disable it
        if [[ $B_ALLOW_WEATHER == 'false' ]];then
                weather_flag=''
-               
        fi
        if [[ $1 == '--version' ]];then
                print_version_info
@@ -2114,7 +2549,7 @@ get_parameters()
        # no need to run through these if there are no args
        # reserved for future use: -g for extra Graphics; -m for extra Machine; -d for extra Disk
        elif [[ -n $1 ]];then
-               while getopts Abc:CdDfFGhHiIlMnNopPrRsSt:uUv:V${weather_flag}xzZ%@:!: opt
+               while getopts AbBc:CdDfFGhHiIlmMnNopPrRsSt:uUv:V${weather_flag}xy:zZ%@:!: opt
                do
                        case $opt in
                        A)      B_SHOW_AUDIO='true'
@@ -2127,10 +2562,15 @@ get_parameters()
                                B_SHOW_GRAPHICS='true'
                                B_SHOW_INFO='true'
                                B_SHOW_MACHINE='true'
+                               B_SHOW_BATTERY='true'
                                B_SHOW_NETWORK='true'
                                B_SHOW_SYSTEM='true'
                                ;;
-                       c)      if [[ -n $( grep -E '^[0-9][0-9]?$' <<< $OPTARG ) ]];then
+                       B)      B_SHOW_BATTERY_FORCED='true'
+                               B_SHOW_BATTERY='true'
+                               use_short='false'
+                               ;;
+                       c)      if [[ $OPTARG =~ ^[0-9][0-9]?$ ]];then
                                        case $OPTARG in
                                                99)
                                                        B_RUN_COLOR_SELECTOR='true'
@@ -2193,6 +2633,7 @@ get_parameters()
                                B_SHOW_GRAPHICS='true'
                                B_SHOW_INFO='true'
                                B_SHOW_MACHINE='true'
+                               B_SHOW_BATTERY='true'
                                B_SHOW_NETWORK='true'
                                B_SHOW_PARTITIONS='true'
                                B_SHOW_RAID='true'
@@ -2215,7 +2656,11 @@ get_parameters()
                                B_SHOW_PARTITIONS='true'
                                use_short='false'
                                ;;
+                       m)      B_SHOW_MEMORY='true'
+                               use_short='false'
+                               ;;
                        M)      B_SHOW_MACHINE='true'
+                               B_SHOW_BATTERY='true'
                                use_short='false'
                                ;;
                        n)      B_SHOW_ADVANCED_NETWORK='true'
@@ -2251,7 +2696,7 @@ get_parameters()
                        S)      B_SHOW_SYSTEM='true'
                                use_short='false'
                                ;;
-                       t)      if [[ -n $( grep -E '^(c|m|cm|mc)([1-9]|1[0-9]|20)?$' <<< $OPTARG ) ]];then
+                       t)      if [[ $OPTARG =~ ^(c|m|cm|mc)([1-9]|1[0-9]|20)?$ ]];then
                                        use_short='false'
                                        if [[ -n $( grep -E '[0-9]+' <<< $OPTARG ) ]];then
                                                PS_COUNT=$( sed 's/[^0-9]//g' <<< $OPTARG )
@@ -2270,7 +2715,7 @@ get_parameters()
                                B_SHOW_PARTITIONS='true'
                                use_short='false'
                                ;;
-                       v)      if [[ -n $( grep -E "^[0-9][0-9]?$" <<< $OPTARG ) && $OPTARG -le $VERBOSITY_LEVELS ]];then
+                       v)      if [[ $OPTARG =~ ^[0-9][0-9]?$ && $OPTARG -le $VERBOSITY_LEVELS ]];then
                                        if [[ $OPTARG -ge 1 ]];then
                                                use_short='false'
                                                B_SHOW_BASIC_CPU='true'
@@ -2282,6 +2727,7 @@ get_parameters()
                                        if [[ $OPTARG -ge 2 ]];then
                                                B_SHOW_BASIC_DISK='true'
                                                B_SHOW_BASIC_RAID='true'
+                                               B_SHOW_BATTERY='true'
                                                B_SHOW_MACHINE='true'
                                                B_SHOW_NETWORK='true'
                                        fi
@@ -2297,6 +2743,7 @@ get_parameters()
                                        if [[ $OPTARG -ge 5 ]];then
                                                B_SHOW_AUDIO='true'
                                                B_SHOW_BASIC_OPTICAL='true'
+                                               B_SHOW_MEMORY='true'
                                                B_SHOW_SENSORS='true'
                                                B_SHOW_LABELS='true'
                                                B_SHOW_UUIDS='true'
@@ -2346,6 +2793,12 @@ get_parameters()
                                        B_EXTRA_DATA='true'
                                fi
                                ;;
+                       y)      if [[ -z ${OPTARG//[0-9]/} && $OPTARG -ge 80 ]];then
+                                       set_display_width "$OPTARG"
+                               else
+                                       error_handler 21 "$OPTARG"
+                               fi
+                               ;;
                        z)      B_OUTPUT_FILTER='true'
                                ;;
                        Z)      B_OVERRIDE_FILTER='true'
@@ -2359,7 +2812,7 @@ get_parameters()
                        ## debuggers and testing tools
                        %)      B_HANDLE_CORRUPT_DATA='true'
                                ;;
-                       @)      if [[ -n $( grep -E "^([1-9]|1[0-4])$" <<< $OPTARG ) ]];then
+                       @)      if [[ -n $( grep -E "^([1-9]|1[0-5])$" <<< $OPTARG ) ]];then
                                        DEBUG=$OPTARG
                                        if [[ $B_EXTRA_EXTRA_DATA == 'true' ]];then
                                                B_UPLOAD_DEBUG_DATA='true'
@@ -2379,7 +2832,7 @@ get_parameters()
                                                        LOGFE=$LOGFE_STRING
                                                        create_rotate_logfiles # create/rotate logfiles before we do anything else
                                                        ;;
-                                               11|12|13|14)
+                                               11|12|13|14|15)
                                                        case $OPTARG in
                                                                11)
                                                                        debug_data_type='sys'
@@ -2393,6 +2846,10 @@ get_parameters()
                                                                14)
                                                                        debug_data_type='all'
                                                                        ;;
+                                                               15)
+                                                                       debug_data_type='all'
+                                                                       B_DEBUG_I='true'
+                                                                       ;;
                                                        esac
                                                        initialize_data
                                                        debug_data_collector $debug_data_type
@@ -2444,7 +2901,7 @@ get_parameters()
                                                fi
                                                ;;
                                        30)
-                                               B_RUNNING_IN_SHELL='true'
+                                               B_IRC='false'
                                                ;;
                                        31)
                                                B_SHOW_HOST='false'
@@ -2452,6 +2909,9 @@ get_parameters()
                                        32)
                                                B_SHOW_HOST='true'
                                                ;;
+                                       33)
+                                               B_FORCE_DMIDECODE='true'
+                                               ;;
                                        ftp*)
                                                ALTERNATE_FTP="$OPTARG"
                                                ;;
@@ -2498,7 +2958,7 @@ show_options()
        local color_scheme_count=$(( ${#A_COLOR_SCHEMES[@]} - 1 ))
        local partition_string='partition' partition_string_u='Partition'
        
-       if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
+       if [[ $B_IRC == 'true' ]];then
                print_screen_output "Sorry, you can't run the help option in an IRC client."
                exit 1
        fi
@@ -2512,14 +2972,14 @@ show_options()
        # print_screen_output " "
        print_lines_basic "0" "" "$SCRIPT_NAME supports the following options. You can combine them, or list them one by one. Examples: $SCRIPT_NAME^-v4^-c6 OR $SCRIPT_NAME^-bDc^6. If you start $SCRIPT_NAME with no arguments, it will show the short form."
        print_screen_output " "
-       print_lines_basic "0" "" "The following options if used without -F, -b, or -v will show just option line(s): A, C, D, G, I, M, N, P, R, S, f, i, n, o, p, l, u, r, s, t - you can use these alone or together to show just the line(s) you want to see. If you use them with -v [level], -b or -F, it will show the full output for that line along with the output for the chosen verbosity level."
-       
+       print_lines_basic "0" "" "The following options if used without -F, -b, or -v will show just option line(s): A, B, C, D, G, I, M, N, P, R, S, f, i, m, n, o, p, l, u, r, s, t - you can use these alone or together to show just the line(s) you want to see. If you use them with -v^[level], -b or -F, it will show the full output for that line along with the output for the chosen verbosity level."
        print_screen_output "- - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
        print_screen_output "Output Control Options:"
        print_lines_basic "1" "-A" "Audio/sound card information."
-       print_lines_basic "1" "-b" "Basic output, short form. Like $SCRIPT_NAME^-v^2, only minus hard disk names."
+       print_lines_basic "1" "-b" "Basic output, short form. Like $SCRIPT_NAME^-v^2, only minus hard disk names ."
+       print_lines_basic "1" "-B" "Battery info, shows charge, condition, plus extra information (if battery present)."
        print_lines_basic "1" "-c" "Color schemes. Scheme number is required. Color selectors run a color selector option prior to $SCRIPT_NAME starting which lets you set the config file value for the selection."
-       print_lines_basic "1" "" "Supported color schemes: 0-$color_scheme_count Example: $SCRIPT_NAME^-c^11"
+       print_lines_basic "1" "" "Supported color schemes: 0-$color_scheme_count Example:^$SCRIPT_NAME^-c^11"
        print_lines_basic "1" "" "Color selectors for each type display (NOTE: irc and global only show safe color set):"
 #      print_screen_output "    Supported color schemes: 0-$color_scheme_count Example: $SCRIPT_NAME -c 11"
 #      print_screen_output "    Color selectors for each type display (NOTE: irc and global only show safe color set):"
@@ -2529,45 +2989,48 @@ show_options()
        print_lines_basic "2" "97" "Console IRC running in X - like irssi in xTerm"
        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 (if available)."
+       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" "Full hard Disk info, not only model, ie: /dev/sda ST380817AS 80.0GB. 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 -x -d -f -u -l -o -p -t -r"
+       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" "-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" "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."
-       print_lines_basic "1" "-l" "${partition_string_u} labels. Default: short ${partition_string} -P. For full -p output, use: -pl (or -plu)."
-       print_lines_basic "1" "-M" "Machine data. Motherboard, Bios, and if present, System Builder (Like Lenovo). Older systems/kernels without the required /sys data can use dmidecode instead, run as root."
+       print_lines_basic "1" "-l" "$partition_string_u labels. Default: short $partition_string -P. For full -p output, use: -pl (or -plu)."
+       print_lines_basic "1" "-m" "Memory (RAM) data. Physical system memory array(s), capacity, how many devices (slots) supported, and individual memory devices (sticks of memory etc). For devices, shows device locator, size, speed, type (like: DDR3). Also see -x, -xx, -xxx"
+       print_lines_basic "1" "-M" "Machine data. Motherboard, Bios, and if present, System Builder (Like Lenovo). Older systems/kernels without the required /sys data can use dmidecode instead, run as root. Dmidecode can be forced with -! 33"
        print_lines_basic "1" "-n" "Advanced Network card information. Same as -Nn. Shows interface, speed, mac id, state, etc."
        print_lines_basic "1" "-N" "Network card information. With -x, shows PCI BusID, Port number."
-       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 /tmp /usr /var. Use -p to see all mounted ${partition_string}s."
-       print_lines_basic "1" "-r" "Distro repository data. Supported repo types: APT; PACMAN; PISI; YUM; URPMQ; Ports."
+       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 /tmp /usr /var. 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" "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"
-       print_lines_basic "1" "-t" "Processes. Requires extra options: c (cpu) m (memory) cm (cpu+memory). If followed by numbers 1-20, shows that number of processes for each type (default:^$PS_COUNT; if in irc, max:^5): -t^cm10"
+       print_lines_basic "1" "-t" "Processes. Requires extra options: c^(cpu) m^(memory) cm^(cpu+memory). If followed by numbers 1-20, shows that number of processes for each type (default:^$PS_COUNT; if in irc, max:^5): -t^cm10"
        print_lines_basic "1" "" "Make sure to have no space between letters and numbers (-t^cm10 - right, -t^cm^10 - wrong)."
-       print_lines_basic "1" "-u" "${partition_string_u} UUIDs. Default: short ${partition_string} -P. For full -p output, use: -pu (or -plu)."
+       print_lines_basic "1" "-u" "$partition_string_u UUIDs. Default: short $partition_string -P. For full -p output, use: -pu (or -plu)."
        print_lines_basic "1" "-v" "Script verbosity levels. Verbosity level number is required. Should not be used with -b or -F"
-       print_lines_basic "1" "" "Supported levels: 0-${VERBOSITY_LEVELS} Example: $SCRIPT_NAME^-v^4"
+       print_lines_basic "1" "" "Supported levels: 0-$VERBOSITY_LEVELS Example: $SCRIPT_NAME^-v^4"
        print_lines_basic "2" "0" "Short output, same as: $SCRIPT_NAME"
        print_lines_basic "2" "1" "Basic verbose, -S + basic CPU + -G + basic Disk + -I."
-       print_lines_basic "2" "2" "Networking card (-N), Machine (-M) data, shows basic hard disk data (names only), and, if present, basic raid (devices only, and if inactive, notes that). similar to: $SCRIPT_NAME^-b"
-       print_lines_basic "2" "3" "Advanced CPU (-C), network (-n) data, and switches on -x advanced data option."
-       print_lines_basic "2" "4" "${partition_string_u} size/filled data (-P) for (if present):/, /home, /var/, /boot. Shows full disk data (-D)."
-       print_lines_basic "2" "5" "Audio card (-A); sensors (-s), ${partition_string} label (-l) and UUID (-u), short form of optical drives, standard raid data (-R)."
-       print_lines_basic "2" "6" "Full ${partition_string} (-p), unmounted ${partition_string} (-o), optical drive (-d), full raid; triggers -xx."
+       print_lines_basic "2" "2" "Networking card (-N), Machine (-M) data, if present, Battery (-B), basic hard disk data (names only), and, if present, basic raid (devices only, and if inactive, notes that). similar to: $SCRIPT_NAME^-b"
+       print_lines_basic "2" "3" "Advanced CPU (-C), battery, network (-n) data, and switches on -x advanced data option."
+       print_lines_basic "2" "4" "$partition_string_u size/filled data (-P) for (if present): /, /home, /var/, /boot. Shows full disk data (-D)."
+       print_lines_basic "2" "5" "Audio card (-A); sensors^(-s), memory/ram^(-m), $partition_string label^(-l) and UUID^(-u), short form of optical drives, standard raid data (-R)."
+       print_lines_basic "2" "6" "Full $partition_string (-p), unmounted $partition_string (-o), optical drive (-d), full raid; triggers -xx."
        print_lines_basic "2" "7" "Network IP data (-i); triggers -xxx."
        
        # if distro maintainers don't want the weather feature disable it
        if [[ $B_ALLOW_WEATHER == 'true' ]];then
                print_lines_basic "1" "-w" "Local weather data/time. To check an alternate location, see: -W^<location>. For extra weather data options see -x, -xx, and -xxx."
-               print_lines_basic "1" "-W" "<location> Supported options for <location>: postal code; city, state/country; latitude/longitude. Only use if you want the weather somewhere other than the machine running $SCRIPT_NAME. Use only ascii characters, replace spaces in city/state/country names with '+'. Example:^$SCRIPT_NAME^-W^new+york,ny"
+               print_lines_basic "1" "-W" "<location> Supported options for <location>: postal code; city, state/country; latitudelongitude. Only use if you want the weather somewhere other than the machine running $SCRIPT_NAME. Use only ascii characters, replace spaces in city/state/country names with '+'. Example:^$SCRIPT_NAME^-W^new+york,ny"
        fi
        print_lines_basic "1" "-x" "Adds the following extra data (only works with verbose or line output, not short form):"
+       print_lines_basic "2" "-B" "Vendor/model, status (if available)"
        print_lines_basic "2" "-C" "CPU Flags, Bogomips on Cpu;"
        print_lines_basic "2" "-d" "Extra optical drive data; adds rev version to optical drive."
        print_lines_basic "2" "-D" "Hdd temp with disk data if you have hddtemp installed, if you are root OR if you have added to /etc/sudoers (sudo v. 1.7 or newer) Example:^<username>^ALL^=^NOPASSWD:^/usr/sbin/hddtemp"
@@ -2575,9 +3038,10 @@ show_options()
        print_lines_basic "2" "-G" "(for single gpu, nvidia driver) screen number gpu is running on."
        print_lines_basic "2" "-i" "IPv6 as well for LAN interface (IF) devices."
        print_lines_basic "2" "-I" "System GCC, default. With -xx, also show other installed GCC versions. If running in console, not in IRC client, shows shell version number, if detected. Init/RC Type and runlevel (if available)."
+       print_lines_basic "2" "-m" "Part number; Max memory module size (if available)."
        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" "-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" "-t" "Memory use output to cpu (-xt c), and cpu use to memory (-xt m)."
        if [[ $B_ALLOW_WEATHER == 'true' ]];then
@@ -2585,9 +3049,12 @@ show_options()
        fi
        print_lines_basic "1" "-xx" "Show extra, extra data (only works with verbose or line output, not short form):"
        print_lines_basic "2" "-A" "Chip vendor:product ID for each audio device."
+       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" "-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."
        print_lines_basic "2" "-N" "Chip vendor:product ID for each nic."
        print_lines_basic "2" "-R" "md-raid: Superblock (if present); algorythm, U data. Adds system info line (kernel support,read ahead, raid events). If present, adds unused device line. Resync line, shows progress bar."
@@ -2597,10 +3064,13 @@ show_options()
        fi
        print_lines_basic "2" "-@ 11-14" "Automatically uploads debugger data tar.gz file to ftp.techpatterns.com. EG: $SCRIPT_NAME^-xx@14"
        print_lines_basic "1" "-xxx" "Show extra, extra, extra data (only works with verbose or line output, not short form):"
+       print_lines_basic "2" "-B" "chemistry, cycles, location (if available)."
+       print_lines_basic "2" "-m" "Width of memory bus, data and total (if present and greater than data); Detail, if present, for Type; module voltage, if available."
        print_lines_basic "2" "-S" "Panel/shell information in desktop output, if in X (like gnome-shell, cinnamon, mate-panel)."
        if [[ $B_ALLOW_WEATHER == 'true' ]];then
                print_lines_basic "2" "-w -W" "Location (uses -z/irc filter), weather observation time, wind chill, heat index, dew point (shows extra lines for data where relevant)."
        fi
+       print_lines_basic "1" "-y" "Required extra option: integer, 80 or greater. Set the output line width max. Overrides IRC/Terminal settings or actual widths. If used with -h, put -y option first. Example:^inxi^-y^130"
        print_lines_basic "1" "-z" "Security filters for IP/Mac addresses, location, user home directory name. Default on for irc clients."
        print_lines_basic "1" "-Z" "Absolute override for output filters. Useful for debugging networking issues in irc for example."
        print_screen_output " "
@@ -2621,7 +3091,7 @@ show_options()
        print_lines_basic "2" "9" "Full file/sys info logging"
        print_lines_basic "2" "10" "Color logging."
        print_lines_basic "1" "" "The following create a tar.gz file of system data, plus collecting the inxi output to file. To automatically upload debugger data tar.gz file to ftp.techpatterns.com: inxi^-xx@^<11-14>"
-       print_lines_basic "1" "" "For alternate ftp upload locations: Example: inxi^-!^ftp.yourserver.com/incoming^-xx@^14"
+       print_lines_basic "1" "" "For alternate ftp upload locations: Example:^inxi^-!^ftp.yourserver.com/incoming^-xx@^14"
        print_lines_basic "2" "11" "With data file of xiin read of /sys."
        print_lines_basic "2" "12" "With xorg conf and log data, xrandr, xprop, xdpyinfo, glxinfo etc."
        print_lines_basic "2" "13" "With data from dev, disks, ${partition_string}s, etc., plus xiin data file."
@@ -2630,6 +3100,7 @@ show_options()
        print_screen_output "Advanced 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)."
        
        if [[ $1 == 'full' ]];then
                print_screen_output " "
@@ -2645,9 +3116,10 @@ show_options()
                        print_lines_basic "1" "-! 14" "Triggers an update from svn branch four - if present, of course."
                        print_lines_basic "1" "-! 15" "Triggers an update from svn branch BSD - if present, of course."
                        print_lines_basic "1" "-! 16" "Triggers an update from svn branch GNUBSD - if present, of course."
-                       print_lines_basic "1" "-! <http://......>" "Triggers an update from whatever server you list."
+                       print_lines_basic "1" "-! " "<http://......> Triggers an update from whatever server you list."
+                       print_lines_basic "1" "" "Example: inxi^-!^http://yourserver.com/testing/inxi"
                fi
-               print_lines_basic "1" "-! <ftp.......>" "Changes debugging data ftp upload location to whatever you enter here. Only used together with -xx@^11-14, and must be used in front of that. "
+               print_lines_basic "1" "-! " "<ftp.......> Changes debugging data ftp upload location to whatever you enter here. Only used together with -xx@^11-14, and must be used in front of that."
                print_lines_basic "1" "" "Example: inxi^-!^ftp.yourserver.com/incoming^-xx@^14"
        fi
        print_screen_output " "
@@ -2655,6 +3127,8 @@ show_options()
 
 # uses $TERM_COLUMNS to set width using $COLS_MAX as max width
 # IMPORTANT: minimize use of subshells here or the output is too slow
+# IMPORTANT: each text chunk must be a continuous line, no line breaks. For anyone who uses a 
+# code editor that can't do visual (not hard coded) line wrapping, upgrade to one that can.
 # args: $1 - 0 1 2 3 4 for indentation level; $2 -line starter, like -m; $3 - content of block.
 print_lines_basic()
 {
@@ -2793,19 +3267,19 @@ print_version_info()
        local year_modified=$( gawk '{print $NF}' <<< "$last_modified" )
        
        print_screen_output "$SCRIPT_NAME $SCRIPT_VERSION_NUMBER-$SCRIPT_PATCH_NUMBER ($last_modified)"
-       if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
+       if [[ $B_IRC == 'false' ]];then
                print_screen_output "Program Location: $script_path"
                if [[ -n $script_symbolic_start ]];then
                        print_screen_output "Started via symbolic link: $script_symbolic_start"
                fi
-               print_lines_basic "0" "" "Website:^http://inxi.goooglecode.com"
+               print_lines_basic "0" "" "Website:^https://github.com/smxi/inxi^or^http://smxi.org/"
                print_lines_basic "0" "" "IRC:^irc.oftc.net channel:^#smxi"
                print_lines_basic "0" "" "Forums:^http://techpatterns.com/forums/forum-33.html"
                print_screen_output " "
                print_lines_basic "0" "" "$SCRIPT_NAME - the universal, portable, system information tool for console and irc."
                print_screen_output " "
-               print_lines_basic "0" "" "This program started life as a fork of Infobash 3.02: Copyright (C) 2005-2007  Michiel de Boer a.k.a. locsmif."
-               print_lines_basic "0" "" "Subsequent changes and modifications (after Infobash 3.02): Copyright (C) 2008-$year_modified Scott Rogers, Harald Hope, aka trash80 & h2"
+               print_lines_basic "0" "" "This program started life as a fork of Infobash 3.02: Copyright^(C)^2005-2007^Michiel^de^Boer^a.k.a.^locsmif."
+               print_lines_basic "0" "" "Subsequent changes and modifications (after Infobash 3.02): Copyright^(C)^2008-${year_modified%%-*}^Harald^Hope,^Scott^Rogers,^aka^h2^&trash80."
                print_screen_output " "
                print_lines_basic "0" "" "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. (http://www.gnu.org/licenses/gpl.html)"
        fi
@@ -2827,7 +3301,7 @@ get_start_client()
        local B_Non_Native_App='false' pppid='' App_Working_Name=''
        local b_qt4_konvi='false' ps_parent=''
 
-       if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
+       if [[ $B_IRC == 'false' ]];then
                IRC_CLIENT='Shell'
                unset IRC_CLIENT_VERSION
        # elif [[ -n $PPID ]];then
@@ -2838,8 +3312,8 @@ get_start_client()
                Irc_Client_Path=$( readlink /proc/$PPID/exe )
                # Irc_Client_Path=$( ps -p $PPID | gawk '!/[[:space:]]*PID/ {print $5}'  )
                # echo $( ps -p $PPID )
-               irc_client_path_lower=$( tr '[:upper:]' '[:lower:]' <<< $Irc_Client_Path )
-               App_Working_Name=$( basename $irc_client_path_lower )
+               irc_client_path_lower=$( tr '[A-Z]' '[a-z]' <<< $Irc_Client_Path )
+               App_Working_Name=${irc_client_path_lower##*/}
                # handles the xchat/sh/bash/dash cases, and the konversation/perl cases, where clients
                # report themselves as perl or unknown shell. IE:  when konversation starts inxi
                # from inside itself, as a script, the parent is konversation/xchat, not perl/bash etc
@@ -2847,11 +3321,16 @@ get_start_client()
                case $App_Working_Name in
                        # bsd will never use this section
                        bash|dash|sh|python*|perl*)     # We want to know who wrapped it into the shell or perl.
-                               pppid="$( ps -p $PPID -o ppid --no-headers | sed 's/[[:space:]]//g' )"
+                               if [[ $BSD_TYPE != 'bsd' ]];then
+                                       pppid=$( ps -p $PPID -o ppid --no-headers 2>/dev/null | gawk '{print $NF}' )
+                               else
+                                       # without --no-headers we need the second line
+                                       pppid=$( ps -p $PPID -o ppid 2>/dev/null | gawk '$1 ~ /^[0-9]+/ {print $5}' )
+                               fi
                                if [[ -n $pppid && -f /proc/$pppid/exe ]];then
                                        Irc_Client_Path="$( readlink /proc/$pppid/exe )"
-                                       irc_client_path_lower="$( tr '[:upper:]' '[:lower:]' <<< $Irc_Client_Path )"
-                                       App_Working_Name=$( basename $irc_client_path_lower )
+                                       irc_client_path_lower=$( tr '[A-Z]' '[a-z]' <<< $Irc_Client_Path )
+                                       App_Working_Name=${irc_client_path_lower##*/}
                                        B_Non_Native_App='true'
                                fi
                                ;;
@@ -2882,16 +3361,18 @@ get_start_client()
                                }' )"
                else
                        # this should handle certain cases where it's ssh or some other startup tool
-                       # that falls through all the other tests
+                       # that falls through all the other tests. Also bsd irc clients will land here
                        if [[ $BSD_TYPE != 'bsd' ]];then
                                App_Working_Name=$(ps -p $PPID --no-headers 2>/dev/null | gawk '{print $NF}' )
                        else
                                # without --no-headers we need the second line
-                               App_Working_Name=$(ps -p $PPID 2>/dev/null | gawk '/^[0-9]+/ {print $5}' )
+                               App_Working_Name=$(ps -p $PPID 2>/dev/null | gawk '$1 ~ /^[0-9]+/ {print $5}' )
                        fi
                        
                        if [[ -n $App_Working_Name ]];then
                                Irc_Client_Path=$App_Working_Name
+                               irc_client_path_lower=$( tr '[A-Z]' '[a-z]' <<< $Irc_Client_Path )
+                               App_Working_Name=${irc_client_path_lower##*/}
                                B_Non_Native_App='false'
                                get_irc_client_version
                                if [[ -z $IRC_CLIENT ]];then
@@ -2986,7 +3467,7 @@ get_irc_client_version()
                        B_CONSOLE_IRC='true'
                        IRC_CLIENT="ircII"
                        ;;
-               irssi-text|irssi)
+               irssi|irssi-text)
                        IRC_CLIENT_VERSION=" $( $Irc_Client_Path -v | gawk 'NR == 1 {
                                print $2
                        }' )"
@@ -3012,7 +3493,6 @@ get_irc_client_version()
                                }
                                exit
                        }' )"
-
                        T=($IRC_CLIENT_VERSION)
                        if [[ ${T[0]} == *+* ]];then
                                # < Sho_> locsmif: The version numbers of SVN versions look like this:
@@ -3034,7 +3514,7 @@ get_irc_client_version()
                        # Since Konversation 1.0, the DCOP interface has changed a bit: dcop "$DCPORT" Konversation ..etc
                        # becomes : dcop "$DCPORT" default ... or dcop "$DCPORT" irc ..etc. So we check for versions smaller
                        # than 1 and change the DCOP parameter/object accordingly.
-                       if [[ ${T2} -lt 1 ]];then
+                       if [[ $T2 -lt 1 ]];then
                                DCOPOBJ="Konversation"
                        fi
                        IRC_CLIENT="Konversation"
@@ -3067,24 +3547,33 @@ get_irc_client_version()
                        }' )"
                        IRC_CLIENT="Pidgin"
                        ;;
+               # possible failure of wildcard so make it explicit
                quassel*)
                        # sample: quassel -v
-                       # Qt: 4.5.0
+                       ## Qt: 4.5.0 - in Qt4 the output came from src/common/quassel.cpp
                        # KDE: 4.2.65 (KDE 4.2.65 (KDE 4.3 >= 20090226))
                        # Quassel IRC: v0.4.0 [+60] (git-22effe5)
                        # note: early < 0.4.1 quassels do not have -v
-                       IRC_CLIENT_VERSION=" $( $Irc_Client_Path -v 2>/dev/null | gawk -F ': ' '
+                       ## Qt: 5: sample: quassel -v
+                       # quassel v0.13-pre (0.12.0+5 git-8e2f578)
+                       # because in Qt5 the internal CommandLineParser is used 
+                       IRC_CLIENT_VERSION=" $( $Irc_Client_Path -v 2>/dev/null | gawk '
                        BEGIN {
                                IGNORECASE=1
                                clientVersion=""
                        }
-                       /Quassel IRC/ {
+                       # qt 4 -v syntax
+                       /^Quassel IRC:/ {
+                               clientVersion = $3
+                       }
+                       # qt 5 -v syntax
+                       /^quassel\s[v]?[0-9]/ {
                                clientVersion = $2
                        }
                        END {
                                # this handles pre 0.4.1 cases with no -v
                                if ( clientVersion == "" ) {
-                                       clientVersion = "(pre v0.4.1)"
+                                       clientVersion = "(pre v0.4.1)?"
                                }
                                print clientVersion
                        }' )"
@@ -3102,10 +3591,22 @@ get_irc_client_version()
                                        ;;
                        esac
                        ;;
-               weechat-curses)
+               gribble|limnoria|supybot)
+                       IRC_CLIENT_VERSION=" $( get_program_version 'supybot' '^Supybot' '2' )"
+                       if [[ -n $IRC_CLIENT_VERSION ]];then
+                               if [[ -n ${IRC_CLIENT_VERSION/*gribble*/} || $App_Working_Name == 'gribble' ]];then
+                                       IRC_CLIENT="Gribble"
+                               elif [[ -n ${IRC_CLIENT_VERSION/*limnoria*/} || $App_Working_Name == 'limnoria' ]];then
+                                       IRC_CLIENT="Limnoria"
+                               else
+                                       IRC_CLIENT="Supybot"
+                               fi
+                       fi
+                       ;;
+               weechat|weechat-curses)
                        IRC_CLIENT_VERSION=" $( $Irc_Client_Path -v ) "
                        B_CONSOLE_IRC='true'
-                       IRC_CLIENT="Weechat"
+                       IRC_CLIENT="WeeChat"
                        ;;
                xchat-gnome)
                        IRC_CLIENT_VERSION=" $( $Irc_Client_Path -v | gawk 'NR == 1 {
@@ -3147,11 +3648,11 @@ get_irc_client_version()
                                esac
                        done
                        B_CONSOLE_IRC='true'
-                       set_perl_python_konvi "$App_Working_Name"
+                       set_perl_python_client_data "$App_Working_Name"
                        ;;
                python*)
                        # B_CONSOLE_IRC='true' # are there even any python type console irc clients? check.
-                       set_perl_python_konvi "$App_Working_Name"
+                       set_perl_python_client_data "$App_Working_Name"
                        ;;
                # then unset, set unknown data
                *)      
@@ -3165,27 +3666,50 @@ get_irc_client_version()
 }
 
 # args: $1 - App_Working_Name
-set_perl_python_konvi()
+set_perl_python_client_data()
 {
        if [[ -z $IRC_CLIENT_VERSION ]];then
+               local version=''
                # this is a hack to try to show konversation if inxi is running but started via /cmd
-               if [[ -n $( grep -i 'konversation' <<< "$Ps_aux_Data" | grep -v 'grep' ) && $B_RUNNING_IN_DISPLAY == 'true' ]];then
+               # OR via script shortcuts, both cases in fact now
+               if [[  $B_RUNNING_IN_DISPLAY == 'true' && -z ${Ps_aux_Data/*konversation*/} ]];then
                        IRC_CLIENT='Konversation'
-                       IRC_CLIENT_VERSION=" $( konversation --version 2>/dev/null | gawk '/^Konversation/ {print $2}' )"
+                       version=$( get_program_version 'konversation' '^konversation' '2' )
                        B_CONSOLE_IRC='false'
+               ## NOTE: supybot only appears in ps aux using 'SHELL' command; the 'CALL' command
+               ## gives the user system irc priority, and you don't see supybot listed, so use SHELL
+               elif [[ $B_RUNNING_IN_DISPLAY == 'false' && -z ${Ps_aux_Data/*supybot*/} ]];then
+                       version=$( get_program_version 'supybot' '^Supybot' '2' )
+                       if [[ -n $version ]];then
+                               IRC_CLIENT_VERSION=" $version"
+                               if [[ -z ${version/*gribble*/} ]];then
+                                       IRC_CLIENT='Gribble'
+                               elif [[ -z ${version/*limnoria*/} ]];then
+                                       IRC_CLIENT='Limnoria'
+                               else
+                                       IRC_CLIENT='Supybot'
+                               fi
+                       else
+                               IRC_CLIENT='Supybot'
+                       # currently all use the same actual app name, this will probably change.
+                       fi
+                       B_CONSOLE_IRC='true'
                else
                        IRC_CLIENT="Unknown $1 client"
                fi
+               if [[ -n $version ]];then
+                       IRC_CLIENT_VERSION=" $version"
+               fi
        fi
 }
 
 ## try to infer the use of Konversation >= 1.2, which shows $PPID improperly
 ## no known method of finding Kovni >= 1.2 as parent process, so we look to see if it is running,
-## and all other irc clients are not running.  
+## and all other irc clients are not running. As of 2014-03-25 this isn't used in my cases
 is_this_qt4_konvi()
 {
        local konvi_qt4_client='' konvi_dbus_exist='' konvi_pid='' konvi_home_dir='' 
-       local konvi='' konvi_qt4_ver='' b_is_qt4=''
+       local konvi='' b_is_qt4=''
        
        # fringe cases can throw error, always if untested app, use 2>/dev/null after testing if present
        if [[ $B_QDBUS == 'true' ]];then
@@ -3198,11 +3722,10 @@ is_this_qt4_konvi()
                konvi=$( echo $konvi_home_dir | sed "s/\// /g" )
                konvi=($konvi)
 
-               if [[ ${konvi[2]} == 'konversation' ]];then     
-                       konvi_qt4_ver=$( konversation -v | grep -i 'konversation' )
+               if [[ ${konvi[2]} == 'konversation' ]];then
                        # note: we need to change this back to a single dot number, like 1.3, not 1.3.2
-                       konvi_qt4_client=$( echo "$konvi_qt4_ver" | gawk '{ print $2 }' | cut -d '.' -f 1,2 )
-
+                       konvi_qt4_client=$( konversation -v | grep -i 'konversation' | \
+                       gawk '{ print $2 }' | cut -d '.' -f 1,2 )
                        if [[ $konvi_qt4_client > 1.1 ]]; then
                                b_is_qt4='true'
                        fi
@@ -3256,7 +3779,7 @@ get_cmdline()
 get_audio_data()
 {
        eval $LOGFS
-       local i='' alsa_data='' audio_driver='' device_count='' temp_array=''
+       local i='' alsa_data='' audio_driver='' device_count='' a_temp=''
 
        IFS=$'\n'
        # this first step handles the drivers for cases where the second step fails to find one
@@ -3291,7 +3814,7 @@ get_audio_data()
                audioCard=gensub(/^[0-9a-f:\.]+ [^:]+: (.+)$/,"\\1","g",$0)
                # The doublequotes are necessary because of the pipes in the variable.
                gsub(/'"$BAN_LIST_NORMAL"'/, "", audioCard)
-               gsub(/,/, " ", audioCard)
+               gsub(/'"$BAN_LIST_ARRAY"'/, " ", audioCard)
                gsub(/^ +| +$/, "", audioCard)
                gsub(/ [ \t]+/, " ", audioCard)
                aPciBusId[audioCard] = gensub(/(^[0-9a-f:\.]+) [^:]+: .+$/,"\\1","g",$0)
@@ -3299,15 +3822,15 @@ get_audio_data()
 
                # loop until you get to the end of the data block
                while (getline && !/^$/) {
-                       gsub( /,/, "", $0 )
+                       gsub(/'"$BAN_LIST_ARRAY"'/, "", $0 )
                        if (/driver in use/) {
                                drivers[audioCard] = drivers[audioCard] gensub( /(.*): (.*)/ ,"\\2", "g" ,$0 ) ""
                        }
                        else if (/kernel modules:/) {
                                modules[audioCard] = modules[audioCard] gensub( /(.*): (.*)/ ,"\\2" ,"g" ,$0 ) ""
                        }
-                       else if (/I\/O/) {
-                               portsTemp = gensub(/\t*I\/O ports at (.*) \[.*\]/,"\\1","g",$0)
+                       else if (/^[[:space:]]*I\/O/) {
+                               portsTemp = gensub(/\t*I\/O ports at ([a-z0-9]+)(| \[.*\])/,"\\1","g",$0)
                                ports[audioCard] = ports[audioCard] portsTemp " "
                        }
                }
@@ -3374,8 +3897,8 @@ get_audio_data()
        if [[ ${#A_AUDIO_DATA[@]} -eq 0 ]];then
                A_AUDIO_DATA[0]='Failed to Detect Sound Card!'
        fi
-       temp_array=${A_AUDIO_DATA[@]}
-       log_function_data "A_AUDIO_DATA: $temp_array"
+       a_temp=${A_AUDIO_DATA[@]}
+       log_function_data "A_AUDIO_DATA: $a_temp"
 
        eval $LOGFE
 }
@@ -3384,16 +3907,15 @@ get_audio_data()
 get_audio_usb_data()
 {
        eval $LOGFS
-       local usb_proc_file='' array_count='' usb_data='' usb_id='' lsusb_path='' lsusb_data=''
-       local temp_array=''
+       local usb_proc_file='' array_count='' usb_data='' usb_id='' lsusb_data=''
+       local a_temp=''
        
        IFS=$'\n'
-       lsusb_path=$( type -p lsusb )
-       if [[ -n $lsusb_path ]];then
-               lsusb_data=$( $lsusb_path 2>/dev/null )
+       if type -p lsusb &>/dev/null;then
+               lsusb_data=$( lsusb 2>/dev/null )
        fi
        log_function_data 'raw' "usb_data:\n$lsusb_data"
-       if [[ -n $lsusb_data ]];then
+       if [[ -n $lsusb_data && -d /proc/asound/ ]];then
                # for every sound card symlink in /proc/asound - display information about it
                for usb_proc_file in /proc/asound/*
                do
@@ -3411,7 +3933,7 @@ get_audio_usb_data()
                                                separator=""
                                        }
                                        {
-                                               gsub( /,/, " ", $0 )
+                                               gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0 )
                                                gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
                                                gsub(/ [ \t]+/, " ", $0)
                                                for ( i=7; i<= NF; i++ ) {
@@ -3435,8 +3957,8 @@ get_audio_usb_data()
                done
        fi
        IFS="$ORIGINAL_IFS"
-       temp_array=${A_AUDIO_DATA[@]}
-       log_function_data "A_AUDIO_DATA: $temp_array"
+       a_temp=${A_AUDIO_DATA[@]}
+       log_function_data "A_AUDIO_DATA: $a_temp"
        
        eval $LOGFE
 }
@@ -3444,7 +3966,7 @@ get_audio_usb_data()
 get_audio_alsa_data()
 {
        eval $LOGFS
-       local alsa_data='' temp_array=''
+       local alsa_data='' a_temp=''
 
        # now we'll get the alsa data if the file exists
        if [[ $B_ASOUND_VERSION_FILE == 'true' ]];then
@@ -3459,8 +3981,8 @@ get_audio_alsa_data()
                        # some alsa strings have the build date in (...)
                        # remove trailing . and remove possible second line if compiled by user
                        $0 !~ /compile/ {
-                               gsub( /Driver | [(].*[)]|\.$/,"",$0 )
-                               gsub(/,/, " ", $0)
+                               gsub(/Driver | [(].*[)]|\.$/,"",$0 )
+                               gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0)
                                gsub(/^ +| +$/, "", $0)
                                gsub(/ [ \t]+/, " ", $0)
                                sub(/Advanced Linux Sound Architecture/, "ALSA", $0)
@@ -3473,55 +3995,315 @@ get_audio_alsa_data()
                IFS="$ORIGINAL_IFS"
                log_function_data 'cat' "$FILE_ASOUND_VERSION"
        fi
-       temp_array=${A_ALSA_DATA[@]}
-       log_function_data "A_ALSA_DATA: $temp_array"
+       a_temp=${A_ALSA_DATA[@]}
+       log_function_data "A_ALSA_DATA: $a_temp"
        eval $LOGFE
 }
 
-## create A_CPU_CORE_DATA, currently with two values: integer core count; core string text
-## return value cpu core count string, this helps resolve the multi redundant lines of old style output
-get_cpu_core_count()
+get_battery_data()
 {
        eval $LOGFS
-       local cpu_physical_count='' cpu_core_count='' cpu_type='' cpu_alpha_count=''
-       if [[ $B_CPUINFO_FILE == 'true' ]]; then
-               # load the A_CPU_TYPE_PCNT_CCNT core data array
-               get_cpu_ht_multicore_smp_data
-               ## Because of the upcoming release of cpus with core counts over 6, a count of cores is given after Deca (10)
-               # count the number of processors given
-               cpu_physical_count=${A_CPU_TYPE_PCNT_CCNT[1]}
-               cpu_core_count=${A_CPU_TYPE_PCNT_CCNT[2]}
-               cpu_type=${A_CPU_TYPE_PCNT_CCNT[0]}
-
-               # match the numberic value to an alpha value
-               cpu_alpha_count=$( get_cpu_core_count_alpha "$cpu_core_count" )
-               
-               # create array, core count integer; core count string
+       local a_temp='' id_file='' count=0
+       local id_dir='/sys/class/power_supply/' 
+       local ids=$( ls $id_dir 2>/dev/null )  battery_file='' 
+       
+       # ids='BAT0 BAT1 BAT2'
+       if [[ -n $ids && $B_FORCE_DMIDECODE == 'false' ]];then
+               for idx in $ids
+               do
+                       battery_file=$id_dir$idx'/uevent'
+                       if [[ -r $battery_file ]];then
+                               #  echo $battery_file
+                               count=$(( $count + 1 ))
+                               IFS=$'\n'
+                               battery_data=$( 
+                               gawk -F '=' '
+                               BEGIN {
+                                       IGNORECASE=1
+                                       name=""
+                                       status=""
+                                       present=""
+                                       chemistry=""
+                                       cycles=""
+                                       voltage_min_design=""
+                                       voltage_now=""
+                                       power_now=""
+                                       charge_full_design=""
+                                       charge_full=""
+                                       charge_now=""
+                                       capacity=""
+                                       capacity_level=""
+                                       model=""
+                                       company=""
+                                       serial=""
+                                       of_orig=""
+                                       location=""
+                               }
+                               {
+                                       gsub(/'"$BAN_LIST_NORMAL"'|,|battery|unknown/, "", $2)
+                                       gsub(/^ +| +$/, "", $2)
+                               }
+                               $1 ~ /^POWER_SUPPLY_NAME$/ {
+                                       name=$NF
+                               }
+                               $1 ~ /^POWER_SUPPLY_STATUS$/ {
+                                       status=$NF
+                               }
+                               $1 ~ /^POWER_SUPPLY$/ {
+                                       present=$NF
+                               }
+                               $1 ~ /^POWER_SUPPLY_TECHNOLOGY$/ {
+                                       chemistry=$NF
+                               }
+                               $1 ~ /^POWER_SUPPLY_CYCLE_COUNT$/ {
+                                       cycles=$NF
+                               }
+                               $1 ~ /^POWER_SUPPLY_VOLTAGE_MIN_DESIGN$/ {
+                                       voltage_min_design = $NF / 1000000
+                                       voltage_min_design = sprintf( "%.1f", voltage_min_design )
+                               }
+                               $1 ~ /^POWER_SUPPLY_VOLTAGE_NOW$/ {
+                                       voltage_now = $NF / 1000000
+                                       voltage_now = sprintf( "%.1f", voltage_now )
+                               }
+                               $1 ~ /^POWER_SUPPLY_POWER_NOW$/ {
+                                       power_now=$NF
+                               }
+                               $1 ~ /^POWER_SUPPLY_ENERGY_FULL_DESIGN$/ {
+                                       charge_full_design = $NF / 1000000
+                               }
+                               $1 ~ /^POWER_SUPPLY_ENERGY_FULL$/ {
+                                       charge_full = $NF / 1000000
+                               }
+                               $1 ~ /^POWER_SUPPLY_ENERGY_NOW$/ {
+                                       charge_now = $NF / 1000000
+                                       charge_now = sprintf( "%.1f", charge_now )
+                               }
+                               $1 ~ /^POWER_SUPPLY_CHARGE_FULL_DESIGN$/ {
+                                       charge_full_design = $NF / 100000
+                               }
+                               $1 ~ /^POWER_SUPPLY_CHARGE_FULL$/ {
+                                       charge_full = $NF / 100000
+                               }
+                               $1 ~ /^POWER_SUPPLY_CHARGE_NOW$/ {
+                                       charge_now = $NF / 100000
+                               }
+                               $1 ~ /^POWER_SUPPLY_CAPACITY$/ {
+                                       if ( $NF != "" ){
+                                               capacity=$NF "%"
+                                       }
+                               }
+                               $1 ~ /^POWER_SUPPLY_CAPACITY_LEVEL$/ {
+                                       capacity_level=$NF
+                               }
+                               $1 ~ /^POWER_SUPPLY_MODEL_NAME$/ {
+                                       model=$NF
+                               }
+                               $1 ~ /^POWER_SUPPLY_MANUFACTURER$/ {
+                                       company=$NF
+                               }
+                               $1 ~ /^POWER_SUPPLY_SERIAL_NUMBER$/ {
+                                       serial=$NF
+                               }
+                               END {
+                                       if (charge_now != "" && charge_full != "" ){
+                                               capacity = 100*charge_now/charge_full
+                                               capacity = sprintf( "%.1f%", capacity )
+                                       }
+                                       if (charge_full_design != "" && charge_full != "" ){
+                                               of_orig=100*charge_full/charge_full_design
+                                               of_orig = sprintf( "%.0f%", of_orig )
+                                       }
+                                       if (charge_now != "" ){
+                                               charge_now = sprintf( "%.1f", charge_now )
+                                       }
+                                       if (charge_full_design != "" ){
+                                               charge_full_design = sprintf( "%.1f", charge_full_design )
+                                       }
+                                       if ( charge_full != "" ){
+                                               charge_full = sprintf( "%.1f", charge_full )
+                                       }
+                                       entry = name "," status "," present "," chemistry "," cycles "," voltage_min_design "," voltage_now "," 
+                                       entry = entry power_now "," charge_full_design "," charge_full "," charge_now "," capacity "," 
+                                       entry = entry capacity_level "," of_orig "," model "," company "," serial "," location
+                                       print entry
+                               }' < $battery_file )
+                               # <<< "$data" )
+                               # < $battery_file ) 
+                               A_BATTERY_DATA[$count]=$battery_data
+                               IFS="$ORIGINAL_IFS"
+                       fi
+               done
+       elif [[ $B_FORCE_DMIDECODE == 'true'  ]] || [[ ! -d $id_dir && -z $ids ]];then
+               get_dmidecode_data
+               if [[ -n $DMIDECODE_DATA ]];then
+                       if [[ $DMIDECODE_DATA == 'dmidecode-error-'* ]];then
+                               A_BATTERY_DATA[0]=$DMIDECODE_DATA
+                       # please note: only dmidecode version 2.11 or newer supports consistently the -s flag
+                       else
+                               IFS=$'\n'
+                               # NOTE: this logic has a flaw, which is multiple batteries, which won't work without
+                               # gawk arrays, but sorry, too much of a pain given how little useful data from dmidecode
+                               A_BATTERY_DATA=( $( gawk -F ':' '
+                               BEGIN {
+                                       IGNORECASE=1
+                                       name=""
+                                       status=""
+                                       present=""
+                                       chemistry=""
+                                       cycles=""
+                                       voltage_min_design=""
+                                       voltage_now=""
+                                       power_now=""
+                                       charge_full_design=""
+                                       charge_full=""
+                                       charge_now=""
+                                       capacity=""
+                                       capacity_level=""
+                                       model=""
+                                       company=""
+                                       serial=""
+                                       of_orig=""
+                                       location=""
+                                       bItemFound="false"
+                               }
+                               {
+                                       gsub(/'"$BAN_LIST_NORMAL"'|,|battery|unknown/, "", $2)
+                                       gsub(/^ +| +$/, "", $1)
+                                       gsub(/^ +| +$/, "", $2)
+                               }
+                               /^Portable Battery/ {
+                                       while ( getline && !/^$/ ) {
+                                               if ( $1 ~ /^Location/ ) { location=$2 }
+                                               if ( $1 ~ /^Manufacturer/ ) { company=$2 }
+                                               if ( $1 ~ /^Serial/ ) { serial=$2 }
+                                               if ( $1 ~ /^Name/ ) { model=$2 }
+                                               if ( $1 ~ /^Design Capacity/ ) { 
+                                                       sub(/^[[:space:]]*mwh/, "", $2)
+                                                       charge_full_design = $NF / 1000
+                                                       charge_full_design = sprintf( "%.1f", charge_full_design )
+                                               }
+                                               if ( $1 ~ /^Design Voltage/ ) { 
+                                                       sub(/^[[:space:]]*mv/, "", $2)
+                                                       voltage_min_design = $NF / 1000
+                                                       voltage_min_design = sprintf( "%.1f", voltage_min_design )
+                                               }
+                                               if ( $1 ~ /^SBDS Chemistry/ ) { chemistry=$2 }
+                                       }
+                                       testString=company serial model charge_full_design voltage_min_design
+                                       if ( testString != ""  ) {
+                                               bItemFound="true"
+                                               exit # exit loop, we are not handling > 1 batteries
+                                       }
+                               }
+                               END {
+                                       if ( bItemFound == "true" ) {
+                                               name="BAT-1"
+                                               if (charge_now != "" && charge_full != "" ){
+                                                       capacity = 100*charge_now/charge_full
+                                                       capacity = sprintf( "%.1f%", capacity )
+                                               }
+                                               if (charge_full_design != "" && charge_full != "" ){
+                                                       of_orig=100*charge_full/charge_full_design
+                                                       of_orig = sprintf( "%.0f%", of_orig )
+                                               }
+                                               entry = name "," status "," present "," chemistry "," cycles "," voltage_min_design "," voltage_now "," 
+                                               entry = entry power_now "," charge_full_design "," charge_full "," charge_now "," capacity "," 
+                                               entry = entry capacity_level "," of_orig "," model "," company "," serial "," location
+                                               print entry
+                                       }
+                               }' <<< "$DMIDECODE_DATA" ) )
+                               IFS="$ORIGINAL_IFS"
+                       fi
+               fi
+       fi
+       # echo $array_string
+       
+       #echo ${#A_BATTERY_DATA[@]}
+       a_temp=${A_BATTERY_DATA[@]}
+       
+       # echo $a_temp
+       log_function_data "A_BATTERY_DATA: $a_temp"
+       eval $LOGFE
+}
+
+## create A_CPU_CORE_DATA, currently with two values: integer core count; core string text
+## return value cpu core count string, this helps resolve the multi redundant lines of old style output
+get_cpu_core_count()
+{
+       eval $LOGFS
+       local cpu_physical_count='' cpu_core_count='' cpu_type='' cpu_alpha_count='' cores_per_cpu=''
+       local array_data=''
+       
+       if [[ $B_CPUINFO_FILE == 'true' ]]; then
+               # load the A_CPU_TYPE_PCNT_CCNT core data array
+               get_cpu_ht_multicore_smp_data
+               ## Because of the upcoming release of cpus with core counts over 6, a count of cores is given after Deca (10)
+               # count the number of processors given
+               cpu_physical_count=${A_CPU_TYPE_PCNT_CCNT[1]}
+               cpu_core_count=${A_CPU_TYPE_PCNT_CCNT[2]}
+               cpu_type=${A_CPU_TYPE_PCNT_CCNT[0]}
+
+               # match the numberic value to an alpha value
+               cpu_alpha_count=$( get_cpu_core_count_alpha "$cpu_core_count" )
+               
+               # create array, core count integer; core count string
                # A_CPU_CORE_DATA=( "$cpu_core_count" "$cpu_alpha_count Core$cpu_type" )
-               A_CPU_CORE_DATA=( "$cpu_physical_count" "$cpu_alpha_count" "$cpu_type" "$cpu_core_count" )
+               array_data="$cpu_physical_count,$cpu_alpha_count,$cpu_type,$cpu_core_count"
+               IFS=','
+               A_CPU_CORE_DATA=( $array_data )
+               IFS="$ORIGINAL_IFS"
        elif [[ -n $BSD_TYPE ]];then
                local gawk_fs=': '
        
                if [[ $BSD_VERSION == 'openbsd' ]];then
                        gawk_fs='='
                fi
-               cpu_core_count=$( gawk -F "$gawk_fs" '
+               cpu_core_count=$( gawk -F "$gawk_fs" -v bsdVersion="$BSD_VERSION" '
                # note: on openbsd can also be hw.ncpufound so exit after first
-               /^hw.ncpu/ {
+               BEGIN {
+                       coreCount=""
+               }
+               $1 ~ /^hw.ncpu$/ {
+                       coreCount=$NF
+               }
+               /^machdep.cpu.core_count/ {
+                       coreCount=$NF
+               }
+               END {
+                       print coreCount
+               }' <<< "$Sysctl_a_Data" )
+               cores_per_cpu=$( gawk -F "$gawk_fs" '
+               /^machdep.cpu.cores_per_package/ {
                        print $NF
-                       exit
                }' <<< "$Sysctl_a_Data" )
+               
                if [[ -n $( grep -E '^[0-9]+$' <<< "$cpu_core_count" ) ]];then
                        cpu_alpha_count=$( get_cpu_core_count_alpha "$cpu_core_count" )
                        if [[ $cpu_core_count -gt 1 ]];then
-                               cpu_type='SMP'
+                               cpu_type='-SMP-'
+                       else
+                               cpu_type='-UP-'
                        fi
                fi
-               cpu_physical_count=1
-               A_CPU_CORE_DATA=( "$cpu_physical_count" "$cpu_alpha_count" "$cpu_type" "$cpu_core_count" )
+               if [[ -n $cores_per_cpu ]];then
+                       cpu_physical_count=$(( $cpu_core_count / $cores_per_cpu ))
+                       if [[ $cores_per_cpu -gt 1 ]];then
+                               cpu_type='-MCP-'
+                       fi
+               # do not guess here, only use phys count if it actually exists, otherwise handle in print_cpu..
+               # this 1 value should not be used for output, and is just to avoid math errors
+               else
+                       cpu_physical_count=1
+               fi
+               array_data="$cpu_physical_count,$cpu_alpha_count,$cpu_type,$cpu_core_count"
+               IFS=','
+               A_CPU_CORE_DATA=( $array_data )
+               IFS="$ORIGINAL_IFS"
        fi
-       temp_array=${A_CPU_CORE_DATA[@]}
-       log_function_data "A_CPU_CORE_DATA: $temp_array"
+       a_temp=${A_CPU_CORE_DATA[@]}
+       # echo $a_temp :: ${#A_CPU_CORE_DATA[@]}
+       log_function_data "A_CPU_CORE_DATA: $a_temp"
        eval $LOGFE
 }
 
@@ -3554,27 +4336,39 @@ get_cpu_core_count_alpha()
 get_cpu_data()
 {
        eval $LOGFS
-       local i='' j='' cpu_array_nu='' a_cpu_working='' multi_cpu='' bits='' temp_array=''
-       local bsd_cpu_flags=''
+       local i='' j='' cpu_array_nu='' a_cpu_working='' multi_cpu='' bits='' a_temp=''
+       local bsd_cpu_flags='' min_speed='' max_speed=''
+       
+       if [[ -f  /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq ]];then
+               max_speed=$(cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq)
+               if [[ -f  /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq ]];then
+                       min_speed=$(cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq)
+               fi
+       fi
 
        if [[ $B_CPUINFO_FILE == 'true' ]];then
                # stop script for a bit to let cpu slow down before parsing cpu /proc file
                sleep $CPU_SLEEP
                IFS=$'\n'
                A_CPU_DATA=( $( 
-               gawk -F': ' '
+               gawk -v cpuMin="$min_speed" -v cpuMax="$max_speed" -F': ' '
                BEGIN {
                        IGNORECASE=1
                        # need to prime nr for arm cpus, which do not have processor number output in some cases
                        nr = 0
                        count = 0
                        bArm = "false"
+                       # ARM cpus are erratic in /proc/cpuinfo this hack can sometimes resolve it. Linux only.
+                       sysSpeed="'$(get_cpu_speed_hack)'"
+                       speed = 0
+                       max = 0
+                       min = 0
                }
                # TAKE STRONGER NOTE: \t+ does NOT always work, MUST be [ \t]+
                # TAKE NOTE: \t+ will work for $FILE_CPUINFO, but SOME ARBITRARY FILE used for TESTING might contain SPACES!
                # Therefore PATCH to use [ \t]+ when TESTING!
                /^processor[ \t]+:/ {
-                       gsub(/,/, " ", $NF)
+                       gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF)
                        gsub(/^ +| +$/, "", $NF)
                        if ( $NF ~ "^[0-9]+$" ) {
                                nr = $NF
@@ -3588,11 +4382,10 @@ get_cpu_data()
                                cpu[nr, "model"] = $NF
                        }
                }
-
                /^model name|^cpu\t+:/ {
                        gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
                        gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
-                       gsub(/,/, " ", $NF)
+                       gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF)
                        gsub(/^ +| +$/, "", $NF)
                        gsub(/ [ \t]+/, " ", $NF)
                        cpu[nr, "model"] = $NF
@@ -3600,17 +4393,15 @@ get_cpu_data()
                                bArm = "true"
                        }
                }
-
                /^cpu MHz|^clock\t+:/ {
-                       if (!min) {
-                               min = $NF
+                       if (speed == 0) {
+                               speed = $NF
                        }
                        else {
-                               if ($NF < min) {
-                                       min = $NF
+                               if ($NF < speed) {
+                                       speed = $NF
                                }
                        }
-
                        if ($NF > max) {
                                max = $NF
                        }
@@ -3618,11 +4409,9 @@ get_cpu_data()
                        gsub(/.00[0]+$/,".00",$NF) ## clears out excessive zeros
                        cpu[nr, "speed"] = $NF
                }
-
                /^cache size/ {
                        cpu[nr, "cache"] = $NF
                }
-
                /^flags|^features/ {
                        cpu[nr, "flags"] = $NF
                        # not all ARM cpus show ARM in model name
@@ -3630,101 +4419,202 @@ get_cpu_data()
                                bArm = "true"
                        }
                }
-
                /^bogomips/ {
                        cpu[nr, "bogomips"] = $NF
                }
-
                /vendor_id/ {
                        gsub(/genuine|authentic/,"",$NF)
                        cpu[nr, "vendor"] = tolower( $NF )
                }
-
                END {
                        #if (!nr) { print ",,,"; exit } # <- should this be necessary or should bash handle that
                        for ( i = 0; i <= nr; i++ ) {
                                # note: assuming bogomips for arm at 1 x clock
                                # http://en.wikipedia.org/wiki/BogoMips ARM could change so watch this
                                # maybe add:  && bArm == "true" but I think most of the bogomips roughly equal cpu speed if not amd/intel
-                               if ( cpu[i, "bogomips"] != "" && cpu[i, "speed"] == "" ) {
+                               # 2014-04-08: trying to use sysSpeed hack first, that is more accurate anyway.
+                               if ( ( cpu[i, "speed"] == "" && sysSpeed != "" ) || \
+                               ( cpu[i, "speed"] == "" && cpu[i, "bogomips"] != "" && cpu[i, "bogomips"] < 50  ) ) {
+                                       cpu[i, "speed"] = sysSpeed
+                               }
+                               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
                        }
-                       # this is / was used in inxi short output only, but when it is N/A, need to use the previous array
-                       # value, from above, the actual speed that is, for short output, key 0.
-                       if (!min) {
-                               print "N/A"
-                               exit
+                       if (cpuMin != "") {
+                               min=cpuMin/1000
+                       }
+                       if (cpuMax != "") {
+                               max=cpuMax/1000
+                       }
+                       # create last array index, to be used for min/max output
+                       sub(/\.[0-9]+$/,"",max)
+                       sub(/\.[0-9]+$/,"",speed)
+                       sub(/\.[0-9]+$/,"",min)
+                       if (speed == 0) {
+                               print "N/A," min "," max
                        }
                        else {
-                               if (min != max) {
-                                       printf("Min:%s%s Max:%s%s\n", min, "Mhz", max, "Mhz")
-                               }
-                               else {
-                                       printf("%s %s\n", max, "Mhz")
-                               }
+                               print speed "," min "," max 
                        }
-               }
-               ' $FILE_CPUINFO ) )
+               } 
+               ' $FILE_CPUINFO ) )
+               
                IFS="$ORIGINAL_IFS"
                log_function_data 'cat' "$FILE_CPUINFO"
        elif [[ -n $BSD_TYPE ]];then
                get_cpu_data_bsd
        fi
        
-       temp_array=${A_CPU_DATA[@]}
-       log_function_data "A_CPU_DATA: $temp_array"
-#      echo ta: ${temp_array[@]}
+       a_temp=${A_CPU_DATA[@]}
+       log_function_data "A_CPU_DATA: $a_temp"
+#      echo ta: ${a_temp[@]}
        eval $LOGFE
 #      echo getMainCpu: ${[@]}
 }
+# this triggers in one and only one case, ARM cpus that have fake bogomips data
+get_cpu_speed_hack()
+{
+       local speed=$( cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq 2>/dev/null )
+       
+       if [[ -n $speed ]];then
+               speed=${speed%[0-9][0-9][0-9]} # trim off last 3 digits
+       fi
+       echo $speed
+}
 
 get_cpu_data_bsd()
 {
        eval $LOGFS
 
        local bsd_cpu_flags=$( get_cpu_flags_bsd )
-       local gawk_fs=': '
+       local gawk_fs=': ' cpu_max=''
        
        if [[ $BSD_VERSION == 'openbsd' ]];then
                gawk_fs='='
        fi
-               
-       IFS=$'\n'
-       A_CPU_DATA=( $( 
-       gawk -F "$gawk_fs" -v cpuFlags="$bsd_cpu_flags" '
-       BEGIN {
-               IGNORECASE=1
-               cpuModel=""
-               cpuClock=""
-               cpuCache=""
-               cpuBogomips=""
-               cpuVendor=""
-       }
-       /^hw.model/ {
-               gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
-               gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
-               sub(//,"",$NF)
-               sub(/[a-z]+-core/, "", $NF )
-               gsub(/^ +| +$|\"/, "", $NF)
-               gsub(/ [ \t]+/, " ", $NF)
-               cpuModel=$NF
-               if ( cpuClock != "" ) {
-                       exit
+       # avoid setting this for systems where you have no read/execute permissions
+       # might be cases where the dmesg boot file was readable but sysctl perms failed
+       if [[ -n $Sysctl_a_Data || -n $bsd_cpu_flags ]];then
+               if [[ -n $Dmesg_Boot_Data ]];then
+                       cpu_max=$( gawk -F ':' '
+                       BEGIN {
+                       IGNORECASE=1
+                       }
+                       # NOTE: freebsd may say: 2300-MHz, so check for dash as well
+                       $1 ~ /^(CPU|cpu0)$/ {
+                               if ( $NF ~ /[^0-9\.][0-9\.]+[\-[:space:]]*[MG]Hz/) {
+                                       max=gensub(/.*[^0-9\.]([0-9\.]+[\-[:space:]]*[MG]Hz).*/,"\\1",1,$NF)
+                                       if (max ~ /MHz/) {
+                                               sub(/[-[:space:]]*MHz/,"",max)
+                                       }
+                                       if (max ~ /GHz/) {
+                                               sub(/[-[:space:]]*GHz/,"",max)
+                                               max=max*1000
+                                       }
+                                       print max
+                                       exit
+                               }
+                       }' <<< "$Dmesg_Boot_Data" )
+               fi
+               IFS=$'\n'
+               A_CPU_DATA=( $( 
+               gawk -F "$gawk_fs" -v bsdVersion=$BSD_VERSION -v cpuFlags="$bsd_cpu_flags" -v cpuMax="$cpu_max" '
+               BEGIN {
+                       IGNORECASE=1
+                       cpuModel=""
+                       cpuClock=""
+                       cpuCache=""
+                       cpuBogomips=""
+                       cpuVendor=""
+                       bSwitchFs="false"
+                       min=0
+                       max=0
                }
-       }
-       /^hw.(clock|cpuspeed)/ {
-               cpuClock=$NF
-               if ( cpuModel != "" ) {
-                       exit
+               /^hw.model/ && ( bsdVersion != "darwin" ) {
+                       gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
+                       gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
+                       gsub(/'"$BAN_LIST_ARRAY"'/," ",$NF)
+                       sub(/[a-z]+-core/, "", $NF )
+                       gsub(/^ +| +$|\"/, "", $NF)
+                       gsub(/ [ \t]+/, " ", $NF)
+                       # cut L2 cache/cpu max speed out of model string, if available
+                       if ( $NF ~ /[0-9]+[[:space:]]*[KM]B[[:space:]]+L2 cache/) {
+                               cpuCache=gensub(/.*[^0-9]([0-9]+[[:space:]]*[KM]B)[[:space:]]+L2 cach.*/,"\\1",1,$NF)
+                       }
+                       if ( $NF ~ /[^0-9\.][0-9\.]+[\-[:space:]]*[MG]Hz/) {
+                               max=gensub(/.*[^0-9\.]([0-9\.]+[\-[:space:]]*[MG]Hz).*/,"\\1",1,$NF)
+                               if (max ~ /MHz/) {
+                                       sub(/[\-[:space:]]*MHz/,"",max)
+                               }
+                               if (max ~ /GHz/) {
+                                       sub(/[\-[:space:]]*GHz/,"",max)
+                                       max=max*1000
+                               }
+                       }
+                       if ( $NF ~ /\)$/ ){
+                               sub(/[[:space:]]*\(.*\)$/,"",$NF)
+                       }
+                       cpuModel=$NF
+#                      if ( cpuClock != "" ) {
+#                              exit
+#                      }
                }
-       }
-       END {
-               print cpuModel "," cpuClock "," cpuCache "," cpuFlags "," cpuBogomips ","  cpuVendor
-               print "N/A"
-       }' <<< "$Sysctl_a_Data" ) )
-       IFS="$ORIGINAL_IFS"
+               /^hw.clock/ {
+                       cpuClock=$NF
+#                      if ( cpuModel != "" ) {
+#                              exit
+#                      }
+               }
+               /^hw.cpufrequency/ {
+                       cpuClock = $NF / 1000000
+               }
+               /^hw.cpuspeed/ {
+                       cpuClock=$NF
+               }
+               /^hw.l2cachesize/ {
+                       cpuCache=$NF/1024
+                       cpuCache=cpuCache " kB"
+               }
+               /^machdep.cpu.vendor/ {
+                       cpuVendor=$NF
+               }
+               # Freebsd does some voltage hacking to actually run at lowest listed frequencies.
+               # The cpu does not actually support all the speeds output here but works in freebsd. 
+               /^dev.cpu.0.freq_levels/ {
+                       gsub(/^[[:space:]]+|\/[0-9]+|[[:space:]]+$/,"",$NF)
+                       if ( $NF ~ /[0-9]+[[:space:]]+[0-9]+/ ) {
+                               min=gensub(/.*[[:space:]]([0-9]+)$/,"\\1",1,$NF)
+                               max=gensub(/^([0-9]+)[[:space:]].*/,"\\1",1,$NF)
+                       }
+               }
+               /^machdep.cpu.brand_string/ {
+                       gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
+                       gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
+                       gsub(/'"$BAN_LIST_ARRAY"'/," ",$NF)
+                       sub(/[a-z]+-core/, "", $NF )
+                       gsub(/^ +| +$|\"/, "", $NF)
+                       gsub(/ [ \t]+/, " ", $NF)
+                       sub(/[[:space:]]*@.*/,"",$NF)
+                       cpuModel=$NF
+               }
+               END {
+                       if ( max == 0 && cpuMax != "" ) {
+                               max=cpuMax
+                       }
+                       if ( cpuClock == "" ) {
+                               cpuClock="N/A"
+                       }
+                       sub(/\.[0-9]+/,"",cpuClock)
+                       sub(/\.[0-9]+/,"",min)
+                       sub(/\.[0-9]+/,"",max)
+                       print cpuModel "," cpuClock "," cpuCache "," cpuFlags "," cpuBogomips ","  cpuVendor
+                       # triggers print case
+                       print cpuClock "," min "," max
+               }' <<< "$Sysctl_a_Data" ) )
+               IFS="$ORIGINAL_IFS"
+       fi
        
        eval $LOGFE
 }
@@ -3733,27 +4623,44 @@ get_cpu_flags_bsd()
 {
        eval $LOGFS
        
-       local cpu_flags=$( gawk -F '=' '
-       BEGIN {
-               IGNORECASE=1
-               cpuFlags=""
-       }
-       /^CPU:/ {
-               while ( getline && !/memory/  ) {
-                       if ( $1 ~ /Features/ ) {
-                               # clean up odd stuff like <b23>
-                               gsub(/<[a-z0-9]+>/,"", $2)
-                               # all the flags are contained within < ... > on freebsd at least
-                               gsub(/.*<|>.*/,"", $2)
-                               gsub(/,/," ", $2)
-                               cpuFlags = cpuFlags " " $2
-                       }
-               }
-               cpuFlags=tolower(cpuFlags)
-               print cpuFlags
-               exit
-       }' <<< "$Dmesg_Boot_Data" )
+       local cpu_flags=''
+       local gawk_fs=':'
        
+       if [[ -n $Dmesg_Boot_Data ]];then
+               cpu_flags=$( gawk -v bsdVersion="$BSD_VERSION" -F ":" '
+               BEGIN {
+                       IGNORECASE=1
+                       cpuFlags=""
+               }
+               /^(CPU:|cpu0:)/ {
+                       while ( getline && !/memory|real mem/  ) {
+                               if ( $1 ~ /Features/ || ( bsdVersion == "openbsd" && $0 ~ /^cpu0.*[[:space:]][a-z][a-z][a-z][[:space:]][a-z][a-z][a-z][[:space:]]/ ) ) {
+                                       # clean up odd stuff like <b23>
+                                       gsub(/<[a-z0-9]+>/,"", $2)
+                                       # all the flags are contained within < ... > on freebsd at least
+                                       gsub(/.*<|>.*/,"", $2)
+                                       gsub(/'"$BAN_LIST_ARRAY"'/," ", $2)
+                                       cpuFlags = cpuFlags " " $2
+                               }
+                       }
+                       cpuFlags=tolower(cpuFlags)
+                       print cpuFlags
+                       exit
+               }' <<< "$Dmesg_Boot_Data" )
+       elif [[ -n $Sysctl_a_Data ]];then
+               if [[ $BSD_VERSION == 'openbsd' ]];then
+                       gawk_fs=':'
+               fi
+               cpu_flags=$( gawk -F "$gawk_fs" '
+               BEGIN {
+                       cpuFlags=""
+               }
+               /^machdep.cpu.features/ {
+                       cpuFlags=tolower($NF)
+                       print cpuFlags
+                       exit
+               }' <<< "$Sysctl_a_Data" )
+       fi
        echo $cpu_flags
        log_function_data "$cpu_flags"
        eval $LOGFE
@@ -3764,7 +4671,7 @@ get_cpu_ht_multicore_smp_data()
 {
        eval $LOGFS
        # in /proc/cpuinfo
-       local temp_array=''
+       local a_temp=''
        
        # note: known bug with xeon intel, they show a_core_id/physical_id as 0 for ht 4 core
        if [[ $B_CPUINFO_FILE == 'true' ]]; then
@@ -3807,9 +4714,8 @@ get_cpu_ht_multicore_smp_data()
                        }
                }
                # array of logical processors, both HT and physical
-               
                /^processor/ {
-                       gsub(/,/, " ", $NF)
+                       gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF)
                        gsub(/^ +| +$/, "", $NF)
                        if ( $NF ~ "^[0-9]+$" ) {
                                a_processor_id[proc_iter] = $NF
@@ -3827,7 +4733,6 @@ get_cpu_ht_multicore_smp_data()
                                a_processor_id[proc_iter] = nr
                        }
                }
-               
                # array of physical cpu ids, note, this will be unset for vm cpus in many cases
                # because they have no physical cpu, so we cannot assume this will be here.
                /^physical/ {
@@ -3862,7 +4767,6 @@ get_cpu_ht_multicore_smp_data()
                        for ( i in a_physical_id ) {
                                num_of_physical_cpus++
                        }
-                       
                        i = 0
                        ## count unique cores ##
                        for ( i in a_core_id ) {
@@ -3922,8 +4826,8 @@ get_cpu_ht_multicore_smp_data()
                }
                ' $FILE_CPUINFO ) )
        fi
-       temp_array=${A_CPU_TYPE_PCNT_CCNT[@]}
-       log_function_data "A_CPU_TYPE_PCNT_CCNT: $temp_array"
+       a_temp=${A_CPU_TYPE_PCNT_CCNT[@]}
+       log_function_data "A_CPU_TYPE_PCNT_CCNT: $a_temp"
        eval $LOGFE
 }
 
@@ -3936,31 +4840,52 @@ get_desktop_environment()
        eval $LOGFS
        
        # set the default, this function only runs in X, if null, don't print data out
-       local desktop_environment='' xprop_root=''
-       local version='' version_data='' toolkit=''
+       local desktop_environment='' xprop_root='' version2=''
+       local version='' version_data='' version2_data='' toolkit=''
 
        # works on 4, assume 5 will id the same, why not, no need to update in future
        # KDE_SESSION_VERSION is the integer version of the desktop
+       # NOTE: as of plasma 5, the tool: about-distro MAY be available, that will show
+       # actual desktop data, so once that's in debian/ubuntu, if it gets in, add that test
        if [[ $XDG_CURRENT_DESKTOP == 'KDE' || -n $KDE_SESSION_VERSION ]]; then
                # note the command is actually like, kded4 --version, so we construct it
-               version_data=$( kded$KDE_SESSION_VERSION --version 2>/dev/null )
-               version=$( grep -si '^KDE Development Platform:' <<< "$version_data" | gawk '{print $4}' )
+               # this was supposed to extend to 5, but 5 changed it, so it uses the more reliable way
+               if [[ $KDE_SESSION_VERSION -le 4 ]];then
+                       version_data=$( kded$KDE_SESSION_VERSION --version 2>/dev/null )
+                       version=$( grep -si '^KDE Development Platform:' <<< "$version_data" | gawk '{print $4}' )
+               else
+                       # NOTE: this command string is almost certain to change, and break, with next major plasma desktop, ie, 6
+                       # version=$( qdbus org.kde.plasmashell /MainApplication org.qtproject.Qt.QCoreApplication.applicationVersion 2>/dev/null )
+                       #Qt: 5.4.2
+                       #KDE Frameworks: 5.11.0
+                       #kf5-config: 1.0
+                       # for QT, and Frameworks if we use it
+                       if type -p kf$KDE_SESSION_VERSION-config &>/dev/null;then
+                               version_data=$( kf$KDE_SESSION_VERSION-config --version 2>/dev/null )
+                               # version=$( grep -si '^KDE Frameworks:' <<< "$version_data" | gawk '{print $NF}' )
+                       fi
+                       # plasmashell 5.3.90
+                       if type -p plasmashell &>/dev/null;then
+                               version2_data=$( plasmashell --version 2>/dev/null )
+                               version=$( grep -si '^plasmashell' <<< "$version2_data" | gawk '{print $NF}' )
+                       fi
+               fi
                if [[ -z $version ]];then
                        version=$KDE_SESSION_VERSION
                fi
-               if [[ $B_EXTRA_DATA == 'true' ]];then
+               if [[ $B_EXTRA_DATA == 'true' && -n $version_data ]];then
                        toolkit=$( grep -si '^Qt:' <<< "$version_data" | gawk '{print $2}' )
                        if [[ -n $toolkit ]];then
                                version="$version (Qt $toolkit)"
                        fi
                fi
-               desktop_environment="KDE"
+               desktop_environment="KDE Plasma"
        # KDE_FULL_SESSION property is only available since KDE 3.5.5.
        # src: http://humanreadable.nfshost.com/files/startkde
        elif [[ $KDE_FULL_SESSION == 'true' ]]; then
                version_data=$( kded --version 2>/dev/null )
                version=$( grep -si '^KDE:' <<< "$version_data" | gawk '{print $2}' )
-               # version=$( get_de_app_version 'kded' '^KDE:' '2' )
+               # version=$( get_program_version 'kded' '^KDE:' '2' )
                if [[ -z $version ]];then
                        version='3.5'
                fi
@@ -3972,22 +4897,52 @@ get_desktop_environment()
                fi
                desktop_environment="KDE"
        elif [[ $XDG_CURRENT_DESKTOP == 'Unity' ]];then
-               version=$( get_de_app_version 'unity' '^unity' '2' )
-               # not certain cinn will always have version, so keep output right if not
+               version=$( get_program_version 'unity' '^unity' '2' )
+               # not certain will always have version, so keep output right if not
                if [[ -n $version ]];then
                        version="$version "
                fi
                if [[ $B_EXTRA_DATA == 'true' ]];then
                        toolkit=$( get_de_gtk_data )
                        if [[ -n $toolkit ]];then
-                               version="${version}(Gtk ${toolkit})"
+                               version="$version(Gtk $toolkit)"
                        fi
                fi
                desktop_environment="Unity"
+       elif [[ $XDG_CURRENT_DESKTOP == 'LXQt' ]];then
+#              if type -p lxqt-about &>/dev/null;then
+#                      version=$( get_program_version 'lxqt-about' '^lxqt-about' '2' )
+#              fi
+               if [[ $B_EXTRA_DATA == 'true' ]];then
+                       if kded$KDE_SESSION_VERSION &>/dev/null;then
+                               version_data=$( kded$KDE_SESSION_VERSION --version 2>/dev/null )
+                               toolkit=$( grep -si '^Qt:' <<< "$version_data" | gawk '{print $2}' )
+                       elif type -p qtdiag &>/dev/null;then
+                               toolkit=$( get_program_version 'qtdiag' '^qt' '2' )
+                       fi
+                       if [[ -n $toolkit ]];then
+                               version="$version (Qt $toolkit)"
+                       fi
+               fi
+               desktop_environment='LXQt'
+       # note, X-Cinnamon value strikes me as highly likely to change, so just search for the last part
+       elif [[ -n $XDG_CURRENT_DESKTOP && -z ${XDG_CURRENT_DESKTOP/*innamon*/} ]];then
+               version=$( get_program_version 'cinnamon' '^cinnamon' '2' )
+               # not certain cinn will always have version, so keep output right if not
+               if [[ -n $version ]];then
+                       version="$version "
+               fi
+               if [[ $B_EXTRA_DATA == 'true' ]];then
+                       toolkit=$( get_de_gtk_data )
+                       if [[ -n $toolkit ]];then
+                               version="$version(Gtk $toolkit)"
+                       fi
+               fi
+               desktop_environment="Cinnamon"
        fi
        # did we find it? If not, start the xprop tests
        if [[ -z $desktop_environment ]];then
-               if [[ -n $( type -p xprop ) ]];then
+               if type -p xprop &>/dev/null;then
                        xprop_root="$( xprop -root 2>/dev/null )"
                fi
                # note that cinnamon split from gnome, and and can now be id'ed via xprop,
@@ -3995,7 +4950,7 @@ get_desktop_environment()
                # eventually this needs to be better organized so all the xprop tests are in the same
                # section, but this is good enough for now.
                if [[ -n $xprop_root && -n $( grep -is '^_MUFFIN' <<< "$xprop_root" ) ]];then
-                       version=$( get_de_app_version 'cinnamon' '^cinnamon' '2' )
+                       version=$( get_program_version 'cinnamon' '^cinnamon' '2' )
                        # not certain cinn will always have version, so keep output right if not
                        if [[ -n $version ]];then
                                version="$version "
@@ -4003,12 +4958,12 @@ get_desktop_environment()
                        if [[ $B_EXTRA_DATA == 'true' ]];then
                                toolkit=$( get_de_gtk_data )
                                if [[ -n $toolkit ]];then
-                                       version="${version}(Gtk ${toolkit})"
+                                       version="$version(Gtk $toolkit)"
                                fi
                        fi
                        desktop_environment="Cinnamon"
-               elif [[ -n $xprop_root && -n $( grep -is '^_MARCO' <<< "$xprop_root" ) ]];then
-                       version=$( get_de_app_version 'mate-about' '^MATE[[:space:]]DESKTOP' 'NF' )
+               elif [[ $XDG_CURRENT_DESKTOP == 'MATE' ]] || [[ -n $xprop_root && -n $( grep -is '^_MARCO' <<< "$xprop_root" ) ]];then
+                       version=$( get_program_version 'mate-about' '^MATE[[:space:]]DESKTOP' 'NF' )
                        # not certain cinn/mate will always have version, so keep output right if not
                        if [[ -n $version ]];then
                                version="$version "
@@ -4016,17 +4971,17 @@ get_desktop_environment()
                        if [[ $B_EXTRA_DATA == 'true' ]];then
                                toolkit=$( get_de_gtk_data )
                                if [[ -n $toolkit ]];then
-                                       version="${version}(Gtk ${toolkit})"
+                                       version="$version(Gtk $toolkit)"
                                fi
                        fi
                        desktop_environment="MATE"
                # note, GNOME_DESKTOP_SESSION_ID is deprecated so we'll see how that works out
                # https://bugzilla.gnome.org/show_bug.cgi?id=542880
-               elif [[ -n $GNOME_DESKTOP_SESSION_ID ]]; then
-                       if [[ -n $( type -p gnome-shell ) ]];then
-                               version=$( get_de_app_version 'gnome-shell' 'gnome' '3' )
-                       elif [[ -n $( type -p gnome-about ) ]];then
-                               version=$( get_de_app_version 'gnome-about' 'gnome' '3' )
+               elif [[ -n $GNOME_DESKTOP_SESSION_ID || $XDG_CURRENT_DESKTOP == 'GNOME' ]]; then
+                       if type -p gnome-shell &>/dev/null;then
+                               version=$( get_program_version 'gnome-shell' 'gnome' '3' )
+                       elif type -p gnome-about &>/dev/null;then
+                               version=$( get_program_version 'gnome-about' 'gnome' '3' )
                        fi
                        if [[ $B_EXTRA_DATA == 'true' ]];then
                                toolkit=$( get_de_gtk_data )
@@ -4043,16 +4998,16 @@ get_desktop_environment()
                                # String: "This is xfdesktop version 4.2.12"
                                # alternate: xfce4-about --version > xfce4-about 4.10.0 (Xfce 4.10)
                                if [[ -n $( grep -Eis '\"xfce4\"' <<< "$xprop_root" ) ]];then
-                                       version=$( get_de_app_version 'xfdesktop' 'xfdesktop[[:space:]]version' '5' )
+                                       version=$( get_program_version 'xfdesktop' 'xfdesktop[[:space:]]version' '5' )
                                        # arch linux reports null, so use alternate if null
                                        if [[ -z $version ]];then
-                                               version=$( get_de_app_version 'xfce4-panel' '^xfce4-panel' '2' )
+                                               version=$( get_program_version 'xfce4-panel' '^xfce4-panel' '2' )
                                                if [[ -z $version ]];then
                                                        version='4'
                                                fi
                                        fi
                                        if [[ $B_EXTRA_DATA == 'true' ]];then
-                                               toolkit=$( get_de_app_version 'xfdesktop' 'Built[[:space:]]with[[:space:]]GTK' '4' )
+                                               toolkit=$( get_program_version 'xfdesktop' 'Built[[:space:]]with[[:space:]]GTK' '4' )
                                                if [[ -n $toolkit ]];then
                                                        version="$version (Gtk $toolkit)"
                                                fi
@@ -4060,47 +5015,75 @@ get_desktop_environment()
                                        desktop_environment="Xfce"
                                # when 5 is released, the string may need updating
                                elif [[ -n $( grep -is '\"xfce5\"' <<< "$xprop_root" ) ]];then
-                                       version=$( get_de_app_version 'xfdesktop' 'xfdesktop[[:space:]]version' '5' )
+                                       version=$( get_program_version 'xfdesktop' 'xfdesktop[[:space:]]version' '5' )
                                        # arch linux reports null, so use alternate if null
                                        if [[ -z $version ]];then
-                                               version=$( get_de_app_version 'xfce5-panel' '^xfce5-panel' '2' )
+                                               version=$( get_program_version 'xfce5-panel' '^xfce5-panel' '2' )
                                                if [[ -z $version ]];then
                                                        version='5'
                                                fi
                                        fi
                                        if [[ $B_EXTRA_DATA == 'true' ]];then
-                                               toolkit=$( get_de_app_version 'xfdesktop' 'Built[[:space:]]with[[:space:]]GTK' '4' )
+                                               toolkit=$( get_program_version 'xfdesktop' 'Built[[:space:]]with[[:space:]]GTK' '4' )
+                                               if [[ -n $toolkit ]];then
+                                                       version="$version (Gtk $toolkit)"
+                                               fi
+                                       fi
+                                       desktop_environment="Xfce"
+                               # case where no xfce number exists, just xfce
+                               elif [[ -n $( grep -is 'xfce' <<< "$xprop_root" ) ]];then
+                                       version=$( get_program_version 'xfdesktop' 'xfdesktop[[:space:]]version' '5' )
+                                       # arch linux reports null, so use alternate if null
+                                       if [[ -z $version ]];then
+                                               version=$( get_program_version 'xfce4-panel' '^xfce5-panel' '2' )
+                                               if [[ -z $version ]];then
+                                                       # version=$( get_program_version 'xfce5-panel' '^xfce5-panel' '2' )
+                                                       #if [[ -z $version ]];then
+                                                       #       version='5'
+                                                       #fi
+                                                       version='4'
+                                               fi
+                                       fi
+                                       if [[ $B_EXTRA_DATA == 'true' ]];then
+                                               toolkit=$( get_program_version 'xfdesktop' 'Built[[:space:]]with[[:space:]]GTK' '4' )
                                                if [[ -n $toolkit ]];then
                                                        version="$version (Gtk $toolkit)"
                                                fi
                                        fi
                                        desktop_environment="Xfce"
                                elif [[ -n $( grep -is 'BLACKBOX_PID' <<< "$xprop_root" ) ]];then
-                                       if [[ -n $( grep -is 'fluxbox' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
-                                               version=$( get_de_app_version 'fluxbox' '^fluxbox' '2' )
+                                       if [[ -n $( grep -is 'fluxbox' <<< "$Ps_aux_Data" ) ]];then
+                                               version=$( get_program_version 'fluxbox' '^fluxbox' '2' )
                                                desktop_environment='Fluxbox'
                                        else
                                                desktop_environment='Blackbox'
                                        fi
                                elif [[ -n $( grep -is 'OPENBOX_PID' <<< "$xprop_root" ) ]];then
                                        # note: openbox-lxde --version may be present, but returns openbox data
-                                       version=$( get_de_app_version 'openbox' '^openbox' '2' )
+                                       version=$( get_program_version 'openbox' '^openbox' '2' )
                                        if [[ $XDG_CURRENT_DESKTOP == 'LXDE' || \
-                                                       -n $( grep -is 'lxde' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
+                                                       -n $( grep -is '/lxsession' <<< "$Ps_aux_Data" ) ]];then
                                                if [[ -n $version ]];then
                                                        version="(Openbox $version)"
                                                fi
                                                desktop_environment='LXDE'
-                                       elif [[ -n $( grep -is 'razor-desktop' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
+                                       elif [[  $XDG_CURRENT_DESKTOP == 'Razor' || $XDG_CURRENT_DESKTOP == 'LXQt' ]] || \
+                                               [[ -n $( grep -Eis '(razor-desktop|lxqt-session)' <<< "$Ps_aux_Data" ) ]];then
+                                               if [[ -n $( grep -is 'lxqt-session' <<< "$Ps_aux_Data" ) ]];then
+                                                       desktop_environment='LXQt'
+                                               elif [[ -n $( grep -is 'razor-desktop' <<< "$Ps_aux_Data" ) ]];then
+                                                       desktop_environment='Razor-Qt'
+                                               else
+                                                       desktop_environment='LX-Qt-Variant'
+                                               fi
                                                if [[ -n $version ]];then
                                                        version="(Openbox $version)"
                                                fi
-                                               desktop_environment='Razor-QT'
                                        else
-                                               desktop_environment='Openbox'
+                                               desktop_environment='Openbox' 
                                        fi
                                elif [[ -n $( grep -is 'ICEWM' <<< "$xprop_root" ) ]];then
-                                       version=$( get_de_app_version 'icewm' '^icewm' '2' )
+                                       version=$( get_program_version 'icewm' '^icewm' '2' )
                                        desktop_environment='IceWM'
                                elif [[ -n $( grep -is 'ENLIGHTENMENT' <<< "$xprop_root" ) ]];then
                                        # no -v or --version but version is in xprop -root
@@ -4108,10 +5091,10 @@ get_desktop_environment()
                                        version=$( grep -is 'ENLIGHTENMENT_VERSION' <<< "$xprop_root" | cut -d '"' -f 2 | gawk '{print $2}' )
                                        desktop_environment='Enlightenment'
                                elif [[ -n $( grep -is '^I3_' <<< "$xprop_root" ) ]];then
-                                       version=$( get_de_app_version 'i3' '^i3' '3' )
+                                       version=$( get_program_version 'i3' '^i3' '3' )
                                        desktop_environment='i3'
                                elif [[ -n $( grep -is 'WINDOWMAKER' <<< "$xprop_root" ) ]];then
-                                       version=$( get_de_app_version 'wmaker' '^Window[[:space:]]*Maker' 'NF' )
+                                       version=$( get_program_version 'wmaker' '^Window[[:space:]]*Maker' 'NF' )
                                        if [[ -n $version ]];then
                                                version="$version "
                                        fi
@@ -4119,14 +5102,14 @@ get_desktop_environment()
                                elif [[ -n $( grep -is '^_WM2' <<< "$xprop_root" ) ]];then
                                        # note; there isn't actually a wm2 version available but error handling should cover it and return null
                                        # maybe one day they will add it?
-                                       version=$( get_de_app_version 'wm2' '^wm2' 'NF' )
+                                       version=$( get_program_version 'wm2' '^wm2' 'NF' )
                                        # not certain will always have version, so keep output right if not
                                        if [[ -n $version ]];then
                                                version="$version "
                                        fi
                                        desktop_environment="WM2"
                                elif [[ -n $( grep -is 'herbstluftwm' <<< "$xprop_root" ) ]];then
-                                       version=$( get_de_app_version 'herbstluftwm' '^herbstluftwm' 'NF' )
+                                       version=$( get_program_version 'herbstluftwm' '^herbstluftwm' 'NF' )
                                        if [[ -n $version ]];then
                                                version="$version "
                                        fi
@@ -4136,38 +5119,38 @@ get_desktop_environment()
                        # 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
                        if [[ -z $desktop_environment ]];then
-                               if [[ -n $( grep -is 'fvwm-crystal'  <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
-                                       version=$( get_de_app_version 'fvwm' '^fvwm' '2' )
+                               if [[ -n $( grep -is 'fvwm-crystal'  <<< "$Ps_aux_Data" ) ]];then
+                                       version=$( get_program_version 'fvwm' '^fvwm' '2' )
                                        desktop_environment='FVWM-Crystal'
-                               elif [[ -n $( grep -is 'fvwm'  <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
-                                       version=$( get_de_app_version 'fvwm' '^fvwm' '2' )
+                               elif [[ -n $( grep -is 'fvwm'  <<< "$Ps_aux_Data" ) ]];then
+                                       version=$( get_program_version 'fvwm' '^fvwm' '2' )
                                        desktop_environment='FVWM'
-                               elif [[ -n $( grep -is 'pekwm'  <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
-                                       version=$( get_de_app_version 'pekwm' '^pekwm' '3' )
+                               elif [[ -n $( grep -is 'pekwm'  <<< "$Ps_aux_Data" ) ]];then
+                                       version=$( get_program_version 'pekwm' '^pekwm' '3' )
                                        desktop_environment='pekwm'
-                               elif [[ -n $( grep -is 'awesome' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
-                                       version=$( get_de_app_version 'awesome' '^awesome' '2' )
+                               elif [[ -n $( grep -is 'awesome' <<< "$Ps_aux_Data" ) ]];then
+                                       version=$( get_program_version 'awesome' '^awesome' '2' )
                                        desktop_environment='Awesome'
-                               elif [[ -n $( grep -is 'scrotwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
-                                       version=$( get_de_app_version 'scrotwm' '^welcome.*scrotwm' '4' )
+                               elif [[ -n $( grep -is 'scrotwm' <<< "$Ps_aux_Data" ) ]];then
+                                       version=$( get_program_version 'scrotwm' '^welcome.*scrotwm' '4' )
                                        desktop_environment='Scrotwm' # no --version for this one
-                               elif [[ -n $( grep -is 'spectrwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
-                                       version=$( get_de_app_version 'spectrwm' '^spectrwm.*welcome.*spectrwm' '5' )
+                               elif [[ -n $( grep -is 'spectrwm' <<< "$Ps_aux_Data" ) ]];then
+                                       version=$( get_program_version 'spectrwm' '^spectrwm.*welcome.*spectrwm' '5' )
                                        desktop_environment='Spectrwm' # no --version for this one
-                               elif [[ -n $( grep -Eis '([[:space:]]|/)twm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
+                               elif [[ -n $( grep -Eis '([[:space:]]|/)twm' <<< "$Ps_aux_Data" ) ]];then
                                        desktop_environment='Twm' # no --version for this one
-                               elif [[ -n $( grep -Eis '([[:space:]]|/)dwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
-                                       version=$( get_de_app_version 'dwm' '^dwm' '1' )
+                               elif [[ -n $( grep -Eis '([[:space:]]|/)dwm' <<< "$Ps_aux_Data" ) ]];then
+                                       version=$( get_program_version 'dwm' '^dwm' '1' )
                                        desktop_environment='dwm'
-                               elif [[ -n $( grep -is 'wmii2' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
-                                       version=$( get_de_app_version 'wmii2' '^wmii2' '1' )
+                               elif [[ -n $( grep -is 'wmii2' <<< "$Ps_aux_Data" ) ]];then
+                                       version=$( get_program_version 'wmii2' '^wmii2' '1' )
                                        desktop_environment='wmii2'
                                # note: in debian at least, wmii is actuall wmii3
-                               elif [[ -n $( grep -is 'wmii' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
-                                       version=$( get_de_app_version 'wmii' '^wmii' '1' )
+                               elif [[ -n $( grep -is 'wmii' <<< "$Ps_aux_Data" ) ]];then
+                                       version=$( get_program_version 'wmii' '^wmii' '1' )
                                        desktop_environment='wmii'
-                               elif [[ -n $( grep -Eis '([[:space:]]|/)jwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
-                                       version=$( get_de_app_version 'jwm' '^jwm' '2' )
+                               elif [[ -n $( grep -Eis '([[:space:]]|/)jwm' <<< "$Ps_aux_Data" ) ]];then
+                                       version=$( get_program_version 'jwm' '^jwm' '2' )
                                        desktop_environment='JWM'
                                fi
                        fi
@@ -4176,13 +5159,14 @@ get_desktop_environment()
        if [[ -n $version ]];then
                version=" $version"
        fi
-       echo "$desktop_environment${version}"
+       log_function_data "desktop_environment version: $desktop_environment$version"
+       echo "$desktop_environment$version"
        eval $LOGFE
 }
 
 # note: gawk doesn't support white spaces in search string, gave errors, so use [[:space:]] instead
 # args: $1 - desktop/app command for --version; $2 - search string; $3 - gawk print number
-get_de_app_version()
+get_program_version()
 {
        local version_data='' version='' get_version='--version' 
        
@@ -4206,7 +5190,7 @@ get_de_app_version()
                        ;;
                # quick debian/buntu hack until I find a universal way to get version for these
                dash)
-                       if [[ -n $( type -p dpkg ) ]];then
+                       if type -p dpkg &>/dev/null;then
                                version_data="$( dpkg -l $1 2>/dev/null )"
                        fi
                        ;;
@@ -4214,7 +5198,7 @@ get_de_app_version()
                        version_data="$( $1 $get_version 2>/dev/null )"
                        ;;
        esac
-       
+       log_function_data "version data: $version_data"
        if [[ -n $version_data ]];then
                version=$( gawk '
                BEGIN {
@@ -4228,6 +5212,7 @@ get_de_app_version()
                        exit # quit after first match prints
                }' <<< "$version_data" )
        fi
+       log_function_data "program version: $version"
        echo $version
 }
 
@@ -4240,7 +5225,7 @@ get_desktop_extra_data()
                desktops=""
                separator=""
        }
-       /(gnome-shell|gnome-panel|kicker|lxpanel|mate-panel|plasma-desktop|xfce4-panel)$/ {
+       /(gnome-shell|gnome-panel|kicker|lxpanel|mate-panel|plasma-desktop|plasma-netbook|xfce4-panel)$/ {
                # only one entry per type, can be multiple
                if ( desktops !~ $NF ) {
                        desktops = desktops separator $NF
@@ -4251,6 +5236,7 @@ get_desktop_extra_data()
                print desktops
        }
        ' )
+       log_function_data "de_data: $de_data"
        echo $de_data
        
        eval $LOGFE
@@ -4264,7 +5250,7 @@ get_de_gtk_data()
        
        # this is a hack, and has to be changed with every toolkit version change, and only dev systems
        # have this installed, but it's a cross distro command so let's test it first
-       if [[ -n $( type -p pkg-config ) ]];then
+       if type -p pkg-config &>/dev/null;then
                toolkit=$( pkg-config --modversion gtk+-4.0 2>/dev/null )
                # note: opensuse gets null output here, we need the command to get version and output sample
                if [[ -z $toolkit ]];then
@@ -4279,42 +5265,76 @@ get_de_gtk_data()
                # we'll try some known package managers next. dpkg will handle a lot of distros 
                # this is the most likely order as of: 2014-01-13. Not going to try to support all package managers
                # too much work, just the very biggest ones.
-               if [[ -n $( type -p dpkg ) ]];then
-                       toolkit=$( dpkg -s libgtk-3-0 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' )
+               if type -p dpkg &>/dev/null;then
+                       toolkit=$( dpkg -s libgtk-3-0 2>/dev/null | gawk -F ':' '/^[[:space:]]*Version/ {print $2}' )
+                       # just guessing on gkt 4 package name
+                       if [[ -z $toolkit ]];then
+                               toolkit=$( dpkg -s libgtk-4-0 2>/dev/null | gawk -F ':' '/^[[:space:]]*Version/ {print $2}' )
+                       fi
                        if [[ -z $toolkit ]];then
-                               toolkit=$( dpkg -s libgtk2.0-0 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' )
+                               toolkit=$( dpkg -s libgtk2.0-0 2>/dev/null | gawk -F ':' '/^[[:space:]]*Version/ {print $2}' )
                        fi
+               elif type -p pacman &>/dev/null;then
+                       toolkit=$(  pacman -Qi gtk3 2>/dev/null | gawk -F ':' '/^[[:space:]]*Version/ {print $2}' )
                        # just guessing on gkt 4 package name
                        if [[ -z $toolkit ]];then
-                               toolkit=$( dpkg -s libgtk-4-0 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' )
+                               toolkit=$( pacman -Qi gtk4 2>/dev/null | gawk -F ':' '/^[[:space:]]*Version/ {print $2}' )
+                       fi
+                       if [[ -z $toolkit ]];then
+                               toolkit=$( pacman -Qi gtk2 2>/dev/null | gawk -F ':' '/^[[:space:]]*Version/ {print $2}' )
+                       fi
+               # Name        : libgtk-3-0
+               # Version     : 3.12.2
+               elif type -p rpm &>/dev/null;then
+                       toolkit=$( rpm -qi libgtk-3-0 2>/dev/null | gawk -F ':' '
+                       /^[[:space:]]*Version/ { 
+                               gsub(/^[[:space:]]+|[[:space:]]+$/,"",$2)
+                               print $2 
+                       }' )
+                       if [[ -z $toolkit ]];then
+                               toolkit=$( rpm -qi libgtk-4-0 2>/dev/null | gawk -F ':' '
+                               /^[[:space:]]*Version/ {
+                                       gsub(/^[[:space:]]+|[[:space:]]+$/,"",$2)
+                                       print $2
+                               }' )
                        fi
-               elif [[ -n $( type -p pacman ) ]];then
-                       toolkit=$(  pacman -Qi gtk3 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' )
                        if [[ -z $toolkit ]];then
-                               toolkit=$( pacman -Qi gtk2 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' )
+                               toolkit=$( rpm -qi libgtk-2-0 2>/dev/null | gawk -F ':' '
+                               /^[[:space:]]*Version/ {
+                                       gsub(/^[[:space:]]+|[[:space:]]+$/,"",$2)
+                                       print $2
+                               }' )
                        fi
                fi
        fi
+       log_function_data "toolkit: $toolkit"
        echo $toolkit
        
        eval $LOGFE
 }
 
+
 # see which dm has started if any
 get_display_manager()
 {
        eval $LOGFS
-       # ldm - LTSP display manager
-       local dm_id_list='entranced.pid entrance/entranced.pid gdm.pid gdm3.pid kdm.pid ldm.pid lightdm.pid lxdm.pid mdm.pid nodm.pid slim.lock tint2.pid wdm.pid xdm.pid' 
+       # ldm - LTSP display manager. Note that sddm does not appear to have a .pid extension in Arch
+       # note: to avoid positives with directories, test for -f explicitly, not -e
+       local dm_id_list='entranced.pid gdm.pid gdm3.pid kdm.pid ldm.pid lightdm.pid lxdm.pid mdm.pid nodm.pid sddm.pid sddm slim.lock tint2.pid wdm.pid xdm.pid' 
        local dm_id='' dm='' separator=''
        # note we don't need to filter grep if we do it this way
        local x_is_running=$( grep '/usr.*/X' <<< "$Ps_aux_Data" | grep -iv '/Xprt' )
 
        for dm_id in $dm_id_list
        do
-               if [[ -e /var/run/$dm_id || -e /run/$dm_id ]];then
+               # note: ${dm_id%.*}/$dm_id will create a dir name out of the dm id, then test if pid is in that
+               # note: sddm, in an effort to be unique and special, do not use a pid/lock file, but rather a random
+               # string inside a directory called /run/sddm/ so assuming the existence of the pid inside a directory named
+               # from the dm. Hopefully this change will not have negative results.
+               if [[ -f /run/$dm_id || -d /run/${dm_id%.*}/ || -f /var/run/$dm_id || \
+                     -d /var/run/${dm_id%.*}/ ]];then
                        # just on the off chance that two dms are running, good info to have in that case, if possible
-                       dm=$dm$separator$( basename $dm_id | cut -d '.' -f 1 )
+                       dm=$dm$separator${dm_id%.*}
                        separator=','
                fi
        done
@@ -4337,11 +5357,21 @@ get_display_manager()
 get_distro_data()
 {
        eval $LOGFS
-       local i='' j='' distro='' distro_file='' a_distro_glob='' temp_array=''
+       local i='' j='' distro='' distro_file='' a_distro_glob='' a_temp='' b_osr='false'
        
        # may need modification if archbsd / debian can be id'ed with /etc files
        if [[ -n $BSD_TYPE ]];then
-               distro=$( uname -sr )
+               if [[ $BSD_VERSION != 'darwin' ]];then
+                       distro=$( uname -sr )
+               else
+                       if [[ -f /System/Library/CoreServices/SystemVersion.plist ]];then
+                               distro=$( grep -A1 -E '(ProductName|ProductVersion)' /System/Library/CoreServices/SystemVersion.plist  | grep '<string>' | sed -E 's/<[\/]?string>//g' )
+                               distro=$( echo $distro )
+                       fi
+                       if [[ -z $distro ]];then
+                               distro='Mac OS X'
+                       fi
+               fi
                echo "$distro"
                log_function_data "distro: $distro"
                eval $LOGFE
@@ -4357,11 +5387,11 @@ get_distro_data()
        cd "$OLDPWD"
        shopt -u nullglob
        
-       temp_array=${a_distro_glob[@]}
-       log_function_data "A_GLX_DATA: $temp_array"
+       a_temp=${a_distro_glob[@]}
+       log_function_data "a_distro_glob: $a_temp"
 
        if [[ ${#a_distro_glob[@]} -eq 1 ]];then
-               distro_file="${a_distro_glob}"
+               distro_file="$a_distro_glob"
        # use the file if it's in the known good lists
        elif [[ ${#a_distro_glob[@]} -gt 1 ]];then
                for i in $DISTROS_DERIVED $DISTROS_PRIMARY
@@ -4376,12 +5406,12 @@ get_distro_data()
                                # because Mint does not use such, it must be done as below 
                                ## this if statement requires the spaces and * as it is, else it won't work
                                ##
-                               if [[ " $DISTROS_LSB_GOOD " == *" ${i} "* ]] && [[ $B_LSB_FILE == 'true' ]];then
+                               if [[ " $DISTROS_LSB_GOOD " == *" $i "* ]] && [[ $B_LSB_FILE == 'true' ]];then
                                        distro_file='lsb-release'
-                               elif [[ " $DISTROS_OS_RELEASE_GOOD " == *" ${i} "* ]] && [[ $B_OS_RELEASE_FILE == 'true' ]];then
+                               elif [[ " $DISTROS_OS_RELEASE_GOOD " == *" $i "* ]] && [[ $B_OS_RELEASE_FILE == 'true' ]];then
                                        distro_file='os-release'
                                else
-                                       distro_file="${i}"
+                                       distro_file="$i"
                                fi
                                break
                        fi
@@ -4400,6 +5430,7 @@ get_distro_data()
                distro=$( get_distro_lsb_os_release_data 'lsb-file' )
        elif [[ $distro_file == 'os-release' ]];then
                distro=$( get_distro_lsb_os_release_data 'os-release-file' )
+               b_osr='true'
        # then if the distro id file was found and it's not in the exluded primary distro file list, read it
        elif [[ -n $distro_file && -s /etc/$distro_file && " $DISTROS_EXCLUDE_LIST " != *" $distro_file "* ]];then
                # new opensuse uses os-release, but older ones may have a similar syntax, so just use the first line
@@ -4413,9 +5444,12 @@ get_distro_data()
                fi
        # otherwise try  the default debian/ubuntu /etc/issue file
        elif [[ -f /etc/issue ]];then
-               # lsb gives more manageable and accurate output than issue, but mint should use issue for now
+               # os-release/lsb gives more manageable and accurate output than issue, but mint should use issue for now
                # some bashism, boolean must be in parenthesis to work correctly, ie [[ $(boolean) ]] not [[ $boolean ]]
-               if [[ $B_LSB_FILE == 'true' ]] && [[ -z $( grep -i 'mint' /etc/issue ) ]];then
+               if [[ $B_OS_RELEASE_FILE == 'true' ]] && [[ -z $( grep -i 'mint' /etc/issue ) ]];then
+                       distro=$( get_distro_lsb_os_release_data 'os-release-file' )
+                       b_osr='true'
+               elif [[ $B_LSB_FILE == 'true' ]] && [[ -z $( grep -i 'mint' /etc/issue ) ]];then
                        distro=$( get_distro_lsb_os_release_data 'lsb-file' )
                else
                        distro=$( gawk '
@@ -4424,7 +5458,7 @@ get_distro_data()
                        }
                        {
                                gsub(/\\[a-z]/, "")
-                               gsub(/,/, " ")
+                               gsub(/'"$BAN_LIST_ARRAY"'/, " ")
                                gsub(/^ +| +$/, "")
                                gsub(/ [ \t]+/, " ")
                                print
@@ -4438,20 +5472,28 @@ get_distro_data()
                        fi
                fi
        fi
-       
+       # a final check. If a long value, before assigning the debugger output, if os-release
+       # exists then let's use that if it wasn't tried already. Maybe that will be better.
        if [[ ${#distro} -gt 80 ]] && [[ $B_HANDLE_CORRUPT_DATA != 'true' ]];then
-               distro="${RED}/etc/${distro_file} corrupted, use -% to override${NORMAL}"
+               if [[ $B_OS_RELEASE_FILE == 'true' && $b_osr == 'false' ]];then
+                       distro=$( get_distro_lsb_os_release_data 'os-release-file' )
+               fi
+               if [[ ${#distro} -gt 80 ]];then
+                       distro="${RED}/etc/$distro_file corrupted, use -% to override${NORMAL}"
+               fi
        fi
        ## note: would like to actually understand the method even if it's not used
        # : ${distro:=Unknown distro o_O}
        ## test for /etc/lsb-release as a backup in case of failure, in cases where > one version/release file
        ## were found but the above resulted in null distro value
-       if [[ -z $distro ]] && [[ $B_LSB_FILE == 'true' ]];then
-               distro=$( get_distro_lsb_os_release_data 'lsb-file' )
-       fi
+       # Because os-release is now more common, we'll test for it first.
        if [[ -z $distro ]] && [[ $B_OS_RELEASE_FILE == 'true' ]];then
                distro=$( get_distro_lsb_os_release_data 'os-release-file' )
        fi
+       if [[ -z $distro ]] && [[ $B_LSB_FILE == 'true' ]];then
+               distro=$( get_distro_lsb_os_release_data 'lsb-file' )
+       fi
+       
        # now some final null tries
        if [[ -z $distro ]];then
                # if the file was null but present, which can happen in some cases, then use the file name itself to 
@@ -4541,7 +5583,7 @@ get_distro_lsb_os_release_data()
                        ;;
                lsb-app)
                        # this is HORRIBLY slow, not using
-                       if [[  -n $( type -p lsb_release ) ]];then
+                       if type -p lsb_release &>/dev/null;then
                                distro=$( echo "$( lsb_release -irc )" | gawk -F ':' '
                                BEGIN { 
                                        IGNORECASE=1 
@@ -4632,82 +5674,109 @@ get_dmidecode_data()
 {
        eval $LOGFS
        
-       local dmidecodePath=''
+       local dmiData="" b_debugger='false'
 
        if [[ $B_DMIDECODE_SET != 'true' ]];then
                dmidecodePath=$( type -p dmidecode 2>/dev/null )
-               if [[ -n $dmidecodePath ]];then
+               if [[ -z $dmidecodePath ]];then
+                       DMIDECODE_DATA='dmidecode-error-not-installed'
+               else
                        # note stripping out these lines: Handle 0x0016, DMI type 17, 27 bytes
                        # but NOT deleting them, in case the dmidecode data is missing empty lines which will be
                        # used to separate results. Then we remove the doubled empty lines to keep it clean and
-                       # strip out all the stuff we don't want to see in the results.
-                       DMIDECODE_DATA="$( $dmidecodePath 2>/dev/null \
-                       | gawk -F ':' '
-                       BEGIN {
-                               IGNORECASE=1
-                               cutExtraTab="false"
-                               twoData=""
-                               oneData=""
-                       }
-                       {
-                               # no idea why, but freebsd gawk does not do this right
-                               oneData=$1
-                               twoData=$2
-                               if ( twoData != "" ) {
-                                       twoHolder="true"
-                               }
-                               else {
-                                       twoHolder="false"
-                               }
-                               if ( $0 ~ /^\tDMI type/ ) {
-                                       sub(/^\tDMI type.*/, "", $0)
-                                       cutExtraTab="true"
-                               }
-                               gsub(/'"$BAN_LIST_NORMAL"'/, "", twoData)
-                               gsub(/,/, " ", $0)
-                               # clean out Handle line
-                               sub(/^Handle.*/,"", $0)
-                               sub(/^[[:space:]]*Inactive.*/,"",$0)
-                               # yes, there is a typo in a user data set, unknow
-                               # Base Board Version|Base Board Serial Number
-                               # Chassis Manufacturer|Chassis Version|Chassis Serial Number
-                               # System manufacturer|System Product Name|System Version
-                               # To Be Filled By O.E.M.
-                               # strip out starting white space so that the following stuff will clear properly
-                               sub(/^[[:space:]]+/, "", twoData)
-                               sub(/^Base Board .*|^Chassis .*|.*O\.E\.M\..*|.*OEM.*|^Not .*|^System .*|.*unknow.*|.*N\/A.*|none|^To be filled.*/, "", twoData) 
-                               gsub(/bios|acpi/, "", twoData)
-                               sub(/http:\/\/www.abit.com.tw\//, "Abit", twoData)
-                               
-                               # for double indented values replace with ~ so later can test for it, we are trusting that
-                               # indentation will be tabbed in this case
-                               # special case, dmidecode 2.2 has an extra tab and a DMI type line
-                               if ( cutExtraTab == "true" ) {
-                                       sub(/^\t\t\t+/, "~", oneData)
-                               }
-                               else {
-                                       sub(/^\t\t+/, "~", oneData)
-                               }
-                               
-                               gsub(/^[[:space:]]+|[[:space:]]+$/, "", twoData)
-                               gsub(/^[[:space:]]+|[[:space:]]+$/, "", oneData)
-                               gsub(/ [ \t]+/, " ", twoData)
-                               # reconstructing the line for processing so gawk can use -F : again
-                               if ( oneData != "" && twoHolder == "true" ) {
-                                       print oneData ":" twoData
-                               }
-                               else {
-                                       print $0
+                       # strip out all the stuff we don't want to see in the results. We want the error data in 
+                       # stdout for error handling
+                       if [[ $b_debugger == 'true' && $HOSTNAME == 'yawn' ]];then
+                               dmiData="$( cat ~/bin/scripts/inxi/svn/misc/data/dmidecode/dmidecode-memory-variants-2.txt )"
+                       else 
+                               dmiData="$( $dmidecodePath 2>&1 )"
+                       fi
+                       # these tests first, because bsd error messages like this (note how many : are in the string)
+                       # inxi: line 4928: /usr/local/sbin/dmidecode: Permission denied
+                       if [[ ${#dmiData} -lt 200  ]];then
+                               if [[ -z ${dmiData/*Permission denied*/} ]];then
+                               # if [[ -n $( grep -i 'Permission denied' <<< "$dmiData" ) ]];then
+                                       DMIDECODE_DATA='dmidecode-error-requires-root'
+                               # this handles very old systems, like Lenny 2.6.26, with dmidecode, but no data
+                               elif [[ -n $( grep -i 'no smbios ' <<< "$dmiData" ) ]];then
+                                       DMIDECODE_DATA='dmidecode-error-no-smbios-dmi-data'
+                               else
+                                       DMIDECODE_DATA='dmidecode-error-unknown-error'
+                               fi
+                       else
+                               DMIDECODE_DATA="$( echo "$dmiData" | gawk -F ':' '
+                               BEGIN {
+                                       IGNORECASE=1
+                                       cutExtraTab="false"
+                                       twoData=""
+                                       oneData=""
                                }
-                       }' \
-                       | sed '/^$/{
+                               {
+                                       # no idea why, but freebsd gawk does not do this right
+                                       oneData=$1
+                                       twoData=$2
+                                       if ( twoData != "" ) {
+                                               twoHolder="true"
+                                       }
+                                       else {
+                                               twoHolder="false"
+                                       }
+                                       if ( $0 ~ /^\tDMI type/ ) {
+                                               sub(/^\tDMI type.*/, "", $0)
+                                               cutExtraTab="true"
+                                       }
+                                       gsub(/'"$BAN_LIST_NORMAL"'/, "", twoData)
+                                       gsub(/'"$BAN_LIST_ARRAY"'/, " ", twoData)
+                                       # clean out Handle line
+                                       # sub(/^Handle.*/,"", $0)
+                                       sub(/^[[:space:]]*Inactive.*/,"",twoData)
+                                       # yes, there is a typo in a user data set, unknow
+                                       # Base Board Version|Base Board Serial Number
+                                       # Chassis Manufacturer|Chassis Version|Chassis Serial Number
+                                       # System manufacturer|System Product Name|System Version
+                                       # To Be Filled By O.E.M.
+                                       # strip out starting white space so that the following stuff will clear properly
+                                       sub(/^[[:space:]]+/, "", twoData)
+                                       sub(/^Base Board .*|^Chassis .*|empty|.*O\.E\.M\..*|.*OEM.*|^Not .*|^System .*|.*unknow.*|.*N\/A.*|none|^To be filled.*|^0x[0]+$|\[Empty\]|<Bad Index>|^\.\.$/, "", twoData) 
+                                       sub(/.*(AssetTagNum|Manufacturer| Or Motherboard|PartNum.*|SerNum).*/, "", twoData)
+                                       gsub(/bios|acpi/, "", twoData)
+                                       sub(/http:\/\/www.abit.com.tw\//, "Abit", twoData)
+                                       
+                                       # for double indented values replace with ~ so later can test for it, we are trusting that
+                                       # indentation will be tabbed in this case
+                                       # special case, dmidecode 2.2 has an extra tab and a DMI type line
+                                       if ( cutExtraTab == "true" ) {
+                                               sub(/^\t\t\t+/, "~", oneData)
+                                       }
+                                       else {
+                                               sub(/^\t\t+/, "~", oneData)
+                                       }
+                                       gsub(/ [ \t]+/, " ", twoData)
+                                       gsub(/^[[:space:]]+|[[:space:]]+$/, "", twoData)
+                                       gsub(/^[[:space:]]+|[[:space:]]+$/, "", oneData)
+                                       
+                                       # reconstructing the line for processing so gawk can use -F : again
+                                       if ( oneData != "" && twoHolder == "true" ) {
+                                               print oneData ":" twoData
+                                       }
+                                       else {
+                                               # make sure all null lines have no spaces in them!
+                                               gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0)
+                                               print $0
+                                       }
+                               }' \
+                               | sed '/^$/{
 N
 /^\n$/D
 }' \
-                       )"
+                               )"
+                       fi
+                       # echo ":${DMIDECODE_DATA}:"
+                       log_function_data "DMIDECODE_DATA (PRE): $DMIDECODE_DATA"
+                       
                fi
                B_DMIDECODE_SET='true'
-               log_function_data "DMIDECODE_DATA: $DMIDECODE_DATA"
+               log_function_data "DMIDECODE_DATA (POST): $DMIDECODE_DATA"
        fi
 
        eval $LOGFE
@@ -4723,28 +5792,26 @@ get_dmesg_boot_data()
        
        if [[ $B_DMESG_BOOT_FILE == 'true' ]];then
                # replace all indented items with ~ so we can id them easily while processing
-               dmsg_boot_data="$( cat $FILE_DMESG_BOOT | sed $SED_RX 's/"//g' )"
+               # note that if user, may get error of read permissions
+               # for some weird reason, real mem and avail mem are use a '=' separator, who knows why, the others are ':'
+               dmsg_boot_data="$( cat $FILE_DMESG_BOOT 2>/dev/null | gawk '
+               {
+                       sub(/[[:space:]]*=[[:space:]]*|:[[:space:]]*/,":", $0)
+                       gsub(/'"$BAN_LIST_ARRAY"'/," ", $0)
+                       gsub(/\"/, "", $0)
+                       gsub(/[[:space:]][[:space:]]/, " ", $0)
+                       print $0
+               }' )"
        fi
        echo "$dmsg_boot_data"
        # log_function_data "$dmsg_boot_data"
        eval $LOGFE
 }
 
-get_gcc_kernel_version()
-{
-       # note that we use gawk to get the last part because beta, alpha, git versions can be non-numeric
-       local gccVersion=''
-       
-       if [[ -e /proc/version ]];then
-               gccVersion=$( grep -Eio 'gcc[[:space:]]*version[[:space:]]*([^ \t]*)' /proc/version 2>/dev/null | gawk '{print $3}' )
-       fi
-       echo $gccVersion
-}
-
 get_gcc_system_version()
 {
        eval $LOGFS
-       local separator='' gcc_installed='' gcc_list='' gcc_others='' temp_array=''
+       local separator='' gcc_installed='' gcc_list='' gcc_others='' a_temp=''
        local gcc_version=$( 
        gcc --version 2>/dev/null | sed $SED_RX 's/\([^\)]*\)//g' | gawk '
        BEGIN {
@@ -4753,18 +5820,18 @@ get_gcc_system_version()
        /^gcc/ {
                print $2
                exit
-       }'      )
-
+       }' )
        # can't use xargs -L basename because not all systems support thats
        if [[ $B_EXTRA_EXTRA_DATA == 'true' ]];then
                gcc_others=$( ls /usr/bin/gcc-* 2>/dev/null )
                if [[ -n $gcc_others ]];then
                        for item in $gcc_others
                        do
-                               gcc_installed=$( basename $item | gawk -F '-' '
+                               item=${item##*/}
+                               gcc_installed=$( gawk -F '-' '
                                $2 ~ /^[0-9\.]+$/ {
                                        print $2
-                               }' )
+                               }' <<< $item )
                                if [[ -n $gcc_installed && -z $( grep "^$gcc_installed" <<< $gcc_version ) ]];then
                                        gcc_list=$gcc_list$separator$gcc_installed
                                        separator=','
@@ -4775,30 +5842,36 @@ get_gcc_system_version()
        if [[ -n $gcc_version ]];then
                A_GCC_VERSIONS=( "$gcc_version" $gcc_list )
        fi
-       temp_array=${A_GCC_VERSIONS[@]}
-       log_function_data "A_GCC_VERSIONS: $temp_array"
+       a_temp=${A_GCC_VERSIONS[@]}
+       log_function_data "A_GCC_VERSIONS: $a_temp"
        eval $LOGFE
 }
+
 get_gpu_temp_data()
 {
        local gpu_temp='' gpu_fan='' screens='' screen_nu='' gpu_temp_looper=''
 
        # we'll try for nvidia/ati, then add if more are shown
-       if [[ -n $( type -p nvidia-settings ) ]];then
-               # first get the number of screens
-               screens=$( nvidia-settings -q screens | gawk '
-               /:[0-9]\.[0-9]/ {
-                       screens=screens gensub(/(.*)(:[0-9]\.[0-9])(.*)/, "\\2", "1", $0) " "
-               }
-               END {
-                       print screens
-               }
-               ' )
+       if type -p nvidia-settings &>/dev/null;then
+               # first get the number of screens. This only work if you are in X
+               if [[ $B_RUNNING_IN_DISPLAY == 'true' ]];then
+                       screens=$( nvidia-settings -q screens | gawk '
+                       /:[0-9]\.[0-9]/ {
+                               screens=screens gensub(/(.*)(:[0-9]\.[0-9])(.*)/, "\\2", "1", $0) " "
+                       }
+                       END {
+                               print screens
+                       }
+                       ' )
+               else
+                       # do a guess, this will work for most users, it's better than nothing for out of X
+                       screens=':0.0'
+               fi
                # now we'll get the gpu temp for each screen discovered. The print out function
                # will handle removing screen data for single gpu systems
                for screen_nu in $screens
                do
-                       gpu_temp_looper=$( nvidia-settings -c $screen_nu -q GPUCoreTemp | gawk -F ': ' '
+                       gpu_temp_looper=$( nvidia-settings -c $screen_nu -q GPUCoreTemp 2>/dev/null | gawk -F ': ' '
                        BEGIN {
                                IGNORECASE=1
                                gpuTemp=""
@@ -4816,7 +5889,7 @@ get_gpu_temp_data()
                        screen_nu=$( cut -d ':' -f 2 <<< $screen_nu )
                        gpu_temp="$gpu_temp$screen_nu:$gpu_temp_looper "
                done
-       elif [[ -n $( type -p aticonfig ) ]];then
+       elif type -p aticonfig &>/dev/null;then
 #              gpu_temp=$( aticonfig --adapter=0 --od-gettemperature | gawk -F ': ' '
                gpu_temp=$( aticonfig --adapter=all --od-gettemperature | gawk -F ': ' '
                BEGIN {
@@ -4885,21 +5958,30 @@ get_graphics_agp_data()
 get_graphics_card_data()
 {
        eval $LOGFS
-       local i='' temp_array=''
+       local i='' a_temp=''
 
        IFS=$'\n'
        A_GRAPHICS_CARD_DATA=( $( gawk -F': ' '
        BEGIN {
                IGNORECASE=1
                busId=""
+               trueCard=""
        }
-       /vga compatible controller/ {
+       # not using 3D controller yet, needs research: |3D controller |display controller
+       # note: this is strange, but all of these can be either a separate or the same
+       # card. However, by comparing bus id, say: 00:02.0 we can determine that the
+       # cards are  either the same or different. We want only the .0 version as a valid
+       # card. .1 would be for example: Display Adapter with bus id x:xx.1, not the right one
+       /vga compatible controller|3D controller|Display controller/ {
                gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF)
-               gsub(/,/, " ", $NF)
+               gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF)
                gsub(/^ +| +$/, "", $NF)
                gsub(/ [ \t]+/, " ", $NF)
                busId=gensub(/^([0-9a-f:\.]+) (.+)$/,"\\1","",$1)
-               print $NF "," busId
+               trueCard=gensub(/(.*)\.([0-9]+)$/,"\\2","",busId)
+               if ( trueCard == 0 ) {
+                       print $NF "," busId
+               }
        }' <<< "$Lspci_v_Data" ) )
        IFS="$ORIGINAL_IFS"
 #      for (( i=0; i < ${#A_GRAPHICS_CARD_DATA[@]}; i++ ))
@@ -4909,8 +5991,8 @@ get_graphics_card_data()
 
        # GFXMEM is UNUSED at the moment, because it shows AGP aperture size, which is not necessarily equal to GFX memory..
        # GFXMEM="size=[$(echo "$Lspci_v_Data" | gawk '/VGA/{while (!/^$/) {getline;if (/size=[0-9][0-9]*M/) {size2=gensub(/.*\[size=([0-9]+)M\].*/,"\\1","g",$0);if (size<size2){size=size2}}}}END{print size2}')M]"
-       temp_array=${A_GRAPHICS_CARD_DATA[@]}
-       log_function_data "A_GRAPHICS_CARD_DATA: $temp_array"
+       a_temp=${A_GRAPHICS_CARD_DATA[@]}
+       log_function_data "A_GRAPHICS_CARD_DATA: $a_temp"
        eval $LOGFE
 }
 
@@ -4919,8 +6001,8 @@ get_graphics_driver()
        eval $LOGFS
        
        # list is from sgfxi plus non-free drivers
-       local driver_list='apm|ark|ati|chips|cirrus|cyrix|fbdev|fglrx|glint|i128|i740|intel|i810|imstt|mach64|mga|neomagic|nsc|nvidia|nv|openchrome|nouveau|radeon|radeonhd|rendition|s3virge|s3|savage|siliconmotion|sisusb|sis|tdfx|tga|trident|tseng|unichrome|vboxvideo|vesa|vga|via|voodoo|vmware|v4l'
-       local driver='' driver_string='' xorg_log_data='' status='' temp_array=''
+       local driver_list='amdgpu|apm|ark|ati|chips|cirrus|cyrix|fbdev|fglrx|glint|i128|i740|intel|i810|imstt|mach64|mga|neomagic|nsc|nvidia|nv|openchrome|nouveau|radeon|radeonhd|rendition|s3virge|s3|savage|siliconmotion|sisusb|sis|tdfx|tga|trident|tseng|unichrome|vboxvideo|vesa|vga|via|voodoo|vmware|v4l'
+       local driver='' driver_string='' xorg_log_data='' status='' a_temp=''
 
        if [[ $B_XORG_LOG == 'true' ]];then
                A_GRAPHIC_DRIVERS=( $(
@@ -4937,8 +6019,10 @@ get_graphics_driver()
                        # failed/unloaded, which have not always actually been truly loaded
                        aDrivers[driver]="loaded" 
                }
-               /Unloading[[:space:]].*('"$driver_list"')(|_drv.so)$/ {
-                       driver=gensub(/(.*)Unloading[[:space:]].*('"$driver_list"')(|_drv.so)$/, "\\2", 1, $0 )
+               # openbsd uses UnloadModule: 
+               /(Unloading[[:space:]]|UnloadModule).*('"$driver_list"')(\"||_drv.so)$/ {
+                       gsub(/\"/,"",$0)
+                       driver=gensub(/(.*)(Unloading[[:space:]]|UnloadModule).*('"$driver_list"')(\"||_drv.so)$/, "\\3", 1, $0 )
                        # we need to make sure that the driver has already been truly loaded, not just discussed
                        if ( driver in aDrivers ) {
                                aDrivers[driver]="unloaded"
@@ -4971,8 +6055,8 @@ get_graphics_driver()
                        }
                }' < $FILE_XORG_LOG ) )
        fi
-       temp_array=${A_GRAPHIC_DRIVERS[@]}
-       log_function_data "A_GRAPHIC_DRIVERS: $temp_array"
+       a_temp=${A_GRAPHIC_DRIVERS[@]}
+       log_function_data "A_GRAPHIC_DRIVERS: $a_temp"
        
        eval $LOGFE
 }
@@ -4981,7 +6065,7 @@ get_graphics_driver()
 get_graphics_glx_data()
 {
        eval $LOGFS
-       local temp_array=''
+       local a_temp=''
        if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then
                IFS=$'\n'
                A_GLX_DATA=( $( glxinfo | gawk -F ': ' '
@@ -5041,8 +6125,8 @@ get_graphics_glx_data()
                # GLXR=$(glxinfo | gawk -F ': ' 'BEGIN {IGNORECASE=1} /opengl renderer/ && $2 !~ /mesa/ {seen[$2]++} END {for (i in seen) {printf("%s ",i)}}')
                #    GLXV=$(glxinfo | gawk -F ': ' 'BEGIN {IGNORECASE=1} /opengl version/ && $2 !~ /mesa/ {seen[$2]++} END {for (i in seen) {printf("%s ",i)}}')
        fi
-       temp_array=${A_GLX_DATA[@]}
-       log_function_data "A_GLX_DATA: $temp_array"
+       a_temp=${A_GLX_DATA[@]}
+       log_function_data "A_GLX_DATA: $a_temp"
        eval $LOGFE
 }
 
@@ -5125,7 +6209,7 @@ get_graphics_res_data()
 get_graphics_display_server_data()
 {
        eval $LOGFS
-       local vendor='' version='' temp_array='' xdpy_info='' a_display_vendor_working=''
+       local vendor='' version='' a_temp='' xdpy_info='' a_display_vendor_working=''
 
        if [[ $B_SHOW_DISPLAY_DATA == 'true' && $B_ROOT != 'true' ]];then
                # X vendor and version detection.
@@ -5143,7 +6227,7 @@ get_graphics_display_server_data()
                }
                /vendor string/ {
                        gsub(/the|inc|foundation|project|corporation/, "", $2)
-                       gsub(/,/, " ", $2)
+                       gsub(/'"$BAN_LIST_ARRAY"'/, " ", $2)
                        gsub(/^ +| +$/, "", $2)
                        gsub(/ [ \t]+/, " ", $2)
                        vendorString = $2
@@ -5187,8 +6271,8 @@ get_graphics_display_server_data()
                        A_DISPLAY_SERVER_DATA[1]="$version"
                fi
        fi
-       temp_array=${A_DISPLAY_SERVER_DATA[@]}
-       log_function_data "A_DISPLAY_SERVER_DATA: $temp_array"
+       a_temp=${A_DISPLAY_SERVER_DATA[@]}
+       log_function_data "A_DISPLAY_SERVER_DATA: $a_temp"
        eval $LOGFE
 }
 
@@ -5198,13 +6282,13 @@ get_graphics_display_server_version()
        eval $LOGFS
        local version='' x_data=''
        # note that some users can have /usr/bin/Xorg but not /usr/bin/X
-       if [[ -n $( type -p X ) ]];then
+       if type -p X &>/dev/null;then
                # note: MUST be this syntax: X -version 2>&1
                # otherwise X -version overrides everything and this comes out null.
                # two knowns id strings: X.Org X Server 1.7.5 AND X Window System Version 1.7.5
                #X -version 2>&1 | gawk '/^X Window System Version/ { print $5 }'
                x_data="$( X -version 2>&1 )"
-       elif [[ -n $( type -p Xorg ) ]];then
+       elif type -p Xorg &>/dev/null;then
                x_data="$( Xorg -version 2>&1)"
        fi
        if [[ -n $x_data ]];then
@@ -5231,28 +6315,62 @@ get_graphics_display_server_version()
 get_hdd_data_basic()
 {
        eval $LOGFS
-       local hdd_used='' temp_array='' df_string=''
-       local hdd_data='' df_test=''
+       local hdd_used='' a_temp='' df_string=''
+       local hdd_data='' df_test='' swap_size=0
        
        if [[ -z $BSD_TYPE ]];then
-               df_string='df -P -T --exclude-type=aufs --exclude-type=devfs --exclude-type=devtmpfs 
-               --exclude-type=fdescfs --exclude-type=iso9660 --exclude-type=linprocfs --exclude-type=procfs
-               --exclude-type=squashfs --exclude-type=sysfs --exclude-type=tmpfs --exclude-type=unionfs'
+               ## NOTE: older df do not have --total (eg: v: 6.10 2008)
+               ## keep in mind the only value of use with --total is 'used' in blocks, which
+               ## we can use later to calculate the real percentags based on disk sizes, not
+               ## mounted partitions. Not using --total because it's more reliable to exclude non /dev
+               df_string="df -P -T --exclude-type=aufs --exclude-type=devfs --exclude-type=devtmpfs 
+               --exclude-type=fdescfs --exclude-type=iso9660 --exclude-type=linprocfs --exclude-type=nfs
+               --exclude-type=nfs3 --exclude-type=nfs4 --exclude-type=nfs5 --exclude-type=procfs  --exclude-type=smbfs
+               --exclude-type=squashfs --exclude-type=sysfs --exclude-type=tmpfs --exclude-type=unionfs"
+               if swapon -s &>/dev/null;then
+                       swap_size=$( swapon -s 2>/dev/null | gawk '
+                       BEGIN { 
+                       swapSize=0
+                       total=0
+                       }
+                       ( $2 == "partition" ) && ( $3 ~ /^[0-9]+$/ ) {
+                               total += ( 1000 / 1024 ) * $3
+                       }
+                       END {
+                               # result in kB, change to 1024 Byte blocks
+                               total = total * 1000 / 1024
+                               total = sprintf( "%.1f", total )
+                               print total
+                       }' )
+               fi
        else
-               # default size is 512, so use -k for 1024
-               df_string='df -T -k'
-               # default size is 512, -H only for size in human readable format
+               # default size is 512, , so use -k for 1024 -H only for size in human readable format
                # older bsds don't support -T, pain, so we'll use partial output there
-               df_test=$( df -H -T 2>/dev/null )
-               if [[ -n $df_test ]];then
+               if df -k -T &>/dev/null;then
                        df_string='df -k -T'
                else
                        df_string='df -k'
                fi
+               if swapctl -l -k &>/dev/null;then
+                       swap_size=$( swapctl -l -k 2>/dev/null | gawk '
+                       BEGIN { 
+                       swapSize=0
+                       total=0
+                       }
+                       ( $1 ~ /^\/dev/ ) && ( $2 ~ /^[0-9]+$/ ) {
+                               total += $2
+                       }
+                       END {
+                               # result in blocks already
+                               print total
+                       }' )
+               fi
        fi
+       # echo ss: $swap_size
        hdd_data="$( eval $df_string )"
+       # eval $df_string | awk 'BEGIN{tot=0} !/total/ {tot+=$4} END{print tot}'
        log_function_data 'raw' "hdd_data:\n$hdd_data"
-       hdd_used=$(     echo "$hdd_data" | gawk -v bsdType=$BSD_TYPE '
+       hdd_used=$( echo "$hdd_data" | gawk -v bsdType="$BSD_TYPE" -v swapSize="$swap_size" '
        BEGIN {
                # this is used for specific cases where bind, or incorrect multiple mounts to same partitions,
                # is present. The value is searched for an earlier appearance of that partition and if it is 
@@ -5262,15 +6380,18 @@ get_hdd_data_basic()
                devSet=""
                devWorking=""
                mountWorking=""
+               used=0
        }
        # using $1, not $2, because older bsd df do not have -T, filesystem type
-       ( bsdType != "" ) && $1 ~ /^(aufs|devfs|devtmpfs|fdescfs|filesystem|iso9660|linprocfs|procfs|squashfs|sysfs|tmpfs|type|unionfs)$/ {
+       ( bsdType != "" ) && $1 ~ /^(aufs|devfs|devtmpfs|fdescfs|filesystem|iso9660|linprocfs|nfs|nfs3|nfs4|nfs5|procfs|squashfs|smbfs|sysfs|tmpfs|type|unionfs)$/ {
                # note use next, not getline or it does not work right
                next 
        }
        # also handles odd dm-1 type, from lvm, and mdraid, and some other bsd partition syntax
        # note that linux 3.2.45-grsec-9th types kernels have this type of partition name: /dev/xvdc (no number, letter)
-       /^\/dev\/(mapper\/|[hsv]d[a-z][0-9]+|dm[-]?[0-9]+|ada[0-9]+p[0-9]+.*|md[0-9]+|[aw]d[0-9]+s.*|xvd[a-z])/ {
+       # note: btrfs does not seem to use partition integers, just the primary /dev/sdx identifier
+       # df can also show /dev/disk/(by-label|by-uuid etc)
+       /^\/dev\/(disk\/|mapper\/|[hsv]d[a-z]+[0-9]*|dm[-]?[0-9]+|(ada|mmcblk|nvme[0-9]+n)[0-9]+p[0-9]+.*|(ad|sd|wd)[0-9]+[a-z]|md[0-9]+|[aw]d[0-9]+s.*|xvd[a-z]+)|^ROOT/ {
                # this handles the case where the first item is too long
                # and makes df wrap output to next line, so here we advance
                # it to the next line for that single case. Using df -P should
@@ -5312,9 +6433,11 @@ get_hdd_data_basic()
                }
        }
        END {
-               print used
+               used=used + swapSize
+               used = sprintf( "%.1f", used )
+               print used 
        }' )
-
+       # echo hdu:$hdd_used
        if [[ -z $hdd_used ]];then
                hdd_used='na'
        fi
@@ -5326,10 +6449,10 @@ get_hdd_data_basic()
 
        if [[ $B_PARTITIONS_FILE == 'true' ]];then
                A_HDD_DATA=( $(
-               gawk -v hddused="$hdd_used" '
-               /[hsv]d[a-z]$/ {
+               gawk -v hddUsed=$hdd_used '
+               /([hsv]d[a-z]+|(ada|mmcblk|nvme[0-9]+n)[0-9]+)$/ {
                        driveSize = $(NF - 1)*1024/1000**3
-                       gsub(/,/, " ", driveSize)
+                       gsub(/'"$BAN_LIST_ARRAY"'/, " ", driveSize)
                        gsub(/^ +| +$/, "", driveSize)
                        printf( $NF",%.1fGB,,\n", driveSize )
                }
@@ -5339,33 +6462,43 @@ get_hdd_data_basic()
                # }
                # special case from this data: 8     0  156290904 sda
                # note: vm has 252/253/254 known starter, grsec has 202
-               $1 ~ /^(3|8|22|33|202|252|253|254)$/ && $NF ~ /[hsv]d[a-z]$/ && ( $2 % 16 == 0 || $2 % 16 == 8 ) {
+               $1 ~ /^(3|8|22|33|202|252|253|254)$/ && $NF ~ /[hsv]d[a-z]+$/ && ( $2 % 16 == 0 || $2 % 16 == 8 ) {
                        size += $3
                }
-
                END {
                        size = size*1024/1000**3                   # calculate size in GB size
-                       workingUsed = hddused*1024/1000**3         # calculate workingUsed in GB used
+                       workingUsed = hddUsed*1024/1000**3         # calculate workingUsed in GB used
                        # this handles a special case with livecds where no hdd_used is detected
-                       if ( size > 0 && hddused == "na" ) {
+                       if ( size > 0 && hddUsed == "na" ) {
                                size = sprintf( "%.1f", size )
-                               print size "GB,-"
+                               print size "GB,-,,.."
                        }
                        else if ( size > 0 && workingUsed > 0 ) {
                                diskUsed = workingUsed*100/size  # calculate used percentage
                                diskUsed = sprintf( "%.1f", diskUsed )
+                               if ( int(diskUsed) > 100 ) {
+                                       diskUsed = "Used Error!"
+                               }
+                               else {
+                                       diskUsed = diskUsed "% used"
+                               }
                                size = sprintf( "%.1f", size )
-                               print size "GB," diskUsed "% used"
+                               print size "GB," diskUsed ",,.." 
                        }
                        else {
-                               print "NA,-" # print an empty array, this will be further handled in the print out function
+                               print "NA,-,,.." # print an empty array, this will be further handled in the print out function
                        }
                }' $FILE_PARTITIONS ) )
                log_function_data 'cat' "$FILE_PARTITIONS"
+       else
+               if [[ -n $BSD_TYPE ]];then
+                       get_hard_drive_data_bsd "$hdd_used"
+               fi
        fi
        IFS="$ORIGINAL_IFS"
-       temp_array=${A_HDD_DATA[@]}
-       log_function_data "A_HDD_DATA: $temp_array"
+       a_temp=${A_HDD_DATA[@]}
+       # echo ${a_temp[@]}
+       log_function_data "A_HDD_DATA: $a_temp"
        eval $LOGFE
 }
 
@@ -5374,7 +6507,8 @@ get_hard_drive_data_advanced()
 {
        eval $LOGFS
        local a_temp_working='' a_temp_scsi='' temp_holder='' temp_name='' i='' j=''
-       local sd_ls_by_id='' ls_disk_by_id='' usb_exists='' temp_array=''
+       local sd_ls_by_id='' ls_disk_by_id='' ls_disk_by_path='' usb_exists='' a_temp=''
+       local firewire_exists='' thunderbolt_exists='' thunderbolt_exists='' hdd_temp hdd_serial=''
 
        ## check for all ide type drives, non libata, only do it if hdx is in array
        ## this is now being updated for new /sys type paths, this may handle that ok too
@@ -5423,7 +6557,7 @@ get_hard_drive_data_advanced()
                                        #c=gensub( /^ *vendor: (.+) +model: (.+) +rev:.*$/,"\\1 \\2","g",a[i] )
                                        # the vendor: string is useless, and is a bug, ATA is not a vendor for example
                                        c=gensub( /^ *vendor: (.+) +model: (.+) +rev:.*$/, "\\2", "g", a[i] )
-                                       gsub(/,/, " ", c)
+                                       gsub(/'"$BAN_LIST_ARRAY"'/, " ", c)
                                        gsub(/^ +| +$/, "", c)
                                        gsub(/ [ \t]+/, " ", c)
                                        #print a[i]
@@ -5444,6 +6578,7 @@ get_hard_drive_data_advanced()
                # first pack the main ls variable so we don't have to keep using ls /dev...
                # not all systems have /dev/disk/by-id
                ls_disk_by_id="$( ls -l /dev/disk/by-id 2>/dev/null )"
+               ls_disk_by_path="$( ls -l /dev/disk/by-path 2>/dev/null )"
                for (( i=0; i < ${#A_HDD_DATA[@]} - 1; i++ ))
                do
                        if [[ -n $( grep -E '^sd[a-z]' <<< ${A_HDD_DATA[$i]} ) ]];then
@@ -5454,16 +6589,15 @@ get_hard_drive_data_advanced()
                                # this is handles the new /sys data types first
                                if [[ -e /sys/block/${a_temp_working[0]}/device/model ]];then
                                        temp_name="$( remove_erroneous_chars /sys/block/${a_temp_working[0]}/device/model )"
-                                       temp_name=$( tr ' ' '_' <<< $temp_name | cut -d '-' -f 1 )
+                                       temp_name=$( cut -d '-' -f 1 <<< ${temp_name// /_} )
                                elif [[ ${#a_temp_scsi[@]} -gt 0 ]];then
                                        for (( j=0; j < ${#a_temp_scsi[@]}; j++ ))
                                        do
                                                ## ok, ok, it's incomprehensible, search /dev/disk/by-id for a line that contains the
                                                # discovered disk name AND ends with the correct identifier, sdx
                                                # get rid of whitespace for some drive names and ids, and extra data after - in name
-                                               temp_name=$( tr ' ' '_' <<< ${a_temp_scsi[$j]} | cut -d '-' -f 1 )
+                                               temp_name=$( cut -d '-' -f 1 <<< ${a_temp_scsi[$j]// /_} )
                                                sd_ls_by_id=$( grep -Em1 ".*$temp_name.*${a_temp_working[0]}$" <<< "$ls_disk_by_id" )
-
                                                if [[ -n $sd_ls_by_id ]];then
                                                        temp_name=${a_temp_scsi[$j]}
                                                        break
@@ -5478,11 +6612,24 @@ get_hard_drive_data_advanced()
                                
                                if [[ -z $temp_name ]];then
                                        temp_name="Name n/a"
-                               else 
+                               # maybe remove this from the conditional, detection of usb may not depend on the name
+                               else # 
                                        usb_exists=$( grep -Em1 "usb-.*$temp_name.*${a_temp_working[0]}$" <<< "$ls_disk_by_id" )
+                                       firewire_exists=$( grep -Em1 "ieee1394-.*$temp_name.*${a_temp_working[0]}$" <<< "$ls_disk_by_id" )
+                                       # thunderbolt_exists=$( grep -Em1 "ieee1394-.*$temp_name.*${a_temp_working[0]}$" <<< "$ls_disk_by_id" )
+                                       # note: sometimes with wwn- numbering usb does not appear in by-id but it does in by-path
+                                       if [[ -z $usb_exists ]];then
+                                               usb_exists=$( grep -Em1 "usb-.*${a_temp_working[0]}$" <<< "$ls_disk_by_path" )
+                                       fi
                                        if [[ -n $usb_exists ]];then
                                                a_temp_working[3]='USB'
                                        fi
+                                       if [[ -z $firewire_exists ]];then
+                                               firewire_exists=$( grep -Em1 "ieee1394-.*${a_temp_working[0]}$" <<< "$ls_disk_by_path" )
+                                       fi
+                                       if [[ -n $firewire_exists ]];then
+                                               a_temp_working[3]='FireWire'
+                                       fi
                                fi
                                a_temp_working[2]=$temp_name
                                # these loops are to easily extend the cpu array created in the gawk script above with more fields per cpu.
@@ -5495,11 +6642,130 @@ get_hard_drive_data_advanced()
                                        fi
                                done
                        fi
+                       if [[ $B_EXTRA_DATA == 'true' ]];then
+                               IFS=","
+                               a_temp_working=( ${A_HDD_DATA[i]} )
+                               # echo "a:" ${a_temp_working[@]}
+                               IFS="$ORIGINAL_IFS"
+                               hdd_temp=''
+                               hdd_serial=''
+                               if [[ -n ${a_temp_working[1]} ]];then
+                                       hdd_temp=$( get_hdd_temp_data "/dev/${a_temp_working[0]}" )
+                               fi
+                               if [[ $B_EXTRA_EXTRA_DATA == 'true' ]];then
+                                       hdd_serial=$( get_hdd_serial_number "${a_temp_working[0]}" )
+                               fi
+                               A_HDD_DATA[i]="${a_temp_working[0]},${a_temp_working[1]},${a_temp_working[2]},${a_temp_working[3]},$hdd_serial,$hdd_temp"
+                               # echo b: ${A_HDD_DATA[i]}
+                       fi
                done
-               unset ls_disk_by_id # and then let's dump the data we don't need
        fi
-       temp_array=${A_HDD_DATA[@]}
-       log_function_data "A_HDD_DATA: $temp_array"
+       a_temp=${A_HDD_DATA[@]}
+       log_function_data "A_HDD_DATA: $a_temp"
+       eval $LOGFE
+}
+
+# args: $1 ~ hdd_used
+get_hard_drive_data_bsd()
+{
+       eval $LOGFS
+       
+       local a_temp=''
+       
+       if [[ -n $Dmesg_Boot_Data ]];then
+               IFS=$'\n'
+               A_HDD_DATA=( $( gawk -v hddUsed="$1" -F ':' '
+               BEGIN {
+                       IGNORECASE=1
+                       size=0
+                       bSetSize="false"
+               }
+               $1 ~ /^(ad|ada|mmcblk|nvme[0-9]+n|sd|wd)[0-9]+(|[[:space:]]at.*)$/ {
+                       diskId=gensub(/^((ad|ada|mmcblk|nvme[0-9]+n|sd|wd)[0-9]+)[^0-9].*/,"\\1",1,$1)
+                       # note: /var/run/dmesg.boot may repeat items since it is not created
+                       # fresh every boot, this way, only the last items will be used per disk id
+                       if (aIds[diskId] == "" ) {
+                               aIds[diskId]=diskId
+                               if ( $0 !~ /raid/) { 
+                                       bSetSize="true"
+                               }
+                       }
+                       aDisks[diskId, "id"] = diskId
+                       if ($0 ~ /[^0-9][0-9\.]+[[:space:]]*[MG]B/ && $0 !~ /MB\/s/) {
+                               workingSize=gensub(/.*[^0-9]([0-9\.]+[[:space:]]*[MG]B).*/,"\\1",1,$0)
+                               if (workingSize ~ /GB/ ) {
+                                       sub(/[[:space:]]*GB/,"",workingSize)
+                                       workingSize=workingSize*1000
+                               }
+                               else if (workingSize ~ /MB/ ) {
+                                       sub(/[[:space:]]*MB/,"",workingSize)
+                                       workingSize=workingSize
+                               }
+                               aDisks[diskId, "size"] = workingSize
+                               if ( bSetSize == "true" ) {
+                                       if ( workingSize != "" ){
+                                               size=size+workingSize
+                                               bSetSize="false"
+                                       }
+                               }
+                       }
+                       if ( $NF ~ /<.*>/ ){
+                               gsub(/.*<|>.*/,"",$NF)
+                               aDisks[diskId, "model"] = $NF
+                       }
+                       if ( $NF ~ /serial number/ ){
+                               sub(/serial[[:space:]]+number[[:space:]]*/,"",$NF)
+                               aDisks[diskId, "serial"] = $NF
+                       }
+               }
+               END {
+                       # sde,3.9GB,STORE_N_GO,USB,C200431546D3CF49-0:0,0
+                       # sdd,250.1GB,ST3250824AS,,9ND08GKX,45
+                       # multi dimensional pseudo arrays are sorted at total random, not in order of
+                       # creation, so force a sort of the aIds, which deletes the array index but preserves
+                       # the sorted keys.
+                       asort(aIds) 
+                       
+                       for ( key in aIds ) {
+                               # we are not adding to size above for raid, and we do not print it for raid
+                               # this is re openbsd raid, which uses sd0 for raid array, even though sd is for scsi
+                               if ( aDisks[aIds[key], "model"] !~ /raid/ ) {
+                                       workingSize = aDisks[aIds[key], "size"]/1000
+                                       workingSize = sprintf( "%.1fGB", workingSize )
+                                       print aDisks[aIds[key], "id"] "," workingSize "," aDisks[aIds[key], "model"] "," "," aDisks[aIds[key], "serial"] "," 
+                               }
+                       }
+                       size = size/1000                # calculate size in GB size
+                       # in kb
+                       workingUsed = hddUsed*1024/1000**3         # calculate workingUsed in GB used
+                       # this handles a special case with livecds where no hdd_used is detected
+                       if ( size > 0 && hddUsed == "na" ) {
+                               size = sprintf( "%.1f", size )
+                               print size "GB,-,,.."
+                       }
+                       else if ( size > 0 && workingUsed > 0 ) {
+                               diskUsed = workingUsed*100/size  # calculate used percentage
+                               diskUsed = sprintf( "%.1f", diskUsed )
+                               if ( int(diskUsed) > 100 ) {
+                                       diskUsed = "Used Error!"
+                               }
+                               else {
+                                       diskUsed = diskUsed "% used"
+                               }
+                               size = sprintf( "%.1f", size )
+                               print size "GB," diskUsed ",,.." 
+                       }
+                       else {
+                               print "NA,-,,.." # print an empty array, this will be further handled in the print out function
+                       }
+               }' <<< "$Dmesg_Boot_Data" ) )
+               IFS="$ORIGINAL_IFS"
+       fi
+       
+       a_temp=${A_HDD_DATA[@]}
+       # echo ${a_temp[@]}
+       log_function_data "A_HDD_DATA: $a_temp"
+       
        eval $LOGFE
 }
 
@@ -5562,7 +6828,7 @@ get_init_data()
 {
        eval $LOGFS
        
-       local init_type='' init_version='' rc_type='' rc_version='' temp_array=''
+       local init_type='' init_version='' rc_type='' rc_version='' a_temp=''
        local ls_run='' strings_init_version=''
        local runlevel=$( get_runlevel_data )
        local default_runlevel=$( get_runlevel_default )
@@ -5572,11 +6838,13 @@ get_init_data()
        # more data may be needed for other init systems.
        if [[ -e /proc/1/comm && -n $( grep -s 'systemd' /proc/1/comm ) ]];then
                init_type='systemd'
-               if [[ -n $( type -p systemd ) ]];then
-                       init_version=$( get_de_app_version 'systemd' '^systemd' '2' )
+               if type -p systemd &>/dev/null;then
+                       init_version=$( get_program_version 'systemd' '^systemd' '2' )
                fi
-               if [[ -z $init_version && -n $( type -p systemctl ) ]];then
-                       init_version=$( get_de_app_version 'systemctl' '^systemd' '2' )
+               if [[ -z $init_version ]];then
+                       if type -p systemctl &>/dev/null;then
+                               init_version=$( get_program_version 'systemctl' '^systemd' '2' )
+                       fi
                fi
        else
                ls_run=$(ls /run)
@@ -5584,37 +6852,49 @@ get_init_data()
                if [[ -n $( /sbin/init --version 2>/dev/null | grep 'upstart' ) ]];then
                        init_type='Upstart'
                        # /sbin/init --version == init (upstart 1.12.1)
-                       init_version=$( get_de_app_version 'init' 'upstart' '3' )
-               elif [[ -n $( type -p epoch ) ]];then
+                       init_version=$( get_program_version 'init' 'upstart' '3' )
+               elif [[ -e /proc/1/comm && -n $( grep -s 'epoch' /proc/1/comm ) ]];then
                        init_type='Epoch'
                        # epoch version == Epoch Init System 1.0.1 "Sage"
-            &