mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
some bug fixes, bsd fixes; set gpu default for out of x temps, guessing there at :0.0 screen; changed to if type -p program &>/dev/null;then
instead of $(type -p program) subshell. I'll see if getting rid of as many subshells as possible has much impact on performance, certainly makes the code ugly but maybe it's worth it. No version change.
This commit is contained in:
parent
21a520950e
commit
8d6b87f9d8
297
inxi
297
inxi
|
@ -54,7 +54,7 @@
|
||||||
#### * bash >=3.0 (bash); df, readlink, stty, tr, uname, wc (coreutils);
|
#### * bash >=3.0 (bash); df, readlink, stty, tr, uname, wc (coreutils);
|
||||||
#### gawk (gawk); grep (grep); lspci (pciutils);
|
#### gawk (gawk); grep (grep); lspci (pciutils);
|
||||||
#### ps, uptime (procps); find (findutils)
|
#### ps, uptime (procps); find (findutils)
|
||||||
#### * Also the proc filesystem should be present and mounted
|
#### * Also the proc filesystem should be present and mounted for Linux
|
||||||
#### * Some features, like -M and -d will not work, or will work incompletely,
|
#### * Some features, like -M and -d will not work, or will work incompletely,
|
||||||
#### if /sys is missing
|
#### if /sys is missing
|
||||||
####
|
####
|
||||||
|
@ -644,7 +644,7 @@ main()
|
||||||
fi
|
fi
|
||||||
## sometimes tput will trigger an error (mageia) if irc client
|
## sometimes tput will trigger an error (mageia) if irc client
|
||||||
if [[ $B_IRC == 'false' ]];then
|
if [[ $B_IRC == 'false' ]];then
|
||||||
if [[ -n $( type -p tput ) ]];then
|
if type -p tput &>/dev/null;then
|
||||||
TERM_COLUMNS=$(tput cols)
|
TERM_COLUMNS=$(tput cols)
|
||||||
TERM_LINES=$(tput lines)
|
TERM_LINES=$(tput lines)
|
||||||
fi
|
fi
|
||||||
|
@ -813,9 +813,9 @@ initialize_data()
|
||||||
BSD_VERSION=$( uname -s 2>/dev/null | tr '[A-Z]' '[a-z]' )
|
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
|
# note: archbsd says they are a freebsd distro, so assuming it's the same as freebsd
|
||||||
if [[ -n $( grep 'bsd' <<< "$BSD_VERSION" ) ]];then
|
if [[ *"bsd"* == "$BSD_VERSION" ]];then
|
||||||
# GNU/kfreebsd will by definition have GNU tools like sed/grep
|
# GNU/kfreebsd will by definition have GNU tools like sed/grep
|
||||||
if [[ -n $( grep 'kfreebsd' <<< "$BSD_VERSION" ) ]];then
|
if [[ *"kfreebsd"* == "$BSD_VERSION" ]];then
|
||||||
BSD_TYPE='debian-bsd' # debian gnu bsd
|
BSD_TYPE='debian-bsd' # debian gnu bsd
|
||||||
else
|
else
|
||||||
BSD_TYPE='bsd' # all other bsds
|
BSD_TYPE='bsd' # all other bsds
|
||||||
|
@ -888,7 +888,7 @@ initialize_data()
|
||||||
B_XORG_LOG='true'
|
B_XORG_LOG='true'
|
||||||
else
|
else
|
||||||
# Detect location of the Xorg log file
|
# 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}')
|
FILE_XORG_LOG=$( xset q 2>/dev/null | grep -i 'Log file' | gawk '{print $3}')
|
||||||
if [[ -e $FILE_XORG_LOG ]];then
|
if [[ -e $FILE_XORG_LOG ]];then
|
||||||
B_XORG_LOG='true'
|
B_XORG_LOG='true'
|
||||||
|
@ -981,22 +981,22 @@ check_recommended_apps()
|
||||||
script_debugger "Suggestion: update to Bash v3.1 for optimal inxi output"
|
script_debugger "Suggestion: update to Bash v3.1 for optimal inxi output"
|
||||||
fi
|
fi
|
||||||
# test for a few apps that bsds may not have after initial tests
|
# 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'
|
B_LSPCI='true'
|
||||||
fi
|
fi
|
||||||
if [[ -n $BSD_TYPE ]];then
|
if [[ -n $BSD_TYPE ]];then
|
||||||
if [[ -n $( type -p sysctl ) ]];then
|
if type -p sysctl &>/dev/null;then
|
||||||
B_SYSCTL='true'
|
B_SYSCTL='true'
|
||||||
fi
|
fi
|
||||||
if [[ -n $( type -p pciconf ) ]];then
|
if type -p pciconf &>/dev/null;then
|
||||||
B_PCICONF='true'
|
B_PCICONF='true'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# now setting qdbus/dcop for first run, some systems can have both by the way
|
# 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'
|
B_QDBUS='true'
|
||||||
fi
|
fi
|
||||||
if [[ -n $( type -p dcop ) ]];then
|
if type -p dcop &>/dev/null;then
|
||||||
B_DCOP='true'
|
B_DCOP='true'
|
||||||
fi
|
fi
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
|
@ -1007,7 +1007,7 @@ check_recommended_apps()
|
||||||
check_required_apps()
|
check_required_apps()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local app_name='' app_path=''
|
local app_name=''
|
||||||
# bc removed from deps for now
|
# 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 uptime wc"
|
||||||
|
|
||||||
|
@ -1026,8 +1026,7 @@ check_required_apps()
|
||||||
if [[ $B_RUNNING_IN_DISPLAY == 'true' ]];then
|
if [[ $B_RUNNING_IN_DISPLAY == 'true' ]];then
|
||||||
for app_name in $x_apps
|
for app_name in $x_apps
|
||||||
do
|
do
|
||||||
app_path=$( type -p $app_name )
|
if ! type -p $app_path &>/dev/null;then
|
||||||
if [[ -z $app_path ]];then
|
|
||||||
script_debugger "Resuming in non X mode: $app_name not found. For package install advice run: $SCRIPT_NAME --recommends"
|
script_debugger "Resuming in non X mode: $app_name not found. For package install advice run: $SCRIPT_NAME --recommends"
|
||||||
B_SHOW_DISPLAY_DATA='false'
|
B_SHOW_DISPLAY_DATA='false'
|
||||||
break
|
break
|
||||||
|
@ -1039,8 +1038,7 @@ check_required_apps()
|
||||||
|
|
||||||
for app_name in $depends
|
for app_name in $depends
|
||||||
do
|
do
|
||||||
app_path=$( type -p $app_name )
|
if ! type -p $app_path &>/dev/null;then
|
||||||
if [[ -z $app_path ]];then
|
|
||||||
error_handler 5 "$app_name"
|
error_handler 5 "$app_name"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -1488,7 +1486,7 @@ script_self_updater()
|
||||||
if [[ -f /usr/share/man/man8/inxi.8.gz ]];then
|
if [[ -f /usr/share/man/man8/inxi.8.gz ]];then
|
||||||
print_screen_output "Updating man page location to man1."
|
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
|
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
|
exec $( type -p mandb ) -q
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -1798,20 +1796,20 @@ check_recommends_user_output()
|
||||||
echo "the main languages and tools $SCRIPT_NAME uses. Python is only for debugging data collection."
|
echo "the main languages and tools $SCRIPT_NAME uses. Python is only for debugging data collection."
|
||||||
echo $Line
|
echo $Line
|
||||||
echo "Bash version: $( bash --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^GNU bash/ {print $4}' )"
|
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}' )
|
gawk_version=$( gawk --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^GNU Awk/ {print $3}' )
|
||||||
fi
|
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}' )
|
sed_version=$( sed --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^GNU sed version/ {print $4}' )
|
||||||
if [[ -z $sed_version ]];then
|
if [[ -z $sed_version ]];then
|
||||||
# note: bsd sed shows error with --version flag
|
# note: bsd sed shows error with --version flag
|
||||||
sed_version=$( sed --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^sed: illegal option/ {print "BSD sed"}' )
|
sed_version=$( sed --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^sed: illegal option/ {print "BSD sed"}' )
|
||||||
fi
|
fi
|
||||||
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}' )
|
sudo_version=$( sudo -V 2>&1 | awk 'BEGIN {IGNORECASE=1} /^Sudo version/ {print $3}' )
|
||||||
fi
|
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}' )
|
python_version=$( python --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^Python/ {print $2}' )
|
||||||
fi
|
fi
|
||||||
echo "Gawk version: $gawk_version"
|
echo "Gawk version: $gawk_version"
|
||||||
|
@ -3184,7 +3182,7 @@ set_perl_python_konvi()
|
||||||
{
|
{
|
||||||
if [[ -z $IRC_CLIENT_VERSION ]];then
|
if [[ -z $IRC_CLIENT_VERSION ]];then
|
||||||
# this is a hack to try to show konversation if inxi is running but started via /cmd
|
# 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
|
if [[ -n $( grep -i 'konversation' <<< "$Ps_aux_Data" ) && $B_RUNNING_IN_DISPLAY == 'true' ]];then
|
||||||
IRC_CLIENT='Konversation'
|
IRC_CLIENT='Konversation'
|
||||||
IRC_CLIENT_VERSION=" $( konversation --version 2>/dev/null | gawk '/^Konversation/ {print $2}' )"
|
IRC_CLIENT_VERSION=" $( konversation --version 2>/dev/null | gawk '/^Konversation/ {print $2}' )"
|
||||||
B_CONSOLE_IRC='false'
|
B_CONSOLE_IRC='false'
|
||||||
|
@ -3399,13 +3397,12 @@ get_audio_data()
|
||||||
get_audio_usb_data()
|
get_audio_usb_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local usb_proc_file='' array_count='' usb_data='' usb_id='' lsusb_path='' lsusb_data=''
|
local usb_proc_file='' array_count='' usb_data='' usb_id='' lsusb_data=''
|
||||||
local a_temp=''
|
local a_temp=''
|
||||||
|
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
lsusb_path=$( type -p lsusb )
|
if type -p lsusb &>/dev/null;then
|
||||||
if [[ -n $lsusb_path ]];then
|
lsusb_data=$( lsusb 2>/dev/null )
|
||||||
lsusb_data=$( $lsusb_path 2>/dev/null )
|
|
||||||
fi
|
fi
|
||||||
log_function_data 'raw' "usb_data:\n$lsusb_data"
|
log_function_data 'raw' "usb_data:\n$lsusb_data"
|
||||||
if [[ -n $lsusb_data ]];then
|
if [[ -n $lsusb_data ]];then
|
||||||
|
@ -3705,7 +3702,9 @@ get_cpu_data_bsd()
|
||||||
if [[ $BSD_VERSION == 'openbsd' ]];then
|
if [[ $BSD_VERSION == 'openbsd' ]];then
|
||||||
gawk_fs='='
|
gawk_fs='='
|
||||||
fi
|
fi
|
||||||
|
# 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
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
A_CPU_DATA=( $(
|
A_CPU_DATA=( $(
|
||||||
gawk -F "$gawk_fs" -v cpuFlags="$bsd_cpu_flags" '
|
gawk -F "$gawk_fs" -v cpuFlags="$bsd_cpu_flags" '
|
||||||
|
@ -3740,6 +3739,7 @@ get_cpu_data_bsd()
|
||||||
print "N/A"
|
print "N/A"
|
||||||
}' <<< "$Sysctl_a_Data" ) )
|
}' <<< "$Sysctl_a_Data" ) )
|
||||||
IFS="$ORIGINAL_IFS"
|
IFS="$ORIGINAL_IFS"
|
||||||
|
fi
|
||||||
|
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
|
@ -3748,7 +3748,10 @@ get_cpu_flags_bsd()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
|
|
||||||
local cpu_flags=$( gawk -F '=' '
|
local cpu_flags=''
|
||||||
|
|
||||||
|
if [[ -n $Dmesg_Boot_Data ]];then
|
||||||
|
cpu_flags=$( gawk -F '=' '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
cpuFlags=""
|
cpuFlags=""
|
||||||
|
@ -3768,7 +3771,7 @@ get_cpu_flags_bsd()
|
||||||
print cpuFlags
|
print cpuFlags
|
||||||
exit
|
exit
|
||||||
}' <<< "$Dmesg_Boot_Data" )
|
}' <<< "$Dmesg_Boot_Data" )
|
||||||
|
fi
|
||||||
echo $cpu_flags
|
echo $cpu_flags
|
||||||
log_function_data "$cpu_flags"
|
log_function_data "$cpu_flags"
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
|
@ -4002,7 +4005,7 @@ get_desktop_environment()
|
||||||
fi
|
fi
|
||||||
# did we find it? If not, start the xprop tests
|
# did we find it? If not, start the xprop tests
|
||||||
if [[ -z $desktop_environment ]];then
|
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 )"
|
xprop_root="$( xprop -root 2>/dev/null )"
|
||||||
fi
|
fi
|
||||||
# note that cinnamon split from gnome, and and can now be id'ed via xprop,
|
# note that cinnamon split from gnome, and and can now be id'ed via xprop,
|
||||||
|
@ -4038,9 +4041,9 @@ get_desktop_environment()
|
||||||
# note, GNOME_DESKTOP_SESSION_ID is deprecated so we'll see how that works out
|
# note, GNOME_DESKTOP_SESSION_ID is deprecated so we'll see how that works out
|
||||||
# https://bugzilla.gnome.org/show_bug.cgi?id=542880
|
# https://bugzilla.gnome.org/show_bug.cgi?id=542880
|
||||||
elif [[ -n $GNOME_DESKTOP_SESSION_ID ]]; then
|
elif [[ -n $GNOME_DESKTOP_SESSION_ID ]]; then
|
||||||
if [[ -n $( type -p gnome-shell ) ]];then
|
if type -p gnome-shell &>/dev/null;then
|
||||||
version=$( get_de_app_version 'gnome-shell' 'gnome' '3' )
|
version=$( get_de_app_version 'gnome-shell' 'gnome' '3' )
|
||||||
elif [[ -n $( type -p gnome-about ) ]];then
|
elif type -p gnome-about &>/dev/null;then
|
||||||
version=$( get_de_app_version 'gnome-about' 'gnome' '3' )
|
version=$( get_de_app_version 'gnome-about' 'gnome' '3' )
|
||||||
fi
|
fi
|
||||||
if [[ $B_EXTRA_DATA == 'true' ]];then
|
if [[ $B_EXTRA_DATA == 'true' ]];then
|
||||||
|
@ -4091,7 +4094,7 @@ get_desktop_environment()
|
||||||
fi
|
fi
|
||||||
desktop_environment="Xfce"
|
desktop_environment="Xfce"
|
||||||
elif [[ -n $( grep -is 'BLACKBOX_PID' <<< "$xprop_root" ) ]];then
|
elif [[ -n $( grep -is 'BLACKBOX_PID' <<< "$xprop_root" ) ]];then
|
||||||
if [[ -n $( grep -is 'fluxbox' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
|
if [[ -n $( grep -is 'fluxbox' <<< "$Ps_aux_Data" ) ]];then
|
||||||
version=$( get_de_app_version 'fluxbox' '^fluxbox' '2' )
|
version=$( get_de_app_version 'fluxbox' '^fluxbox' '2' )
|
||||||
desktop_environment='Fluxbox'
|
desktop_environment='Fluxbox'
|
||||||
else
|
else
|
||||||
|
@ -4101,12 +4104,12 @@ get_desktop_environment()
|
||||||
# note: openbox-lxde --version may be present, but returns openbox data
|
# note: openbox-lxde --version may be present, but returns openbox data
|
||||||
version=$( get_de_app_version 'openbox' '^openbox' '2' )
|
version=$( get_de_app_version 'openbox' '^openbox' '2' )
|
||||||
if [[ $XDG_CURRENT_DESKTOP == 'LXDE' || \
|
if [[ $XDG_CURRENT_DESKTOP == 'LXDE' || \
|
||||||
-n $( grep -is 'lxde' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
|
-n $( grep -is 'lxde' <<< "$Ps_aux_Data" ) ]];then
|
||||||
if [[ -n $version ]];then
|
if [[ -n $version ]];then
|
||||||
version="(Openbox $version)"
|
version="(Openbox $version)"
|
||||||
fi
|
fi
|
||||||
desktop_environment='LXDE'
|
desktop_environment='LXDE'
|
||||||
elif [[ -n $( grep -is 'razor-desktop' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
|
elif [[ -n $( grep -is 'razor-desktop' <<< "$Ps_aux_Data" ) ]];then
|
||||||
if [[ -n $version ]];then
|
if [[ -n $version ]];then
|
||||||
version="(Openbox $version)"
|
version="(Openbox $version)"
|
||||||
fi
|
fi
|
||||||
|
@ -4151,37 +4154,37 @@ get_desktop_environment()
|
||||||
# a few manual hacks for things that don't id with xprop, these are just good guesses
|
# a few manual hacks for things that don't id with xprop, these are just good guesses
|
||||||
# note that gawk is going to exit after first occurance of search string, so no need for extra
|
# note that gawk is going to exit after first occurance of search string, so no need for extra
|
||||||
if [[ -z $desktop_environment ]];then
|
if [[ -z $desktop_environment ]];then
|
||||||
if [[ -n $( grep -is 'fvwm-crystal' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
|
if [[ -n $( grep -is 'fvwm-crystal' <<< "$Ps_aux_Data" ) ]];then
|
||||||
version=$( get_de_app_version 'fvwm' '^fvwm' '2' )
|
version=$( get_de_app_version 'fvwm' '^fvwm' '2' )
|
||||||
desktop_environment='FVWM-Crystal'
|
desktop_environment='FVWM-Crystal'
|
||||||
elif [[ -n $( grep -is 'fvwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
|
elif [[ -n $( grep -is 'fvwm' <<< "$Ps_aux_Data" ) ]];then
|
||||||
version=$( get_de_app_version 'fvwm' '^fvwm' '2' )
|
version=$( get_de_app_version 'fvwm' '^fvwm' '2' )
|
||||||
desktop_environment='FVWM'
|
desktop_environment='FVWM'
|
||||||
elif [[ -n $( grep -is 'pekwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
|
elif [[ -n $( grep -is 'pekwm' <<< "$Ps_aux_Data" ) ]];then
|
||||||
version=$( get_de_app_version 'pekwm' '^pekwm' '3' )
|
version=$( get_de_app_version 'pekwm' '^pekwm' '3' )
|
||||||
desktop_environment='pekwm'
|
desktop_environment='pekwm'
|
||||||
elif [[ -n $( grep -is 'awesome' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
|
elif [[ -n $( grep -is 'awesome' <<< "$Ps_aux_Data" ) ]];then
|
||||||
version=$( get_de_app_version 'awesome' '^awesome' '2' )
|
version=$( get_de_app_version 'awesome' '^awesome' '2' )
|
||||||
desktop_environment='Awesome'
|
desktop_environment='Awesome'
|
||||||
elif [[ -n $( grep -is 'scrotwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
|
elif [[ -n $( grep -is 'scrotwm' <<< "$Ps_aux_Data" ) ]];then
|
||||||
version=$( get_de_app_version 'scrotwm' '^welcome.*scrotwm' '4' )
|
version=$( get_de_app_version 'scrotwm' '^welcome.*scrotwm' '4' )
|
||||||
desktop_environment='Scrotwm' # no --version for this one
|
desktop_environment='Scrotwm' # no --version for this one
|
||||||
elif [[ -n $( grep -is 'spectrwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
|
elif [[ -n $( grep -is 'spectrwm' <<< "$Ps_aux_Data" ) ]];then
|
||||||
version=$( get_de_app_version 'spectrwm' '^spectrwm.*welcome.*spectrwm' '5' )
|
version=$( get_de_app_version 'spectrwm' '^spectrwm.*welcome.*spectrwm' '5' )
|
||||||
desktop_environment='Spectrwm' # no --version for this one
|
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
|
desktop_environment='Twm' # no --version for this one
|
||||||
elif [[ -n $( grep -Eis '([[:space:]]|/)dwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
|
elif [[ -n $( grep -Eis '([[:space:]]|/)dwm' <<< "$Ps_aux_Data" ) ]];then
|
||||||
version=$( get_de_app_version 'dwm' '^dwm' '1' )
|
version=$( get_de_app_version 'dwm' '^dwm' '1' )
|
||||||
desktop_environment='dwm'
|
desktop_environment='dwm'
|
||||||
elif [[ -n $( grep -is 'wmii2' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
|
elif [[ -n $( grep -is 'wmii2' <<< "$Ps_aux_Data" ) ]];then
|
||||||
version=$( get_de_app_version 'wmii2' '^wmii2' '1' )
|
version=$( get_de_app_version 'wmii2' '^wmii2' '1' )
|
||||||
desktop_environment='wmii2'
|
desktop_environment='wmii2'
|
||||||
# note: in debian at least, wmii is actuall wmii3
|
# note: in debian at least, wmii is actuall wmii3
|
||||||
elif [[ -n $( grep -is 'wmii' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
|
elif [[ -n $( grep -is 'wmii' <<< "$Ps_aux_Data" ) ]];then
|
||||||
version=$( get_de_app_version 'wmii' '^wmii' '1' )
|
version=$( get_de_app_version 'wmii' '^wmii' '1' )
|
||||||
desktop_environment='wmii'
|
desktop_environment='wmii'
|
||||||
elif [[ -n $( grep -Eis '([[:space:]]|/)jwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then
|
elif [[ -n $( grep -Eis '([[:space:]]|/)jwm' <<< "$Ps_aux_Data" ) ]];then
|
||||||
version=$( get_de_app_version 'jwm' '^jwm' '2' )
|
version=$( get_de_app_version 'jwm' '^jwm' '2' )
|
||||||
desktop_environment='JWM'
|
desktop_environment='JWM'
|
||||||
fi
|
fi
|
||||||
|
@ -4221,7 +4224,7 @@ get_de_app_version()
|
||||||
;;
|
;;
|
||||||
# quick debian/buntu hack until I find a universal way to get version for these
|
# quick debian/buntu hack until I find a universal way to get version for these
|
||||||
dash)
|
dash)
|
||||||
if [[ -n $( type -p dpkg ) ]];then
|
if type -p dpkg &>/dev/null;then
|
||||||
version_data="$( dpkg -l $1 2>/dev/null )"
|
version_data="$( dpkg -l $1 2>/dev/null )"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -4279,7 +4282,7 @@ get_de_gtk_data()
|
||||||
|
|
||||||
# this is a hack, and has to be changed with every toolkit version change, and only dev systems
|
# 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
|
# 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 )
|
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
|
# note: opensuse gets null output here, we need the command to get version and output sample
|
||||||
if [[ -z $toolkit ]];then
|
if [[ -z $toolkit ]];then
|
||||||
|
@ -4294,7 +4297,7 @@ get_de_gtk_data()
|
||||||
# we'll try some known package managers next. dpkg will handle a lot of distros
|
# 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
|
# 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.
|
# too much work, just the very biggest ones.
|
||||||
if [[ -n $( type -p dpkg ) ]];then
|
if type -p dpkg &>/dev/null;then
|
||||||
toolkit=$( dpkg -s libgtk-3-0 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' )
|
toolkit=$( dpkg -s libgtk-3-0 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' )
|
||||||
if [[ -z $toolkit ]];then
|
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 ':' '/^Version/ {print $2}' )
|
||||||
|
@ -4303,7 +4306,7 @@ get_de_gtk_data()
|
||||||
if [[ -z $toolkit ]];then
|
if [[ -z $toolkit ]];then
|
||||||
toolkit=$( dpkg -s libgtk-4-0 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' )
|
toolkit=$( dpkg -s libgtk-4-0 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' )
|
||||||
fi
|
fi
|
||||||
elif [[ -n $( type -p pacman ) ]];then
|
elif type -p pacman &>/dev/null;then
|
||||||
toolkit=$( pacman -Qi gtk3 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' )
|
toolkit=$( pacman -Qi gtk3 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' )
|
||||||
if [[ -z $toolkit ]];then
|
if [[ -z $toolkit ]];then
|
||||||
toolkit=$( pacman -Qi gtk2 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' )
|
toolkit=$( pacman -Qi gtk2 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' )
|
||||||
|
@ -4557,7 +4560,7 @@ get_distro_lsb_os_release_data()
|
||||||
;;
|
;;
|
||||||
lsb-app)
|
lsb-app)
|
||||||
# this is HORRIBLY slow, not using
|
# 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 ':' '
|
distro=$( echo "$( lsb_release -irc )" | gawk -F ':' '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
|
@ -4739,7 +4742,8 @@ get_dmesg_boot_data()
|
||||||
|
|
||||||
if [[ $B_DMESG_BOOT_FILE == 'true' ]];then
|
if [[ $B_DMESG_BOOT_FILE == 'true' ]];then
|
||||||
# replace all indented items with ~ so we can id them easily while processing
|
# 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
|
||||||
|
dmsg_boot_data="$( cat $FILE_DMESG_BOOT 2>/dev/null | sed $SED_RX 's/"//g' )"
|
||||||
fi
|
fi
|
||||||
echo "$dmsg_boot_data"
|
echo "$dmsg_boot_data"
|
||||||
# log_function_data "$dmsg_boot_data"
|
# log_function_data "$dmsg_boot_data"
|
||||||
|
@ -4801,8 +4805,9 @@ get_gpu_temp_data()
|
||||||
local gpu_temp='' gpu_fan='' screens='' screen_nu='' gpu_temp_looper=''
|
local gpu_temp='' gpu_fan='' screens='' screen_nu='' gpu_temp_looper=''
|
||||||
|
|
||||||
# we'll try for nvidia/ati, then add if more are shown
|
# we'll try for nvidia/ati, then add if more are shown
|
||||||
if [[ -n $( type -p nvidia-settings ) ]];then
|
if type -p nvidia-settings &>/dev/null;then
|
||||||
# first get the number of screens
|
# 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 '
|
screens=$( nvidia-settings -q screens | gawk '
|
||||||
/:[0-9]\.[0-9]/ {
|
/:[0-9]\.[0-9]/ {
|
||||||
screens=screens gensub(/(.*)(:[0-9]\.[0-9])(.*)/, "\\2", "1", $0) " "
|
screens=screens gensub(/(.*)(:[0-9]\.[0-9])(.*)/, "\\2", "1", $0) " "
|
||||||
|
@ -4811,11 +4816,15 @@ get_gpu_temp_data()
|
||||||
print screens
|
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
|
# now we'll get the gpu temp for each screen discovered. The print out function
|
||||||
# will handle removing screen data for single gpu systems
|
# will handle removing screen data for single gpu systems
|
||||||
for screen_nu in $screens
|
for screen_nu in $screens
|
||||||
do
|
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 {
|
BEGIN {
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
gpuTemp=""
|
gpuTemp=""
|
||||||
|
@ -4833,7 +4842,7 @@ get_gpu_temp_data()
|
||||||
screen_nu=$( cut -d ':' -f 2 <<< $screen_nu )
|
screen_nu=$( cut -d ':' -f 2 <<< $screen_nu )
|
||||||
gpu_temp="$gpu_temp$screen_nu:$gpu_temp_looper "
|
gpu_temp="$gpu_temp$screen_nu:$gpu_temp_looper "
|
||||||
done
|
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=0 --od-gettemperature | gawk -F ': ' '
|
||||||
gpu_temp=$( aticonfig --adapter=all --od-gettemperature | gawk -F ': ' '
|
gpu_temp=$( aticonfig --adapter=all --od-gettemperature | gawk -F ': ' '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
|
@ -5215,13 +5224,13 @@ get_graphics_display_server_version()
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local version='' x_data=''
|
local version='' x_data=''
|
||||||
# note that some users can have /usr/bin/Xorg but not /usr/bin/X
|
# 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
|
# note: MUST be this syntax: X -version 2>&1
|
||||||
# otherwise X -version overrides everything and this comes out null.
|
# 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
|
# 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 -version 2>&1 | gawk '/^X Window System Version/ { print $5 }'
|
||||||
x_data="$( X -version 2>&1 )"
|
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)"
|
x_data="$( Xorg -version 2>&1)"
|
||||||
fi
|
fi
|
||||||
if [[ -n $x_data ]];then
|
if [[ -n $x_data ]];then
|
||||||
|
@ -5589,12 +5598,14 @@ get_init_data()
|
||||||
# more data may be needed for other init systems.
|
# more data may be needed for other init systems.
|
||||||
if [[ -e /proc/1/comm && -n $( grep -s 'systemd' /proc/1/comm ) ]];then
|
if [[ -e /proc/1/comm && -n $( grep -s 'systemd' /proc/1/comm ) ]];then
|
||||||
init_type='systemd'
|
init_type='systemd'
|
||||||
if [[ -n $( type -p systemd ) ]];then
|
if type -p systemd &>/dev/null;then
|
||||||
init_version=$( get_de_app_version 'systemd' '^systemd' '2' )
|
init_version=$( get_de_app_version 'systemd' '^systemd' '2' )
|
||||||
fi
|
fi
|
||||||
if [[ -z $init_version && -n $( type -p systemctl ) ]];then
|
if [[ -z $init_version ]];then
|
||||||
|
if type -p systemctl &>/dev/null;then
|
||||||
init_version=$( get_de_app_version 'systemctl' '^systemd' '2' )
|
init_version=$( get_de_app_version 'systemctl' '^systemd' '2' )
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
ls_run=$(ls /run)
|
ls_run=$(ls /run)
|
||||||
# note: upstart-file-bridge.pid upstart-socket-bridge.pid upstart-udev-bridge.pid
|
# note: upstart-file-bridge.pid upstart-socket-bridge.pid upstart-udev-bridge.pid
|
||||||
|
@ -5602,7 +5613,7 @@ get_init_data()
|
||||||
init_type='Upstart'
|
init_type='Upstart'
|
||||||
# /sbin/init --version == init (upstart 1.12.1)
|
# /sbin/init --version == init (upstart 1.12.1)
|
||||||
init_version=$( get_de_app_version 'init' 'upstart' '3' )
|
init_version=$( get_de_app_version 'init' 'upstart' '3' )
|
||||||
elif [[ -n $( type -p epoch ) ]];then
|
elif type -p epoch &>/dev/null;then
|
||||||
init_type='Epoch'
|
init_type='Epoch'
|
||||||
# epoch version == Epoch Init System 1.0.1 "Sage"
|
# epoch version == Epoch Init System 1.0.1 "Sage"
|
||||||
init_version=$( get_de_app_version 'epoch' '^Epoch' '4' )
|
init_version=$( get_de_app_version 'epoch' '^Epoch' '4' )
|
||||||
|
@ -5613,7 +5624,7 @@ get_init_data()
|
||||||
# no data on version yet
|
# no data on version yet
|
||||||
elif [[ -f /etc/inittab ]];then
|
elif [[ -f /etc/inittab ]];then
|
||||||
init_type='SysVinit'
|
init_type='SysVinit'
|
||||||
if [[ -n $( type -p strings ) ]];then
|
if type -p strings &>/dev/null;then
|
||||||
strings_init_version="$( strings /sbin/init | grep -E 'version[[:space:]]+[0-9]' )"
|
strings_init_version="$( strings /sbin/init | grep -E 'version[[:space:]]+[0-9]' )"
|
||||||
fi
|
fi
|
||||||
if [[ -n $strings_init_version ]];then
|
if [[ -n $strings_init_version ]];then
|
||||||
|
@ -5627,10 +5638,10 @@ get_init_data()
|
||||||
if [[ -n $( grep 'openrc' <<< "$ls_run" ) ]];then
|
if [[ -n $( grep 'openrc' <<< "$ls_run" ) ]];then
|
||||||
rc_type='OpenRC'
|
rc_type='OpenRC'
|
||||||
# /sbin/openrc --version == openrc (OpenRC) 0.13
|
# /sbin/openrc --version == openrc (OpenRC) 0.13
|
||||||
if [[ -n $( type -p openrc ) ]];then
|
if type -p openrc &>/dev/null;then
|
||||||
rc_version=$( get_de_app_version 'openrc' '^openrc' '3' )
|
rc_version=$( get_de_app_version 'openrc' '^openrc' '3' )
|
||||||
# /sbin/rc --version == rc (OpenRC) 0.11.8 (Gentoo Linux)
|
# /sbin/rc --version == rc (OpenRC) 0.11.8 (Gentoo Linux)
|
||||||
elif [[ -n $( type -p rc ) ]];then
|
elif type -p rc &>/dev/null;then
|
||||||
rc_version=$( get_de_app_version 'rc' '^rc' '3' )
|
rc_version=$( get_de_app_version 'rc' '^rc' '3' )
|
||||||
fi
|
fi
|
||||||
## assume sysvrc, but this data is too buggy and weird and inconsistent to have meaning
|
## assume sysvrc, but this data is too buggy and weird and inconsistent to have meaning
|
||||||
|
@ -7813,7 +7824,7 @@ $repo_data_working"
|
||||||
# echo and execute the line breaks inserted
|
# echo and execute the line breaks inserted
|
||||||
REPO_DATA="$( echo -e $repo_data_working )"
|
REPO_DATA="$( echo -e $repo_data_working )"
|
||||||
# Mandriva/Mageia using: urpmq
|
# Mandriva/Mageia using: urpmq
|
||||||
elif [[ -n $( type -p urpmq ) ]];then
|
elif type -p urpmq &>/dev/null;then
|
||||||
REPO_DATA="$( urpmq --list-media active --list-url )"
|
REPO_DATA="$( urpmq --list-media active --list-url )"
|
||||||
# now we need to create the structure: repo info: repo path
|
# now we need to create the structure: repo info: repo path
|
||||||
# we do that by looping through the lines of the output and then
|
# we do that by looping through the lines of the output and then
|
||||||
|
@ -7864,9 +7875,9 @@ get_runlevel_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local runlvl=''
|
local runlvl=''
|
||||||
local runlevel_path=$( type -p runlevel )
|
|
||||||
if [[ -n $runlevel_path ]];then
|
if type -p runlevel &>/dev/null;then
|
||||||
runlvl="$( $runlevel_path | gawk '{ print $2 }' )"
|
runlvl="$( runlevel | gawk '{ print $2 }' )"
|
||||||
fi
|
fi
|
||||||
echo $runlvl
|
echo $runlvl
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
|
@ -8250,10 +8261,10 @@ get_sensors_data()
|
||||||
|
|
||||||
get_sensors_output()
|
get_sensors_output()
|
||||||
{
|
{
|
||||||
local sensors_path=$( type -p sensors ) sensors_data=''
|
local sensors_data=''
|
||||||
|
|
||||||
if [[ -n $sensors_path ]];then
|
if type -p sensors &>/dev/null;then
|
||||||
sensors_data="$( $sensors_path 2>/dev/null )"
|
sensors_data="$( sensors 2>/dev/null )"
|
||||||
if [[ -n "$sensors_data" ]];then
|
if [[ -n "$sensors_data" ]];then
|
||||||
# make sure the file ends in newlines then characters, the newlines are lost in the echo unless
|
# make sure the file ends in newlines then characters, the newlines are lost in the echo unless
|
||||||
# the data ends in some characters
|
# the data ends in some characters
|
||||||
|
@ -9173,19 +9184,19 @@ print_audio_data()
|
||||||
fi
|
fi
|
||||||
if [[ -n $audio_data ]];then
|
if [[ -n $audio_data ]];then
|
||||||
if [[ $( calculate_line_length "$card_string$audio_data" ) -lt $COLS_INNER ]];then
|
if [[ $( calculate_line_length "$card_string$audio_data" ) -lt $COLS_INNER ]];then
|
||||||
print_data=$( create_print_line "$line_starter" "$card_string$audio_data" )
|
print_data=$( create_print_line "$line_starter" "$card_string$audio_data${CN}" )
|
||||||
print_screen_output "$print_data"
|
print_screen_output "$print_data"
|
||||||
# print the line
|
# print the line
|
||||||
else
|
else
|
||||||
# keep the driver on the same line no matter what, looks weird alone on its own line
|
# keep the driver on the same line no matter what, looks weird alone on its own line
|
||||||
if [[ $B_EXTRA_DATA != 'true' ]];then
|
if [[ $B_EXTRA_DATA != 'true' ]];then
|
||||||
print_data=$( create_print_line "$line_starter" "$card_string$audio_data" )
|
print_data=$( create_print_line "$line_starter" "$card_string$audio_data${CN}" )
|
||||||
print_screen_output "$print_data"
|
print_screen_output "$print_data"
|
||||||
else
|
else
|
||||||
print_data=$( create_print_line "$line_starter" "$card_string" )
|
print_data=$( create_print_line "$line_starter" "$card_string${CN}" )
|
||||||
print_screen_output "$print_data"
|
print_screen_output "$print_data"
|
||||||
line_starter=' '
|
line_starter=' '
|
||||||
print_data=$( create_print_line "$line_starter" "$audio_data" )
|
print_data=$( create_print_line "$line_starter" "$audio_data${CN}" )
|
||||||
print_screen_output "$print_data"
|
print_screen_output "$print_data"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -9195,7 +9206,7 @@ print_audio_data()
|
||||||
fi
|
fi
|
||||||
if [[ -n $alsa_data ]];then
|
if [[ -n $alsa_data ]];then
|
||||||
alsa_data=$( sed 's/ALSA/Advanced Linux Sound Architecture/' <<< $alsa_data )
|
alsa_data=$( sed 's/ALSA/Advanced Linux Sound Architecture/' <<< $alsa_data )
|
||||||
alsa_data=$( create_print_line "$line_starter" "$alsa_data" )
|
alsa_data=$( create_print_line "$line_starter" "$alsa_data${CN}" )
|
||||||
print_screen_output "$alsa_data"
|
print_screen_output "$alsa_data"
|
||||||
fi
|
fi
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
|
@ -9209,7 +9220,8 @@ print_cpu_data()
|
||||||
local a_cpu_working='' cpu_model='' cpu_clock='' cpu_null_error=''
|
local a_cpu_working='' cpu_model='' cpu_clock='' cpu_null_error=''
|
||||||
local cpc_plural='' cpu_count_print='' model_plural='' cpu_data_string=''
|
local cpc_plural='' cpu_count_print='' model_plural='' cpu_data_string=''
|
||||||
local cpu_physical_count='' cpu_core_count='' cpu_core_alpha='' cpu_type=''
|
local cpu_physical_count='' cpu_core_count='' cpu_core_alpha='' cpu_type=''
|
||||||
local cpu_2_data='' line_starter=''
|
local cpu_2_data=''
|
||||||
|
local line_starter="CPU$cpc_plural:"
|
||||||
|
|
||||||
##print_screen_output "A_CPU_DATA[0]=\"${A_CPU_DATA[0]}\""
|
##print_screen_output "A_CPU_DATA[0]=\"${A_CPU_DATA[0]}\""
|
||||||
# Array A_CPU_DATA always has one extra element: max clockfreq found.
|
# Array A_CPU_DATA always has one extra element: max clockfreq found.
|
||||||
|
@ -9248,7 +9260,7 @@ print_cpu_data()
|
||||||
cpu_count_print="$cpu_physical_count "
|
cpu_count_print="$cpu_physical_count "
|
||||||
model_plural='s'
|
model_plural='s'
|
||||||
fi
|
fi
|
||||||
line_starter="CPU$cpc_plural:"
|
|
||||||
cpu_data_string="$cpu_count_print$cpu_core_alpha core"
|
cpu_data_string="$cpu_count_print$cpu_core_alpha core"
|
||||||
cpu_data="${C1}$cpu_data_string${C2} ${a_cpu_working[0]}$model_plural ($cpu_type)"
|
cpu_data="${C1}$cpu_data_string${C2} ${a_cpu_working[0]}$model_plural ($cpu_type)"
|
||||||
if [[ $B_SHOW_CPU == 'true' ]];then
|
if [[ $B_SHOW_CPU == 'true' ]];then
|
||||||
|
@ -9297,17 +9309,17 @@ print_cpu_data()
|
||||||
fi
|
fi
|
||||||
# arm cpus do not have flags or cache
|
# arm cpus do not have flags or cache
|
||||||
if [[ ${a_cpu_working[6]} != 'true' ]];then
|
if [[ ${a_cpu_working[6]} != 'true' ]];then
|
||||||
cpu_data="$cpu_data${C2} ${C1}cache$SEP3${C2} $cpu_cache${CN}"
|
cpu_data="$cpu_data${C2} ${C1}cache$SEP3${C2} $cpu_cache"
|
||||||
cpu_2_data="$cpu_flags$bmip_data${CN}"
|
cpu_2_data="$cpu_flags$bmip_data"
|
||||||
else
|
else
|
||||||
cpu_data="$cpu_data${C2} (ARM)$bmip_data${CN}"
|
cpu_data="$cpu_data${C2} (ARM)$bmip_data"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# we don't this printing out extra line unless > 1 cpu core
|
# we don't this printing out extra line unless > 1 cpu core
|
||||||
if [[ ${#A_CPU_DATA[@]} -gt 2 && $B_SHOW_CPU == 'true' ]];then
|
if [[ ${#A_CPU_DATA[@]} -gt 2 && $B_SHOW_CPU == 'true' ]];then
|
||||||
cpu_clock_speed='' # null < verbosity level 5
|
cpu_clock_speed='' # null < verbosity level 5
|
||||||
else
|
else
|
||||||
cpu_data="$cpu_data ${C1}clocked at${C2} ${a_cpu_working[1]%.*} MHz${CN}"
|
cpu_data="$cpu_data ${C1}clocked at${C2} ${a_cpu_working[1]%.*} MHz"
|
||||||
fi
|
fi
|
||||||
cpu_2_data="$cpu_2_data$cpu_clock_speed"
|
cpu_2_data="$cpu_2_data$cpu_clock_speed"
|
||||||
else
|
else
|
||||||
|
@ -9318,18 +9330,18 @@ print_cpu_data()
|
||||||
fi
|
fi
|
||||||
# echo $cpu_data $cpu_2_data
|
# echo $cpu_data $cpu_2_data
|
||||||
# echo ln: $( calculate_line_length "$cpu_data $cpu_2_data" )
|
# echo ln: $( calculate_line_length "$cpu_data $cpu_2_data" )
|
||||||
# echo cpl: $( create_print_line "$line_starter" "${cpu_2_data}" ):
|
# echo cpl: $( create_print_line "$line_starter" "$cpu_2_data${CN}" ):
|
||||||
# echo icols: $COLS_INNER
|
# echo icols: $COLS_INNER
|
||||||
# echo tc: $TERM_COLUMNS
|
# echo tc: $TERM_COLUMNS
|
||||||
# echo :${cpu_2_data}:
|
# echo :${cpu_2_data}:
|
||||||
if [[ -n $cpu_2_data && $( calculate_line_length "$cpu_data $cpu_2_data" ) -gt $COLS_INNER ]];then
|
if [[ -n $cpu_2_data && $( calculate_line_length "$cpu_data $cpu_2_data" ) -gt $COLS_INNER ]];then
|
||||||
cpu_data=$( create_print_line "$line_starter" "$cpu_data" )
|
cpu_data=$( create_print_line "$line_starter" "$cpu_data${CN}" )
|
||||||
line_starter=''
|
line_starter=''
|
||||||
print_screen_output "$cpu_data"
|
print_screen_output "$cpu_data"
|
||||||
cpu_data=$( create_print_line " " "$cpu_2_data" )
|
cpu_data=$( create_print_line " " "$cpu_2_data${CN}" )
|
||||||
print_screen_output "$cpu_data"
|
print_screen_output "$cpu_data"
|
||||||
else
|
else
|
||||||
cpu_data=$( create_print_line "$line_starter" "$cpu_data" )
|
cpu_data=$( create_print_line "$line_starter" "$cpu_data${CN}" )
|
||||||
print_screen_output "$cpu_data $cpu_2_data"
|
print_screen_output "$cpu_data $cpu_2_data"
|
||||||
fi
|
fi
|
||||||
# we don't this printing out extra line unless > 1 cpu core
|
# we don't this printing out extra line unless > 1 cpu core
|
||||||
|
@ -9341,7 +9353,7 @@ print_cpu_data()
|
||||||
a_cpu_working=(${A_CPU_DATA[i]})
|
a_cpu_working=(${A_CPU_DATA[i]})
|
||||||
IFS="$ORIGINAL_IFS"
|
IFS="$ORIGINAL_IFS"
|
||||||
# note: the first iteration will create a first space, for color code separation below
|
# note: the first iteration will create a first space, for color code separation below
|
||||||
cpu_multi_clock_data="$cpu_multi_clock_data ${C1}$(( i + 1 )):${C2} ${a_cpu_working[1]%.*} MHz${CN}"
|
cpu_multi_clock_data="$cpu_multi_clock_data ${C1}$(( i + 1 )):${C2} ${a_cpu_working[1]%.*} MHz"
|
||||||
# someone actually appeared with a 16 core system, so going to stop the cpu core throttle
|
# someone actually appeared with a 16 core system, so going to stop the cpu core throttle
|
||||||
# if this had some other purpose which we can't remember we'll add it back in
|
# if this had some other purpose which we can't remember we'll add it back in
|
||||||
#if [[ $i -gt 10 ]];then
|
#if [[ $i -gt 10 ]];then
|
||||||
|
@ -9349,7 +9361,7 @@ print_cpu_data()
|
||||||
#fi
|
#fi
|
||||||
done
|
done
|
||||||
if [[ -n $cpu_multi_clock_data ]];then
|
if [[ -n $cpu_multi_clock_data ]];then
|
||||||
cpu_multi_clock_data=$( create_print_line " " "${C1}Clock Speeds:${C2}$cpu_multi_clock_data" )
|
cpu_multi_clock_data=$( create_print_line " " "${C1}Clock Speeds:${C2}$cpu_multi_clock_data${CN}" )
|
||||||
print_screen_output "$cpu_multi_clock_data"
|
print_screen_output "$cpu_multi_clock_data"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -9483,22 +9495,21 @@ print_graphics_data()
|
||||||
if [[ -z $driver ]];then
|
if [[ -z $driver ]];then
|
||||||
driver=' N/A'
|
driver=' N/A'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${#A_GRAPHIC_DRIVERS[@]} -gt 1 ]];then
|
if [[ ${#A_GRAPHIC_DRIVERS[@]} -gt 1 ]];then
|
||||||
driver_plural='s'
|
driver_plural='s'
|
||||||
fi
|
fi
|
||||||
driver_string="${C1}driver$driver_plural$SEP3${C2}$driver "
|
|
||||||
|
|
||||||
# some basic error handling:
|
# some basic error handling:
|
||||||
if [[ -z $screen_resolution ]];then
|
if [[ -z $screen_resolution ]];then
|
||||||
screen_resolution='N/A'
|
screen_resolution='N/A'
|
||||||
fi
|
fi
|
||||||
|
# note: fix this, we may find a display server that has no version
|
||||||
if [[ -z $display_vendor || -z $display_version ]];then
|
if [[ -z $display_vendor || -z $display_version ]];then
|
||||||
display_vendor_string="N/A"
|
display_vendor_string="N/A"
|
||||||
else
|
else
|
||||||
display_vendor_string="$display_vendor $display_version"
|
display_vendor_string="$display_vendor $display_version"
|
||||||
fi
|
fi
|
||||||
display_server_string="${C1}Display Server${SEP3}${C2} $display_vendor_string "
|
display_server_string="${C1}Display Server${SEP3}${C2} $display_vendor_string "
|
||||||
|
driver_string="${C1}driver$driver_plural$SEP3${C2}$driver "
|
||||||
|
|
||||||
if [[ $B_ROOT == 'true' ]];then
|
if [[ $B_ROOT == 'true' ]];then
|
||||||
root_x_string='for root '
|
root_x_string='for root '
|
||||||
|
@ -9549,7 +9560,7 @@ print_graphics_data()
|
||||||
fi
|
fi
|
||||||
graphics_data="${C1}$card_id${C2} $card_data$card_bus_id$chip_id "
|
graphics_data="${C1}$card_id${C2} $card_data$card_bus_id$chip_id "
|
||||||
if [[ ${#A_GRAPHICS_CARD_DATA[@]} -gt 1 ]];then
|
if [[ ${#A_GRAPHICS_CARD_DATA[@]} -gt 1 ]];then
|
||||||
graphics_data=$( create_print_line "$line_starter" "$graphics_data" )
|
graphics_data=$( create_print_line "$line_starter" "$graphics_data${CN}" )
|
||||||
print_screen_output "$graphics_data"
|
print_screen_output "$graphics_data"
|
||||||
line_starter=' '
|
line_starter=' '
|
||||||
graphics_data=''
|
graphics_data=''
|
||||||
|
@ -9560,14 +9571,14 @@ print_graphics_data()
|
||||||
graphics_data="${C1}Card:${C2} Failed to Detect Video Card! "
|
graphics_data="${C1}Card:${C2} Failed to Detect Video Card! "
|
||||||
fi
|
fi
|
||||||
if [[ -n $graphics_data && $( calculate_line_length "$graphics_data$display_full_string" ) -lt $COLS_INNER ]];then
|
if [[ -n $graphics_data && $( calculate_line_length "$graphics_data$display_full_string" ) -lt $COLS_INNER ]];then
|
||||||
graphics_data=$( create_print_line "$line_starter" "$graphics_data$display_full_string" )
|
graphics_data=$( create_print_line "$line_starter" "$graphics_data$display_full_string${CN}" )
|
||||||
else
|
else
|
||||||
if [[ -n $graphics_data ]];then
|
if [[ -n $graphics_data ]];then
|
||||||
graphics_data=$( create_print_line "$line_starter" "$graphics_data" )
|
graphics_data=$( create_print_line "$line_starter" "$graphics_data${CN}" )
|
||||||
print_screen_output "$graphics_data"
|
print_screen_output "$graphics_data"
|
||||||
line_starter=' '
|
line_starter=' '
|
||||||
fi
|
fi
|
||||||
graphics_data=$( create_print_line "$line_starter" "$display_full_string" )
|
graphics_data=$( create_print_line "$line_starter" "$display_full_string${CN}" )
|
||||||
fi
|
fi
|
||||||
print_screen_output "$graphics_data"
|
print_screen_output "$graphics_data"
|
||||||
# if [[ -z $glx_renderer || -z $glx_version ]];then
|
# if [[ -z $glx_renderer || -z $glx_version ]];then
|
||||||
|
@ -9587,10 +9598,10 @@ print_graphics_data()
|
||||||
glx_direct_render='N/A'
|
glx_direct_render='N/A'
|
||||||
fi
|
fi
|
||||||
if [[ $B_HANDLE_CORRUPT_DATA == 'true' || $B_EXTRA_DATA == 'true' ]];then
|
if [[ $B_HANDLE_CORRUPT_DATA == 'true' || $B_EXTRA_DATA == 'true' ]];then
|
||||||
direct_render_string=" ${C1}Direct Rendering$SEP3${C2} $glx_direct_render${CN}"
|
direct_render_string=" ${C1}Direct Rendering$SEP3${C2} $glx_direct_render"
|
||||||
fi
|
fi
|
||||||
graphics_data="${C1}GLX Renderer$SEP3${C2} $glx_renderer ${C1}GLX Version$SEP3${C2} $glx_version${CN}$direct_render_string"
|
graphics_data="${C1}GLX Renderer$SEP3${C2} $glx_renderer ${C1}GLX Version$SEP3${C2} $glx_version$direct_render_string"
|
||||||
graphics_data=$( create_print_line " " "$graphics_data" )
|
graphics_data=$( create_print_line " " "$graphics_data${CN}" )
|
||||||
|
|
||||||
print_screen_output "$graphics_data"
|
print_screen_output "$graphics_data"
|
||||||
fi
|
fi
|
||||||
|
@ -9684,7 +9695,7 @@ print_hard_disk_data()
|
||||||
*)
|
*)
|
||||||
# using modulus here, if divisible by $divisor, print line, otherwise skip
|
# using modulus here, if divisible by $divisor, print line, otherwise skip
|
||||||
if [[ $(( $i % $divisor )) -eq 0 ]];then
|
if [[ $(( $i % $divisor )) -eq 0 ]];then
|
||||||
hdd_data=$( create_print_line "$Line_Starter" "$hdd_model${CN}" )
|
hdd_data=$( create_print_line "$Line_Starter" "$hdd_model" )
|
||||||
print_screen_output "$hdd_data"
|
print_screen_output "$hdd_data"
|
||||||
hdd_model=''
|
hdd_model=''
|
||||||
Line_Starter=' '
|
Line_Starter=' '
|
||||||
|
@ -9775,7 +9786,7 @@ print_info_data()
|
||||||
|
|
||||||
# Some code could look superfluous but BitchX doesn't like lines not ending in a newline. F*&k that bitch!
|
# Some code could look superfluous but BitchX doesn't like lines not ending in a newline. F*&k that bitch!
|
||||||
# long_last=$( echo -ne "${C1}Processes$SEP3${C2} $processes${CN} | ${C1}Uptime$SEP3${C2} $up_time${CN} | ${C1}Memory$SEP3${C2} $MEM${CN}" )
|
# long_last=$( echo -ne "${C1}Processes$SEP3${C2} $processes${CN} | ${C1}Uptime$SEP3${C2} $up_time${CN} | ${C1}Memory$SEP3${C2} $MEM${CN}" )
|
||||||
info_data="${C1}Processes$SEP3${C2} $processes ${C1}Uptime$SEP3${C2} $up_time ${C1}Memory$SEP3${C2} $memory${CN} "
|
info_data="${C1}Processes$SEP3${C2} $processes ${C1}Uptime$SEP3${C2} $up_time ${C1}Memory$SEP3${C2} $memory "
|
||||||
|
|
||||||
# this only triggers if no X data is present or if extra data switch is on
|
# this only triggers if no X data is present or if extra data switch is on
|
||||||
if [[ $B_SHOW_DISPLAY_DATA != 'true' || $B_EXTRA_DATA == 'true' ]];then
|
if [[ $B_SHOW_DISPLAY_DATA != 'true' || $B_EXTRA_DATA == 'true' ]];then
|
||||||
|
@ -9821,12 +9832,12 @@ print_info_data()
|
||||||
client_data="${C1}Client$SEP3${C2} $IRC_CLIENT$IRC_CLIENT_VERSION "
|
client_data="${C1}Client$SEP3${C2} $IRC_CLIENT$IRC_CLIENT_VERSION "
|
||||||
fi
|
fi
|
||||||
# info_data="$info_data"
|
# info_data="$info_data"
|
||||||
closing_data="$client_data${C1}$SCRIPT_NAME$SEP3${C2} $SCRIPT_VERSION_NUMBER$patch_version_number${CN}"
|
closing_data="$client_data${C1}$SCRIPT_NAME$SEP3${C2} $SCRIPT_VERSION_NUMBER$patch_version_number"
|
||||||
|
|
||||||
# sometimes gcc is very long, and default runlevel can be long with systemd, so create a gcc-less line first
|
# sometimes gcc is very long, and default runlevel can be long with systemd, so create a gcc-less line first
|
||||||
if [[ $( calculate_line_length "$info_data$init_data$gcc_installed" ) -gt $COLS_INNER ]];then
|
if [[ $( calculate_line_length "$info_data$init_data$gcc_installed" ) -gt $COLS_INNER ]];then
|
||||||
# info_data=$info_data
|
# info_data=$info_data
|
||||||
info_data=$( create_print_line "$line_starter" "$info_data" )
|
info_data=$( create_print_line "$line_starter" "$info_data${CN}" )
|
||||||
print_screen_output "$info_data"
|
print_screen_output "$info_data"
|
||||||
info_data=''
|
info_data=''
|
||||||
# closing_data=''
|
# closing_data=''
|
||||||
|
@ -9835,7 +9846,7 @@ print_info_data()
|
||||||
fi
|
fi
|
||||||
if [[ $( calculate_line_length "$init_data$gcc_installed" ) -gt $COLS_INNER ]];then
|
if [[ $( calculate_line_length "$init_data$gcc_installed" ) -gt $COLS_INNER ]];then
|
||||||
info_data=$init_data
|
info_data=$init_data
|
||||||
info_data=$( create_print_line "$line_starter" "$info_data" )
|
info_data=$( create_print_line "$line_starter" "$info_data${CN}" )
|
||||||
print_screen_output "$info_data"
|
print_screen_output "$info_data"
|
||||||
info_data=''
|
info_data=''
|
||||||
init_data=''
|
init_data=''
|
||||||
|
@ -9844,7 +9855,7 @@ print_info_data()
|
||||||
fi
|
fi
|
||||||
if [[ $( calculate_line_length "$info_data$init_data$gcc_installed$closing_data" ) -gt $COLS_INNER ]];then
|
if [[ $( calculate_line_length "$info_data$init_data$gcc_installed$closing_data" ) -gt $COLS_INNER ]];then
|
||||||
info_data=$info_data$init_data$gcc_installed
|
info_data=$info_data$init_data$gcc_installed
|
||||||
info_data=$( create_print_line "$line_starter" "$info_data" )
|
info_data=$( create_print_line "$line_starter" "$info_data${CN}" )
|
||||||
print_screen_output "$info_data"
|
print_screen_output "$info_data"
|
||||||
info_data=''
|
info_data=''
|
||||||
gcc_installed=''
|
gcc_installed=''
|
||||||
|
@ -9854,7 +9865,7 @@ print_info_data()
|
||||||
fi
|
fi
|
||||||
info_data="$info_data$init_data$gcc_installed$closing_data"
|
info_data="$info_data$init_data$gcc_installed$closing_data"
|
||||||
|
|
||||||
info_data=$( create_print_line "$line_starter" "$info_data" )
|
info_data=$( create_print_line "$line_starter" "$info_data${CN}" )
|
||||||
if [[ $SCHEME -gt 0 ]];then
|
if [[ $SCHEME -gt 0 ]];then
|
||||||
info_data="$info_data ${NORMAL}"
|
info_data="$info_data ${NORMAL}"
|
||||||
fi
|
fi
|
||||||
|
@ -10005,31 +10016,31 @@ print_machine_data()
|
||||||
fi
|
fi
|
||||||
IFS="$ORIGINAL_IFS"
|
IFS="$ORIGINAL_IFS"
|
||||||
else
|
else
|
||||||
system_line="${C2}$sysDmiNull${CN}"
|
system_line="${C2}$sysDmiNull"
|
||||||
fi
|
fi
|
||||||
# patch to dump all of above if dmidecode was data source and non root user
|
# patch to dump all of above if dmidecode was data source and non root user
|
||||||
if [[ ${A_MACHINE_DATA[0]} == 'dmidecode-non-root-user' || ${A_MACHINE_DATA[0]} == 'dmidecode-no-smbios-dmi-data' ]];then
|
if [[ ${A_MACHINE_DATA[0]} == 'dmidecode-non-root-user' || ${A_MACHINE_DATA[0]} == 'dmidecode-no-smbios-dmi-data' ]];then
|
||||||
if [[ ${A_MACHINE_DATA[0]} == 'dmidecode-non-root-user' ]];then
|
if [[ ${A_MACHINE_DATA[0]} == 'dmidecode-non-root-user' ]];then
|
||||||
system_line="${C2}${sysDmiError}dmidecode: you must be root to run dmidecode${CN}"
|
system_line="${C2}${sysDmiError}dmidecode: you must be root to run dmidecode"
|
||||||
elif [[ ${A_MACHINE_DATA[0]} == 'dmidecode-no-smbios-dmi-data' ]];then
|
elif [[ ${A_MACHINE_DATA[0]} == 'dmidecode-no-smbios-dmi-data' ]];then
|
||||||
system_line="${C2}${sysDmiError}dmidecode: no machine data available${CN}"
|
system_line="${C2}${sysDmiError}dmidecode: no machine data available"
|
||||||
fi
|
fi
|
||||||
mobo_line=''
|
mobo_line=''
|
||||||
bios_line=''
|
bios_line=''
|
||||||
chassis_line=''
|
chassis_line=''
|
||||||
fi
|
fi
|
||||||
system_line=$( create_print_line "Machine:" "$system_line" )
|
system_line=$( create_print_line "Machine:" "$system_line${CN}" )
|
||||||
print_screen_output "$system_line"
|
print_screen_output "$system_line"
|
||||||
if [[ -n $mobo_line ]];then
|
if [[ -n $mobo_line ]];then
|
||||||
mobo_line=$( create_print_line " " "$mobo_line" )
|
mobo_line=$( create_print_line " " "$mobo_line${CN}" )
|
||||||
print_screen_output "$mobo_line"
|
print_screen_output "$mobo_line"
|
||||||
fi
|
fi
|
||||||
if [[ -n $bios_line ]];then
|
if [[ -n $bios_line ]];then
|
||||||
bios_line=$( create_print_line " " "$bios_line" )
|
bios_line=$( create_print_line " " "$bios_line${CN}" )
|
||||||
print_screen_output "$bios_line"
|
print_screen_output "$bios_line"
|
||||||
fi
|
fi
|
||||||
if [[ -n $chassis_line ]];then
|
if [[ -n $chassis_line ]];then
|
||||||
chassis_line=$( create_print_line " " "$chassis_line" )
|
chassis_line=$( create_print_line " " "$chassis_line${CN}" )
|
||||||
print_screen_output "$chassis_line"
|
print_screen_output "$chassis_line"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -10156,12 +10167,12 @@ print_networking_data()
|
||||||
card_string="${C1}Card$card_id:${C2} ${a_network_working[0]} "
|
card_string="${C1}Card$card_id:${C2} ${a_network_working[0]} "
|
||||||
card_data="$driver_data$port_data$pci_bus_id$chip_id"
|
card_data="$driver_data$port_data$pci_bus_id$chip_id"
|
||||||
if [[ $( calculate_line_length "$card_string$card_data" ) -gt $COLS_INNER ]];then
|
if [[ $( calculate_line_length "$card_string$card_data" ) -gt $COLS_INNER ]];then
|
||||||
network_data=$( create_print_line "$line_starter" "$card_string" )
|
network_data=$( create_print_line "$line_starter" "$card_string${CN}" )
|
||||||
line_starter=' '
|
line_starter=' '
|
||||||
card_string=''
|
card_string=''
|
||||||
print_screen_output "$network_data"
|
print_screen_output "$network_data"
|
||||||
fi
|
fi
|
||||||
network_data=$( create_print_line "$line_starter" "$card_string$card_data" )
|
network_data=$( create_print_line "$line_starter" "$card_string$card_data${CN}" )
|
||||||
line_starter=' '
|
line_starter=' '
|
||||||
print_screen_output "$network_data"
|
print_screen_output "$network_data"
|
||||||
if [[ $B_SHOW_ADVANCED_NETWORK == 'true' ]];then
|
if [[ $B_SHOW_ADVANCED_NETWORK == 'true' ]];then
|
||||||
|
@ -10170,7 +10181,7 @@ print_networking_data()
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
network_data="${C1}Card:${C2} Failed to Detect Network Card! "
|
network_data="${C1}Card:${C2} Failed to Detect Network Card! "
|
||||||
network_data=$( create_print_line "$line_starter" "$network_data" )
|
network_data=$( create_print_line "$line_starter" "$network_data${CN}" )
|
||||||
print_screen_output "$network_data"
|
print_screen_output "$network_data"
|
||||||
fi
|
fi
|
||||||
if [[ $B_SHOW_IP == 'true' ]];then
|
if [[ $B_SHOW_IP == 'true' ]];then
|
||||||
|
@ -10221,7 +10232,7 @@ print_network_advanced_data()
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
network_data="${C1}IF:${C2} $if_id ${C1}state$SEP3${C2} $oper_state $speed_string$duplex_string${C1}mac$SEP3${C2} $mac_id"
|
network_data="${C1}IF:${C2} $if_id ${C1}state$SEP3${C2} $oper_state $speed_string$duplex_string${C1}mac$SEP3${C2} $mac_id"
|
||||||
network_data=$( create_print_line " " "$network_data" )
|
network_data=$( create_print_line " " "$network_data${CN}" )
|
||||||
print_screen_output "$network_data"
|
print_screen_output "$network_data"
|
||||||
|
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
|
@ -10284,7 +10295,7 @@ print_networking_ip_data()
|
||||||
if_string="$wan_ip_data$if_string${C1}IF:${C2} $if_id$if_ip_string$if_ipv6_string "
|
if_string="$wan_ip_data$if_string${C1}IF:${C2} $if_id$if_ip_string$if_ipv6_string "
|
||||||
wan_ip_data=''
|
wan_ip_data=''
|
||||||
if [[ $( calculate_line_length "$if_string" ) -gt $line_max ]];then
|
if [[ $( calculate_line_length "$if_string" ) -gt $line_max ]];then
|
||||||
full_string=$( create_print_line " " "$if_string" )
|
full_string=$( create_print_line " " "$if_string${CN}" )
|
||||||
print_screen_output "$full_string"
|
print_screen_output "$full_string"
|
||||||
if_string=''
|
if_string=''
|
||||||
fi
|
fi
|
||||||
|
@ -10293,7 +10304,7 @@ print_networking_ip_data()
|
||||||
|
|
||||||
# then print out anything not printed already
|
# then print out anything not printed already
|
||||||
if [[ -n $if_string ]];then
|
if [[ -n $if_string ]];then
|
||||||
full_string=$( create_print_line " " "$if_string" )
|
full_string=$( create_print_line " " "$if_string${CN}" )
|
||||||
print_screen_output "$full_string"
|
print_screen_output "$full_string"
|
||||||
fi
|
fi
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
|
@ -10370,7 +10381,7 @@ print_optical_drive_data()
|
||||||
drive_string="$drive_id ${C1}model$SEP3${C2} $vendor$rev ${C1}dev-links$SEP3${C2} $drive_links"
|
drive_string="$drive_id ${C1}model$SEP3${C2} $vendor$rev ${C1}dev-links$SEP3${C2} $drive_links"
|
||||||
fi
|
fi
|
||||||
drive_data="${C1}Optical${counter}:${C2} $drive_string"
|
drive_data="${C1}Optical${counter}:${C2} $drive_string"
|
||||||
drive_data=$( create_print_line "$Line_Starter" "$drive_data" )
|
drive_data=$( create_print_line "$Line_Starter" "$drive_data${CN}" )
|
||||||
print_screen_output "$drive_data"
|
print_screen_output "$drive_data"
|
||||||
Line_Starter=' '
|
Line_Starter=' '
|
||||||
# 5 - speed
|
# 5 - speed
|
||||||
|
@ -10441,7 +10452,7 @@ print_optical_drive_data()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
drive_data="${C1}Features: speed$SEP3${C2} $speed$multisession$audio ${C1}dvd$SEP3${C2} $dvd ${C1}rw$SEP3${C2} $rw_support$state"
|
drive_data="${C1}Features: speed$SEP3${C2} $speed$multisession$audio ${C1}dvd$SEP3${C2} $dvd ${C1}rw$SEP3${C2} $rw_support$state"
|
||||||
drive_data=$( create_print_line "$Line_Starter" "$drive_data" )
|
drive_data=$( create_print_line "$Line_Starter" "$drive_data${CN}" )
|
||||||
print_screen_output "$drive_data"
|
print_screen_output "$drive_data"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -10549,13 +10560,13 @@ print_partition_data()
|
||||||
else
|
else
|
||||||
line_starter=' '
|
line_starter=' '
|
||||||
fi
|
fi
|
||||||
partition_data=$( create_print_line "$line_starter" "${a_partition_data[$i]}" )
|
partition_data=$( create_print_line "$line_starter" "${a_partition_data[$i]}${CN}" )
|
||||||
print_screen_output "$partition_data"
|
print_screen_output "$partition_data"
|
||||||
done
|
done
|
||||||
|
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
|
# legacy not used
|
||||||
print_program_version()
|
print_program_version()
|
||||||
{
|
{
|
||||||
local patch_version_number=$( get_patch_version_string )
|
local patch_version_number=$( get_patch_version_string )
|
||||||
|
@ -10566,7 +10577,7 @@ print_program_version()
|
||||||
# center pad: sed -e :a -e 's/^.\{1,80\}$/ & /;ta'
|
# center pad: sed -e :a -e 's/^.\{1,80\}$/ & /;ta'
|
||||||
#local line_max=$COLS_INNER
|
#local line_max=$COLS_INNER
|
||||||
#program_version="$( sed -e :a -e "s/^.\{1,$line_max\}$/ &/;ta" <<< $program_version )" # use to create padding if needed
|
#program_version="$( sed -e :a -e "s/^.\{1,$line_max\}$/ &/;ta" <<< $program_version )" # use to create padding if needed
|
||||||
# program_version=$( create_print_line "Version:" "$program_version" )
|
# program_version=$( create_print_line "Version:" "$program_version${CN}" )
|
||||||
print_screen_output "$program_version"
|
print_screen_output "$program_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10616,7 +10627,7 @@ print_ps_item()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# appName, appPath, appStarterName, appStarterPath, cpu, mem, pid, vsz, user
|
# appName, appPath, appStarterName, appStarterPath, cpu, mem, pid, vsz, user
|
||||||
ps_data=$( create_print_line "$line_starter" "$line_start_data" )
|
ps_data=$( create_print_line "$line_starter" "$line_start_data${CN}" )
|
||||||
print_screen_output "$ps_data"
|
print_screen_output "$ps_data"
|
||||||
|
|
||||||
for (( i=0; i < ${#A_PS_DATA[@]}; i++ ))
|
for (( i=0; i < ${#A_PS_DATA[@]}; i++ ))
|
||||||
|
@ -10655,7 +10666,7 @@ print_ps_item()
|
||||||
(( line_counter++ ))
|
(( line_counter++ ))
|
||||||
count_nu="${C1}$line_counter:${C2}"
|
count_nu="${C1}$line_counter:${C2}"
|
||||||
full_line="$count_nu$app_cpu$app_mem$app_name$app_pid$extra_data"
|
full_line="$count_nu$app_cpu$app_mem$app_name$app_pid$extra_data"
|
||||||
ps_data=$( create_print_line " " "$full_line" )
|
ps_data=$( create_print_line " " "$full_line${CN}" )
|
||||||
print_screen_output "$ps_data"
|
print_screen_output "$ps_data"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -10946,7 +10957,7 @@ print_raid_data()
|
||||||
fi
|
fi
|
||||||
if [[ $B_EXTRA_EXTRA_DATA == 'true' && $array_count != '' ]];then
|
if [[ $B_EXTRA_EXTRA_DATA == 'true' && $array_count != '' ]];then
|
||||||
if [[ $i == 0 ]];then
|
if [[ $i == 0 ]];then
|
||||||
raid_data=$( create_print_line "$line_starter" "${a_raid_data[array_count]}" )
|
raid_data=$( create_print_line "$line_starter" "${a_raid_data[array_count]}${CN}" )
|
||||||
print_screen_output "$raid_data"
|
print_screen_output "$raid_data"
|
||||||
line_starter=' '
|
line_starter=' '
|
||||||
fi
|
fi
|
||||||
|
@ -10955,7 +10966,7 @@ print_raid_data()
|
||||||
print_screen_output "$raid_data"
|
print_screen_output "$raid_data"
|
||||||
if [[ $B_EXTRA_EXTRA_DATA == 'true' && $array_count_unused != '' ]];then
|
if [[ $B_EXTRA_EXTRA_DATA == 'true' && $array_count_unused != '' ]];then
|
||||||
if [[ $i == $(( array_count_unused - 2 )) ]];then
|
if [[ $i == $(( array_count_unused - 2 )) ]];then
|
||||||
raid_data=$( create_print_line "$line_starter" "${a_raid_data[array_count_unused]}" )
|
raid_data=$( create_print_line "$line_starter" "${a_raid_data[array_count_unused]}${CN}" )
|
||||||
print_screen_output "$raid_data"
|
print_screen_output "$raid_data"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -11005,9 +11016,9 @@ print_repo_data()
|
||||||
fi
|
fi
|
||||||
# first line print Repos:
|
# first line print Repos:
|
||||||
if [[ $repo_count -eq 1 ]];then
|
if [[ $repo_count -eq 1 ]];then
|
||||||
repo_full=$( create_print_line "Repos:" "$repo_full" )
|
repo_full=$( create_print_line "Repos:" "$repo_full${CN}" )
|
||||||
else
|
else
|
||||||
repo_full=$( create_print_line " " "$repo_full" )
|
repo_full=$( create_print_line " " "$repo_full${CN}" )
|
||||||
fi
|
fi
|
||||||
print_screen_output "$repo_full"
|
print_screen_output "$repo_full"
|
||||||
# this prints the content of the file as well as the file name
|
# this prints the content of the file as well as the file name
|
||||||
|
@ -11152,16 +11163,16 @@ print_sensors_data()
|
||||||
# unless -s used explicitly. So for -F type output won't show unless valid or -! 1 used
|
# unless -s used explicitly. So for -F type output won't show unless valid or -! 1 used
|
||||||
if [[ $b_is_error != 'true' || $B_SHOW_SENSORS == 'true' || $B_TESTING_1 == 'true' ]];then
|
if [[ $b_is_error != 'true' || $B_SHOW_SENSORS == 'true' || $B_TESTING_1 == 'true' ]];then
|
||||||
temp_data="$cpu_temp$mobo_temp$psu_temp$gpu_temp"
|
temp_data="$cpu_temp$mobo_temp$psu_temp$gpu_temp"
|
||||||
temp_data=$( create_print_line "Sensors:" "$temp_data" )
|
temp_data=$( create_print_line "Sensors:" "$temp_data${CN}" )
|
||||||
print_screen_output "$temp_data"
|
print_screen_output "$temp_data"
|
||||||
# don't print second or subsequent lines if error data
|
# don't print second or subsequent lines if error data
|
||||||
fan_data="$cpu_fan$mobo_fan$ps_fan$sys_fans"
|
fan_data="$cpu_fan$mobo_fan$ps_fan$sys_fans"
|
||||||
if [[ $b_is_error != 'true' && -n $fan_data ]];then
|
if [[ $b_is_error != 'true' && -n $fan_data ]];then
|
||||||
fan_data=$( create_print_line " " "$fan_data" )
|
fan_data=$( create_print_line " " "$fan_data${CN}" )
|
||||||
print_screen_output "$fan_data"
|
print_screen_output "$fan_data"
|
||||||
# and then second wrapped fan line if needed
|
# and then second wrapped fan line if needed
|
||||||
if [[ -n $sys_fans2 ]];then
|
if [[ -n $sys_fans2 ]];then
|
||||||
fan_data2=$( create_print_line " " "$sys_fans2" )
|
fan_data2=$( create_print_line " " "$sys_fans2${CN}" )
|
||||||
print_screen_output "$fan_data2"
|
print_screen_output "$fan_data2"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -11247,13 +11258,13 @@ print_system_data()
|
||||||
distro_string="${C1}Distro$SEP3${C2} $distro "
|
distro_string="${C1}Distro$SEP3${C2} $distro "
|
||||||
|
|
||||||
if [[ $( calculate_line_length "$host_kernel_string$de_string" ) -gt $COLS_INNER ]];then
|
if [[ $( calculate_line_length "$host_kernel_string$de_string" ) -gt $COLS_INNER ]];then
|
||||||
system_data=$( create_print_line "$line_starter" "$host_kernel_string" )
|
system_data=$( create_print_line "$line_starter" "$host_kernel_string${CN}" )
|
||||||
print_screen_output "$system_data"
|
print_screen_output "$system_data"
|
||||||
host_kernel_string=''
|
host_kernel_string=''
|
||||||
line_starter=' '
|
line_starter=' '
|
||||||
fi
|
fi
|
||||||
if [[ $( calculate_line_length "$host_kernel_string$de_string$distro_string" ) -gt $COLS_INNER ]];then
|
if [[ $( calculate_line_length "$host_kernel_string$de_string$distro_string" ) -gt $COLS_INNER ]];then
|
||||||
system_data=$( create_print_line "$line_starter" "$host_kernel_string$de_string" )
|
system_data=$( create_print_line "$line_starter" "$host_kernel_string$de_string${CN}" )
|
||||||
print_screen_output "$system_data"
|
print_screen_output "$system_data"
|
||||||
host_kernel_string=''
|
host_kernel_string=''
|
||||||
de_string=''
|
de_string=''
|
||||||
|
@ -11262,7 +11273,7 @@ print_system_data()
|
||||||
system_data="$host_kernel_string$de_string$distro_string"
|
system_data="$host_kernel_string$de_string$distro_string"
|
||||||
if [[ -n $system_data ]];then
|
if [[ -n $system_data ]];then
|
||||||
system_data="$host_kernel_string$de_string$distro_string"
|
system_data="$host_kernel_string$de_string$distro_string"
|
||||||
system_data=$( create_print_line "$line_starter" "$system_data" )
|
system_data=$( create_print_line "$line_starter" "$system_data${CN}" )
|
||||||
print_screen_output "$system_data"
|
print_screen_output "$system_data"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -11326,11 +11337,11 @@ print_unmounted_partition_data()
|
||||||
if [[ $BSD_TYPE == 'bsd' ]];then
|
if [[ $BSD_TYPE == 'bsd' ]];then
|
||||||
full_string=$bsd_unsupported
|
full_string=$bsd_unsupported
|
||||||
fi
|
fi
|
||||||
unmounted_data=$( create_print_line "$line_starter" "$full_string" )
|
unmounted_data=$( create_print_line "$line_starter" "$full_string${CN}" )
|
||||||
print_screen_output "$unmounted_data"
|
print_screen_output "$unmounted_data"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
unmounted_data=$( create_print_line "Unmounted:" "No unmounted partitions detected" )
|
unmounted_data=$( create_print_line "Unmounted:" "No unmounted partitions detected${CN}" )
|
||||||
print_screen_output "$unmounted_data"
|
print_screen_output "$unmounted_data"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -11404,11 +11415,11 @@ print_weather_data()
|
||||||
|
|
||||||
if [[ $B_EXTRA_DATA != 'true' ]];then
|
if [[ $B_EXTRA_DATA != 'true' ]];then
|
||||||
weather_data="$weather_string $time_string"
|
weather_data="$weather_string $time_string"
|
||||||
weather_data=$( create_print_line "Weather:" "$weather_data" )
|
weather_data=$( create_print_line "Weather:" "$weather_data${CN}" )
|
||||||
print_screen_output "$weather_data"
|
print_screen_output "$weather_data"
|
||||||
else
|
else
|
||||||
weather_data="$weather_string"
|
weather_data="$weather_string"
|
||||||
weather_data=$( create_print_line "Weather:" "$weather_data" )
|
weather_data=$( create_print_line "Weather:" "$weather_data${CN}" )
|
||||||
print_screen_output "$weather_data"
|
print_screen_output "$weather_data"
|
||||||
if [[ $B_EXTRA_EXTRA_EXTRA_DATA == 'true' ]];then
|
if [[ $B_EXTRA_EXTRA_EXTRA_DATA == 'true' ]];then
|
||||||
if [[ -n ${a_weather[8]} ]];then
|
if [[ -n ${a_weather[8]} ]];then
|
||||||
|
@ -11444,10 +11455,10 @@ print_weather_data()
|
||||||
fi
|
fi
|
||||||
# the last three are oftenblank
|
# the last three are oftenblank
|
||||||
if [[ -z "$heat_index$wind_chill$dew_point" ]];then
|
if [[ -z "$heat_index$wind_chill$dew_point" ]];then
|
||||||
weather_data=$( create_print_line " " "$pressure$location_string" )
|
weather_data=$( create_print_line " " "$pressure$location_string${CN}" )
|
||||||
print_screen_output "$weather_data"
|
print_screen_output "$weather_data"
|
||||||
else
|
else
|
||||||
weather_data=$( create_print_line " " "$pressure$heat_index$wind_chill$dew_point" )
|
weather_data=$( create_print_line " " "$pressure$heat_index$wind_chill$dew_point${CN}" )
|
||||||
print_screen_output "$weather_data"
|
print_screen_output "$weather_data"
|
||||||
if [[ $B_OUTPUT_FILTER != 'true' ]];then
|
if [[ $B_OUTPUT_FILTER != 'true' ]];then
|
||||||
weather_data=$( create_print_line " " "$location_string" )
|
weather_data=$( create_print_line " " "$location_string" )
|
||||||
|
@ -11455,13 +11466,13 @@ print_weather_data()
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ -n $time_string$observation_time ]];then
|
if [[ -n $time_string$observation_time ]];then
|
||||||
weather_data=$( create_print_line " " "$time_string$observation_time" )
|
weather_data=$( create_print_line " " "$time_string$observation_time${CN}" )
|
||||||
print_screen_output "$weather_data"
|
print_screen_output "$weather_data"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ -n $pressure$time_string ]];then
|
if [[ -n $pressure$time_string ]];then
|
||||||
weather_data="$pressure$time_string"
|
weather_data="$pressure$time_string"
|
||||||
weather_data=$( create_print_line " " "$weather_data" )
|
weather_data=$( create_print_line " " "$weather_data${CN}" )
|
||||||
print_screen_output "$weather_data"
|
print_screen_output "$weather_data"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -11469,7 +11480,7 @@ print_weather_data()
|
||||||
else
|
else
|
||||||
weather_data=$( create_print_line "Weather:" "Weather data failure: $(date)" )
|
weather_data=$( create_print_line "Weather:" "Weather data failure: $(date)" )
|
||||||
print_screen_output "$weather_data"
|
print_screen_output "$weather_data"
|
||||||
weather_data=$( create_print_line " " "${A_WEATHER_DATA}" )
|
weather_data=$( create_print_line " " "${A_WEATHER_DATA}${CN}" )
|
||||||
print_screen_output "$weather_data"
|
print_screen_output "$weather_data"
|
||||||
fi
|
fi
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
|
|
Loading…
Reference in a new issue