aboutsummaryrefslogtreecommitdiffstats
path: root/inxi
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2015-08-17 15:48:31 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2015-08-17 15:48:31 -0400
commit35ddf848228bfd4748f84d58a1d741d0623d2b66 (patch)
treedd3718445caad5bfc3c438d7018cd09887f42bd4 /inxi
parentb8f908878d9f473ee3b030228ba1487c6de02f9d (diff)
downloadinxi-35ddf848228bfd4748f84d58a1d741d0623d2b66.tar.bz2
inxi-35ddf848228bfd4748f84d58a1d741d0623d2b66.tar.xz
inxi-35ddf848228bfd4748f84d58a1d741d0623d2b66.tar.zst
Imported Upstream version 2.2.27upstream/2.2.27
Diffstat (limited to 'inxi')
-rwxr-xr-xinxi120
1 files changed, 98 insertions, 22 deletions
diff --git a/inxi b/inxi
index 64c1922..c65bb8f 100755
--- a/inxi
+++ b/inxi
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
########################################################################
#### Script Name: inxi
-#### Version: 2.2.21
-#### Date: 2015-05-13
+#### Version: 2.2.27
+#### Date: 2015-08-02
#### Patch Number: 00
########################################################################
#### SPECIAL THANKS
@@ -603,12 +603,12 @@ BLUE,WHITE,NORMAL
# the derived distro's version file should go first. (Such as with Sabayon / Gentoo)
DISTROS_DERIVED="antix-version aptosid-version kanotix-version knoppix-version mandrake-release pardus-release porteus-version sabayon-release siduction-version sidux-version slitaz-release solusos-release turbolinux-release zenwalk-version"
# 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
@@ -1947,9 +1947,42 @@ debug_data_collector()
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
@@ -4497,24 +4530,45 @@ get_desktop_environment()
# set the default, this function only runs in X, if null, don't print data out
local desktop_environment='' xprop_root='' version2=''
- local version='' version_data='' toolkit=''
+ 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
@@ -4860,7 +4914,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
@@ -4963,8 +5017,11 @@ get_display_manager()
for dm_id in $dm_id_list
do
# note: ${dm_id%.*}/$dm_id will create a dir name out of the dm id, then test if pid is in that
- if [[ -f /run/$dm_id || -f /run/${dm_id%.*}/$dm_id || -f /var/run/$dm_id || \
- -f /var/run/${dm_id%.*}/$dm_id ]];then
+ # 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${dm_id%.*}
separator=','
@@ -7294,8 +7351,8 @@ get_networking_usb_data()
get_networking_wan_ip_data()
{
eval $LOGFS
- local ip='' ip_data='' downloader_error=0
-
+ local ip='' ip_data='' downloader_error=0 ua=''
+
# get ip using wget redirect to stdout. This is a clean, text only IP output url,
# single line only, ending in the ip address. May have to modify this in the future
# to handle ipv4 and ipv6 addresses but should not be necessary.
@@ -7304,7 +7361,10 @@ get_networking_wan_ip_data()
# ip=$( wget -q -O - $WAN_IP_URL | gawk --re-interval '
case $DOWNLOADER in
curl)
- ip_data="$( curl -y $DL_TIMEOUT -s $WAN_IP_URL )" || downloader_error=$?
+ if [[ -n $( grep 'smxi.org' <<< $WAN_IP_URL ) ]];then
+ ua="-A s-tools/inxi-ip"
+ fi
+ ip_data="$( curl $ua -y $DL_TIMEOUT -s $WAN_IP_URL )" || downloader_error=$?
;;
fetch)
ip_data="$( fetch -T $DL_TIMEOUT -q -o - $WAN_IP_URL )" || downloader_error=$?
@@ -7313,7 +7373,10 @@ get_networking_wan_ip_data()
ip_data="$( ftp -o - $WAN_IP_URL 2>/dev/null )" || downloader_error=$?
;;
wget)
- ip_data="$( wget -T $DL_TIMEOUT -q -O - $WAN_IP_URL )" || downloader_error=$?
+ if [[ -n $( grep 'smxi.org' <<< $WAN_IP_URL ) ]];then
+ ua="-U s-tools/inxi-ip"
+ fi
+ ip_data="$( wget $ua -T $DL_TIMEOUT -q -O - $WAN_IP_URL )" || downloader_error=$?
;;
no-downloader)
downloader_error=1
@@ -13007,17 +13070,30 @@ print_ps_item()
eval $LOGFS
local a_ps_data='' ps_data='' line_starter='' line_start_data='' full_line=''
local app_name='' app_pid='' app_cpu='' app_mem='' throttled='' app_daemon=''
- local b_print_first=$2 line_counter=0 i=0 count_nu='' extra_data=''
+ local b_print_first=$2 line_counter=0 i=0 count_nu='' extra_data='' memory='' extra_text=''
if [[ -n $PS_THROTTLED ]];then
throttled=" ${C1} - throttled from${C2} $PS_THROTTLED"
fi
+ # important: ${C2} $PS_COUNT must have space after ${C2} for irc output or the number vanishes
case $1 in
cpu)
- line_start_data="${C1}CPU - % used - top ${C2} $PS_COUNT ${C1}active$throttled "
+ if [[ $B_EXTRA_DATA == 'true' ]];then
+ extra_text=" ${C1}- Memory$SEP3 MB / % used"
+ if [[ $B_SHOW_INFO == 'false' && $B_SHOW_PS_MEM_DATA == 'false' ]];then
+ memory=" - ${C1}Used/Total$SEP3${C2} $( get_memory_data )"
+ fi
+ fi
+ line_start_data="${C1}CPU$SEP3 % used$extra_text$memory${C1} - top${C2} $PS_COUNT ${C1}active$throttled"
;;
mem)
- line_start_data="${C1}Memory - MB / % used - top ${C2} $PS_COUNT ${C1}active$throttled"
+ if [[ $B_EXTRA_DATA == 'true' ]];then
+ extra_text=" ${C1}- CPU$SEP3 % used"
+ fi
+ if [[ $B_SHOW_INFO == 'false' ]];then
+ memory=" - ${C1}Used/Total$SEP3${C2} $( get_memory_data )"
+ fi
+ line_start_data="${C1}Memory$SEP3 MB / % used$memory$extra_text${C1} - top${C2} $PS_COUNT ${C1}active$throttled"
;;
esac