mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 08:35:25 +00:00
new version: 1.5.7
Added to and improved debugging data collector. Options: -@ 11 -sys/networking; 12 - xorg; 13 - disk/partions. All also collect /proc data and some other stuff it's good to have examples of for future use. Added dwm and wmii desktops as well. Added support for standard --verbose and --help options. Added irc exit if help menu is called for to avoid bad spamming. Tweaked line count on System, made a touch shorter
This commit is contained in:
parent
6e5a45e0b5
commit
2a88f17e8c
268
inxi
268
inxi
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.5.6
|
#### version: 1.5.7
|
||||||
#### Date: May 25 2011
|
#### Date: May 26 2011
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -308,7 +308,6 @@ DCOPOBJ="default"
|
||||||
DEBUG=0 # Set debug levels from 1-10 (8-10 trigger logging levels)
|
DEBUG=0 # Set debug levels from 1-10 (8-10 trigger logging levels)
|
||||||
# Debug Buffer Index, index into a debug buffer storing debug messages until inxi is 'all up'
|
# Debug Buffer Index, index into a debug buffer storing debug messages until inxi is 'all up'
|
||||||
DEBUG_BUFFER_INDEX=0
|
DEBUG_BUFFER_INDEX=0
|
||||||
DEBUG_DATA_TYPE=''
|
|
||||||
## note: the debugger rerouting to /dev/null has been moved to the end of the get_parameters function
|
## note: the debugger rerouting to /dev/null has been moved to the end of the get_parameters function
|
||||||
## so -@[number] debug levels can be set if there is a failure, otherwise you can't even see the errors
|
## so -@[number] debug levels can be set if there is a failure, otherwise you can't even see the errors
|
||||||
|
|
||||||
|
@ -1249,13 +1248,14 @@ script_self_updater()
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# args: $1 - debug data type: sys|xorg|disk
|
||||||
debug_data_collector()
|
debug_data_collector()
|
||||||
{
|
{
|
||||||
local xiin_app='' xiin_data_file='' xiin_download=''
|
local xiin_app='' xiin_data_file='' xiin_download=''
|
||||||
local xiin_data_dir="xiin-$(hostname | tr ' ' '-' | tr '[A-Z]' '[a-z]' )-$DEBUG_DATA_TYPE-$(date +%Y%m%d)"
|
local xiin_data_dir="xiin-$(hostname | tr ' ' '-' | tr '[A-Z]' '[a-z]' )-$1-$(date +%Y%m%d)"
|
||||||
|
|
||||||
if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
|
if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
|
||||||
echo "Starting debugging data collection type: $DEBUG_DATA_TYPE"
|
echo "Starting debugging data collection type: $1"
|
||||||
echo -n "Checking/creating required directories... "
|
echo -n "Checking/creating required directories... "
|
||||||
if [[ ! -d $SCRIPT_DATA_DIR ]];then
|
if [[ ! -d $SCRIPT_DATA_DIR ]];then
|
||||||
mkdir $SCRIPT_DATA_DIR
|
mkdir $SCRIPT_DATA_DIR
|
||||||
|
@ -1271,8 +1271,24 @@ debug_data_collector()
|
||||||
echo 'Deleting previous tar.gz file...'
|
echo 'Deleting previous tar.gz file...'
|
||||||
rm -f $xiin_data_dir.tar.gz
|
rm -f $xiin_data_dir.tar.gz
|
||||||
fi
|
fi
|
||||||
if [[ $DEBUG_DATA_TYPE == 'sys' ]];then
|
|
||||||
|
echo 'Collecting system info: sensors, lsusb, lspci, lspci -v data, plus /proc data'
|
||||||
|
lsusb &> $xiin_data_dir/lsusb.txt
|
||||||
|
lspci &> $xiin_data_dir/lspci.txt
|
||||||
|
lspci -v &> $xiin_data_dir/lspci-v.txt
|
||||||
|
sensors &> $xiin_data_dir/sensors.txt
|
||||||
|
cat $FILE_LSB_RELEASE &> $xiin_data_dir/lsb-release.txt
|
||||||
|
cat $FILE_ASOUND_DEVICE &> $xiin_data_dir/proc-asound-device.txt
|
||||||
|
cat $FILE_ASOUND_VERSION &> $xiin_data_dir/proc-asound-version.txt
|
||||||
|
cat $FILE_CPUINFO &> $xiin_data_dir/proc-cpu-info.txt
|
||||||
|
cat $FILE_MEMINFO &> $xiin_data_dir/proc-meminfo.txt
|
||||||
|
cat $FILE_MODULES &> $xiin_data_dir/proc-modules.txt
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
sys)
|
||||||
xiin_data_file=$SCRIPT_DATA_DIR/$xiin_data_dir/xiin-sys.txt
|
xiin_data_file=$SCRIPT_DATA_DIR/$xiin_data_dir/xiin-sys.txt
|
||||||
|
echo 'Collecting networking data...'
|
||||||
|
ifconfig &> $xiin_data_dir/ifconfig.txt
|
||||||
echo 'Downloading required tree traverse tool xiin...'
|
echo 'Downloading required tree traverse tool xiin...'
|
||||||
# -Nc is creating really weird download anomolies, so using -O instead
|
# -Nc is creating really weird download anomolies, so using -O instead
|
||||||
xiin_download="$( wget -q -O - http://inxi.googlecode.com/svn/branches/xiin/xiin )"
|
xiin_download="$( wget -q -O - http://inxi.googlecode.com/svn/branches/xiin/xiin )"
|
||||||
|
@ -1296,12 +1312,8 @@ debug_data_collector()
|
||||||
else
|
else
|
||||||
error_handler 18 'xiin'
|
error_handler 18 'xiin'
|
||||||
fi
|
fi
|
||||||
fi
|
;;
|
||||||
echo 'Collecting system info: lsusb, lspci, lspci -v data'
|
xorg)
|
||||||
lsusb > $xiin_data_dir/lsusb.txt
|
|
||||||
lspci > $xiin_data_dir/lspci.txt
|
|
||||||
lspci -v > $xiin_data_dir/lspci-v.txt
|
|
||||||
if [[ $DEBUG_DATA_TYPE == 'xorg' ]];then
|
|
||||||
if [[ $B_RUNNING_IN_X != 'true' ]];then
|
if [[ $B_RUNNING_IN_X != 'true' ]];then
|
||||||
echo 'Warning: only some of the data collection can occur if you are not in X'
|
echo 'Warning: only some of the data collection can occur if you are not in X'
|
||||||
touch $xiin_data_dir/warning-user-not-in-x
|
touch $xiin_data_dir/warning-user-not-in-x
|
||||||
|
@ -1312,7 +1324,7 @@ debug_data_collector()
|
||||||
fi
|
fi
|
||||||
echo 'Collecting Xorg log and xorg.conf files'
|
echo 'Collecting Xorg log and xorg.conf files'
|
||||||
if [[ -e $FILE_XORG_LOG ]];then
|
if [[ -e $FILE_XORG_LOG ]];then
|
||||||
cp $FILE_XORG_LOG $xiin_data_dir
|
cat $FILE_XORG_LOG &> $xiin_data_dir/xorg-log-file.txt
|
||||||
else
|
else
|
||||||
touch $xiin_data_dir/no-xorg-log-file
|
touch $xiin_data_dir/no-xorg-log-file
|
||||||
fi
|
fi
|
||||||
|
@ -1326,34 +1338,31 @@ debug_data_collector()
|
||||||
else
|
else
|
||||||
touch $xiin_data_dir/no-xorg-conf-d-files
|
touch $xiin_data_dir/no-xorg-conf-d-files
|
||||||
fi
|
fi
|
||||||
echo 'Collecting X, xprop, glxinfo, xranr, xdpyinfo data...'
|
echo 'Collecting X, xprop, glxinfo, xrandr, xdpyinfo data...'
|
||||||
if [[ -n $( type -p xprop ) ]];then
|
xprop -root &> $xiin_data_dir/xprop_root.txt
|
||||||
xprop -root > $xiin_data_dir/xprop_root.txt
|
glxinfo &> $xiin_data_dir/glxinfo.txt
|
||||||
else
|
xdpyinfo &> $xiin_data_dir/xdpyinfo.txt
|
||||||
touch $xiin_data_dir/no-prop-app
|
xrandr &> $xiin_data_dir/xrandr.txt
|
||||||
fi
|
X -version &> $xiin_data_dir/x-version.txt
|
||||||
if [[ -n $( type -p glxinfo ) ]];then
|
;;
|
||||||
glxinfo > $xiin_data_dir/glxinfo.txt
|
disk)
|
||||||
else
|
echo 'Collecting dev, label, disk, uuid data, df...'
|
||||||
touch $xiin_data_dir/no-glxinfo-app
|
ls -l /dev &> $xiin_data_dir/dev-data.txt
|
||||||
fi
|
ls -l /dev/disk &> $xiin_data_dir/dev-disk-data.txt
|
||||||
if [[ -n $( type -p xdpyinfo ) ]];then
|
ls -l /dev/disk/by-id &> $xiin_data_dir/dev-disk-id-data.txt
|
||||||
xdpyinfo > $xiin_data_dir/xdpyinfo.txt
|
ls -l /dev/disk/by-label &> $xiin_data_dir/dev-disk-label-data.txt
|
||||||
else
|
ls -l /dev/disk/by-uuid &> $xiin_data_dir/dev-disk-uuid-data.txt
|
||||||
touch $xiin_data_dir/no-xdpyinfo-app
|
ls -l /dev/disk/by-path &> $xiin_data_dir/dev-disk-path-data.txt
|
||||||
fi
|
readlink /dev/root &> $xiin_data_dir/dev-root.txt
|
||||||
if [[ -n $( type -p xrandr ) ]];then
|
df -h -T --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 &> $xiin_data_dir/df-h-T-excludes.txt
|
||||||
xrandr > $xiin_data_dir/xrandr.txt
|
swapon -s &> $xiin_data_dir/swapon-s.txt
|
||||||
else
|
df --exclude-type=aufs --exclude-type=squashfs --exclude-type=unionfs --exclude-type=devtmpfs --exclude-type=tmpfs --exclude-type=iso9660 &> $xiin_data_dir/df-excludes.txt
|
||||||
touch $xiin_data_dir/no-xrandr-app
|
cat $FILE_PARTITIONS &> $xiin_data_dir/proc-partitions.txt
|
||||||
fi
|
cat $FILE_SCSI &> $xiin_data_dir/proc-scsi.txt
|
||||||
if [[ -n $( type -p X ) ]];then
|
cat $FILE_MOUNTS &> $xiin_data_dir/proc-mounts.txt
|
||||||
# no idea why, but has to be this way to print out to file
|
;;
|
||||||
X -version 2>&1 | awk '{print $0}' > $xiin_data_dir/x-version.txt
|
esac
|
||||||
else
|
|
||||||
touch $xiin_data_dir/no-x-app
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
echo 'Creating tar.gz compressed file of this material now. Contents:'
|
echo 'Creating tar.gz compressed file of this material now. Contents:'
|
||||||
echo '-------------------------'
|
echo '-------------------------'
|
||||||
tar -cvzf $xiin_data_dir.tar.gz $xiin_data_dir
|
tar -cvzf $xiin_data_dir.tar.gz $xiin_data_dir
|
||||||
|
@ -1467,17 +1476,22 @@ remove_erroneous_chars()
|
||||||
get_parameters()
|
get_parameters()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local opt='' wget_test='' update_flags='U!:'
|
local opt='' wget_test='' update_flags='U!:' debug_data_type=''
|
||||||
local use_short='true' # this is needed to trigger short output, every v/d/F/line trigger sets this false
|
local use_short='true' # this is needed to trigger short output, every v/d/F/line trigger sets this false
|
||||||
|
|
||||||
# If distro maintainers want to not allow updates, turn off that option for users
|
# If distro maintainers want to not allow updates, turn off that option for users
|
||||||
if [[ $B_ALLOW_UPDATE == 'false' ]];then
|
if [[ $B_ALLOW_UPDATE == 'false' ]];then
|
||||||
update_flags=''
|
update_flags=''
|
||||||
fi
|
fi
|
||||||
|
if [[ $1 == '--version' ]];then
|
||||||
|
print_version_info
|
||||||
|
exit 0
|
||||||
|
elif [[ $1 == '--help' ]];then
|
||||||
|
show_options
|
||||||
|
exit 0
|
||||||
# the short form only runs if no args output args are used
|
# the short form only runs if no args output args are used
|
||||||
# no need to run through these if there are no args
|
# no need to run through these if there are no args
|
||||||
if [[ -n $1 ]];then
|
elif [[ -n $1 ]];then
|
||||||
while getopts Ac:CdDfFGhHiIlnNopPrsSt:uv:VxzZ%@:${update_flags} opt
|
while getopts Ac:CdDfFGhHiIlnNopPrsSt:uv:VxzZ%@:${update_flags} opt
|
||||||
do
|
do
|
||||||
case $opt in
|
case $opt in
|
||||||
|
@ -1634,7 +1648,7 @@ get_parameters()
|
||||||
## debuggers and testing tools
|
## debuggers and testing tools
|
||||||
%) B_HANDLE_CORRUPT_DATA='true'
|
%) B_HANDLE_CORRUPT_DATA='true'
|
||||||
;;
|
;;
|
||||||
@) if [[ -n $( grep -E "^([1-9]|1[0-2])$" <<< $OPTARG ) ]];then
|
@) if [[ -n $( grep -E "^([1-9]|1[0-3])$" <<< $OPTARG ) ]];then
|
||||||
DEBUG=$OPTARG
|
DEBUG=$OPTARG
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
# switch on logging only for -@ 8-10
|
# switch on logging only for -@ 8-10
|
||||||
|
@ -1651,17 +1665,20 @@ get_parameters()
|
||||||
LOGFE=$LOGFE_STRING
|
LOGFE=$LOGFE_STRING
|
||||||
create_rotate_logfiles # create/rotate logfiles before we do anything else
|
create_rotate_logfiles # create/rotate logfiles before we do anything else
|
||||||
;;
|
;;
|
||||||
11|12)
|
11|12|13)
|
||||||
case $OPTARG in
|
case $OPTARG in
|
||||||
11)
|
11)
|
||||||
DEBUG_DATA_TYPE='sys'
|
debug_data_type='sys'
|
||||||
;;
|
;;
|
||||||
12)
|
12)
|
||||||
DEBUG_DATA_TYPE='xorg'
|
debug_data_type='xorg'
|
||||||
|
;;
|
||||||
|
13)
|
||||||
|
debug_data_type='disk'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
initialize_script_data
|
initialize_script_data
|
||||||
debug_data_collector
|
debug_data_collector $debug_data_type
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
@ -1727,6 +1744,10 @@ show_options()
|
||||||
{
|
{
|
||||||
local color_scheme_count=$(( ${#A_COLOR_SCHEMES[@]} - 1 ))
|
local color_scheme_count=$(( ${#A_COLOR_SCHEMES[@]} - 1 ))
|
||||||
|
|
||||||
|
if ! tty >/dev/null;then
|
||||||
|
print_screen_output "Sorry, you can't run the help option in an IRC client."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
print_screen_output "$SCRIPT_NAME supports the following options. You can combine them, or list them"
|
print_screen_output "$SCRIPT_NAME supports the following options. You can combine them, or list them"
|
||||||
print_screen_output "one by one: Examples: $SCRIPT_NAME -v4 -c6 OR $SCRIPT_NAME -dDc 6"
|
print_screen_output "one by one: Examples: $SCRIPT_NAME -v4 -c6 OR $SCRIPT_NAME -dDc 6"
|
||||||
print_screen_output " "
|
print_screen_output " "
|
||||||
|
@ -1747,7 +1768,7 @@ show_options()
|
||||||
print_screen_output "-d Default output verbosity level, same as: $SCRIPT_NAME -v 1"
|
print_screen_output "-d Default output verbosity level, same as: $SCRIPT_NAME -v 1"
|
||||||
print_screen_output "-D Show full hard Disk info, not only model, ie: /dev/sda ST380817AS 80.0GB."
|
print_screen_output "-D Show full hard Disk info, not only model, ie: /dev/sda ST380817AS 80.0GB."
|
||||||
print_screen_output "-f Show all cpu flags used, not just the short list. Not shown with -F to avoid spamming."
|
print_screen_output "-f Show all cpu flags used, not just the short list. Not shown with -F to avoid spamming."
|
||||||
print_screen_output "-F Show Full output for $SCRIPT_NAME. Does not show extra verbose options like -f -u -l -o -p or -t"
|
print_screen_output "-F Show Full output for $SCRIPT_NAME. Does not show extra verbose options like -f -u -l -o -p -t"
|
||||||
print_screen_output "-G Show Graphic card information (card, x type, resolution, glx renderer, version)."
|
print_screen_output "-G Show Graphic card information (card, x type, resolution, glx renderer, version)."
|
||||||
print_screen_output "-i Show Wan IP address, and shows local interfaces (requires ifconfig network tool). Same as -Nni"
|
print_screen_output "-i Show Wan IP address, and shows local interfaces (requires ifconfig network tool). Same as -Nni"
|
||||||
print_screen_output " Not shown with -F for user security reasons, you shouldn't paste your local/wan IP."
|
print_screen_output " Not shown with -F for user security reasons, you shouldn't paste your local/wan IP."
|
||||||
|
@ -1788,17 +1809,21 @@ show_options()
|
||||||
print_screen_output "-Z Absolute override for output filters. Useful for debugging networking issues in irc for example."
|
print_screen_output "-Z Absolute override for output filters. Useful for debugging networking issues in irc for example."
|
||||||
print_screen_output " "
|
print_screen_output " "
|
||||||
print_screen_output "Additional Options:"
|
print_screen_output "Additional Options:"
|
||||||
print_screen_output "-h - this help menu."
|
print_screen_output "-h --help This help menu."
|
||||||
|
print_screen_output "-H This help menu, plus developer options. Do not use dev options in normal operation!"
|
||||||
if [[ $B_ALLOW_UPDATE == 'true' ]];then
|
if [[ $B_ALLOW_UPDATE == 'true' ]];then
|
||||||
print_screen_output "-U Auto-update script. Note: if you installed as root, you"
|
print_screen_output "-U Auto-update script. Note: if you installed as root, you"
|
||||||
print_screen_output " must be root to update, otherwise user is fine."
|
print_screen_output " must be root to update, otherwise user is fine."
|
||||||
fi
|
fi
|
||||||
print_screen_output "-V $SCRIPT_NAME version information. Prints information then exits."
|
print_screen_output "-V --version $SCRIPT_NAME version information. Prints information then exits."
|
||||||
|
print_screen_output " "
|
||||||
|
print_screen_output "Debugging Options:"
|
||||||
print_screen_output "-% Overrides defective or corrupted data."
|
print_screen_output "-% Overrides defective or corrupted data."
|
||||||
print_screen_output "-@ Triggers debugger output. Requires debugging level 1-10 (8-10 - logging)."
|
print_screen_output "-@ Triggers debugger output. Requires debugging level 1-10 (8-10 - logging)."
|
||||||
print_screen_output " 8 - basic logging; 9 - full file/sys info logging; 10 - color logging."
|
print_screen_output " 8 - basic logging; 9 - full file/sys info logging; 10 - color logging."
|
||||||
print_screen_output " 11 - No logging, creates tar.gz file of user data from lsusb/lspci, and xiin read of /sys."
|
print_screen_output " 11 - No logging, creates tar.gz file of user data from lsusb/lspci/sensors, xiin read of /sys."
|
||||||
print_screen_output " 12 - No logging, creates tar.gz file of user data from lsusb/lspci, plus xorg data, glxinfo etc."
|
print_screen_output " 12 - No logging, creates tar.gz file of user data from lsusb/lspci/sensors, xorg data, glxinfo etc."
|
||||||
|
print_screen_output " 13 - No logging, creates tar.gz file of user data from lsusb/lspci/sensors, dev, disks, partitions etc."
|
||||||
if [[ $1 == 'full' ]];then
|
if [[ $1 == 'full' ]];then
|
||||||
print_screen_output " "
|
print_screen_output " "
|
||||||
print_screen_output "Developer and Testing Options (Advanced):"
|
print_screen_output "Developer and Testing Options (Advanced):"
|
||||||
|
@ -1821,13 +1846,13 @@ print_version_info()
|
||||||
{
|
{
|
||||||
local last_modified=$( grep -im 1 'date:' $SCRIPT_PATH/$SCRIPT_NAME | gawk '{print $3,$4,$5}' )
|
local last_modified=$( grep -im 1 'date:' $SCRIPT_PATH/$SCRIPT_NAME | gawk '{print $3,$4,$5}' )
|
||||||
|
|
||||||
print_screen_output "$SCRIPT_NAME - the universal, portable, system info script for irc."
|
print_screen_output "$SCRIPT_NAME - the universal, portable, system info script for console and irc."
|
||||||
print_screen_output "Version: $SCRIPT_VERSION_NUMBER"
|
print_screen_output "Version: $SCRIPT_VERSION_NUMBER"
|
||||||
print_screen_output "Script Last Modified: $last_modified"
|
print_screen_output "Script Last Modified: $last_modified"
|
||||||
print_screen_output "Script Location: $SCRIPT_PATH"
|
print_screen_output "Script Location: $SCRIPT_PATH"
|
||||||
print_screen_output " "
|
print_screen_output " "
|
||||||
print_screen_output "Tested with Irssi, Xchat, Konversation, BitchX, KSirc, ircII,"
|
print_screen_output "Tested in Irssi, Xchat, Konversation, BitchX, KSirc, ircII,"
|
||||||
print_screen_output "Gaim/Pidgin, Weechat, KVIrc and Kopete."
|
print_screen_output "Gaim/Pidgin, Weechat, KVIrc, Quassel, Kopete, and others."
|
||||||
print_screen_output " "
|
print_screen_output " "
|
||||||
print_screen_output "This script is a fork of Infobash 3.02, which is:"
|
print_screen_output "This script is a fork of Infobash 3.02, which is:"
|
||||||
print_screen_output "Copyright (C) 2005-2007 Michiel de Boer a.k.a. locsmif"
|
print_screen_output "Copyright (C) 2005-2007 Michiel de Boer a.k.a. locsmif"
|
||||||
|
@ -2798,7 +2823,13 @@ get_desktop_environment()
|
||||||
version=$( get_de_version 'awesome' '^awesome' '2' )
|
version=$( get_de_version 'awesome' '^awesome' '2' )
|
||||||
desktop_environment='Awesome'
|
desktop_environment='Awesome'
|
||||||
elif [[ -n $( grep -is 'twm' <<< "$ps_aux" | grep -v 'grep' ) ]];then
|
elif [[ -n $( grep -is 'twm' <<< "$ps_aux" | grep -v 'grep' ) ]];then
|
||||||
desktop_environment='TWM' # no --version for this one
|
desktop_environment='Twm' # no --version for this one
|
||||||
|
elif [[ -n $( grep -is 'dwm' <<< "$ps_aux" | grep -v 'grep' ) ]];then
|
||||||
|
version=$( get_de_version 'dwm' '^dwm' '1' )
|
||||||
|
desktop_environment='dwm'
|
||||||
|
elif [[ -n $( grep -is 'wmii' <<< "$ps_aux" | grep -v 'grep' ) ]];then
|
||||||
|
version=$( get_de_version 'wmii' '^wmii' '1' )
|
||||||
|
desktop_environment='wmii'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -2820,13 +2851,14 @@ get_de_version()
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
}
|
}
|
||||||
/'$2'/ {
|
/'$2'/ {
|
||||||
gsub(",","",$0) # xfce output has , in it, so dump all commas
|
sub(/(dwm-|wmii-)/, "",$'$3') # sample: dwm-5.8.2, ©.. etc, why no space? who knows.
|
||||||
|
gsub(",","",$0) # xfce, and other, output has , in it, so dump all commas
|
||||||
print $'$3'
|
print $'$3'
|
||||||
exit # quit after first match prints
|
exit # quit after first match prints
|
||||||
}' )
|
}' )
|
||||||
|
|
||||||
echo $version
|
echo $version
|
||||||
}
|
}
|
||||||
|
|
||||||
# for more on distro id, please reference this python thread: http://bugs.python.org/issue1322
|
# for more on distro id, please reference this python thread: http://bugs.python.org/issue1322
|
||||||
## return distro name/id if found
|
## return distro name/id if found
|
||||||
get_distro_data()
|
get_distro_data()
|
||||||
|
@ -3072,6 +3104,24 @@ get_gpu_temp_data()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
## for possible future data, not currently used
|
||||||
|
get_graphics_agp_data()
|
||||||
|
{
|
||||||
|
eval $LOGFS
|
||||||
|
local agp_module=''
|
||||||
|
|
||||||
|
if [[ $B_MODULES_FILE == 'true' ]];then
|
||||||
|
## not used currently
|
||||||
|
agp_module=$( gawk '
|
||||||
|
/agp/ && !/agpgart/ && $3 > 0 {
|
||||||
|
print(gensub(/(.*)_agp.*/,"\\1","g",$1))
|
||||||
|
}' $FILE_MODULES )
|
||||||
|
log_function_data 'cat' "$FILE_MODULES"
|
||||||
|
fi
|
||||||
|
log_function_data "agp_module: $agp_module"
|
||||||
|
eval $LOGFE
|
||||||
|
}
|
||||||
|
|
||||||
## create array of gfx cards installed on system
|
## create array of gfx cards installed on system
|
||||||
get_graphics_card_data()
|
get_graphics_card_data()
|
||||||
{
|
{
|
||||||
|
@ -3104,6 +3154,39 @@ get_graphics_card_data()
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 nv nvidia openchrome nouveau radeon radeonhd rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng unichrome vesa vga via voodoo vmware v4l'
|
||||||
|
local driver='' driver_string='' xorg_log_data='' status=''
|
||||||
|
|
||||||
|
if [[ $B_XORG_LOG == 'true' ]];then
|
||||||
|
xorg_log_data="$( cat $FILE_XORG_LOG )"
|
||||||
|
A_GRAPHIC_DRIVERS=( $(
|
||||||
|
for driver in $driver_list
|
||||||
|
do
|
||||||
|
# note there appears to be different unload/failed syntax, so using simple conservative one
|
||||||
|
# I was not able to find a case where xorg.log shows unload and not fail
|
||||||
|
if [[ -n $( grep -s "[[:space:]]Loading.*${driver}_drv.so" <<< "$xorg_log_data" ) ]];then
|
||||||
|
if [[ -z $( grep -si "Failed.*${driver}_drv.so" <<< "$xorg_log_data" ) ]];then
|
||||||
|
status='loaded'
|
||||||
|
else
|
||||||
|
status='failed'
|
||||||
|
fi
|
||||||
|
driver_string="$driver,$status"
|
||||||
|
echo $driver_string
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
) )
|
||||||
|
xorg_log_data='' # dump from ram, does it matter?
|
||||||
|
fi
|
||||||
|
log_function_data "A_GRAPHIC_DRIVERS: ${A_GRAPHIC_DRIVERS[@]}"
|
||||||
|
|
||||||
|
eval $LOGFE
|
||||||
|
}
|
||||||
|
|
||||||
## create array of glx data
|
## create array of glx data
|
||||||
get_graphics_glx_data()
|
get_graphics_glx_data()
|
||||||
{
|
{
|
||||||
|
@ -3222,57 +3305,6 @@ get_graphics_res_data()
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
|
|
||||||
## for possible future data, not currently used
|
|
||||||
get_graphics_agp_data()
|
|
||||||
{
|
|
||||||
eval $LOGFS
|
|
||||||
local agp_module=''
|
|
||||||
|
|
||||||
if [[ $B_MODULES_FILE == 'true' ]];then
|
|
||||||
## not used currently
|
|
||||||
agp_module=$( gawk '
|
|
||||||
/agp/ && !/agpgart/ && $3 > 0 {
|
|
||||||
print(gensub(/(.*)_agp.*/,"\\1","g",$1))
|
|
||||||
}' $FILE_MODULES )
|
|
||||||
log_function_data 'cat' "$FILE_MODULES"
|
|
||||||
fi
|
|
||||||
log_function_data "agp_module: $agp_module"
|
|
||||||
eval $LOGFE
|
|
||||||
}
|
|
||||||
|
|
||||||
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 nv nvidia openchrome nouveau radeon radeonhd rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng unichrome vesa vga via voodoo vmware v4l'
|
|
||||||
local driver='' driver_string='' xorg_log_data='' status=''
|
|
||||||
|
|
||||||
if [[ $B_XORG_LOG == 'true' ]];then
|
|
||||||
xorg_log_data="$( cat $FILE_XORG_LOG )"
|
|
||||||
A_GRAPHIC_DRIVERS=( $(
|
|
||||||
for driver in $driver_list
|
|
||||||
do
|
|
||||||
# note there appears to be different unload/failed syntax, so using simple conservative one
|
|
||||||
# I was not able to find a case where xorg.log shows unload and not fail
|
|
||||||
if [[ -n $( grep -s "[[:space:]]Loading.*${driver}_drv.so" <<< "$xorg_log_data" ) ]];then
|
|
||||||
if [[ -z $( grep -si "Failed.*${driver}_drv.so" <<< "$xorg_log_data" ) ]];then
|
|
||||||
status='loaded'
|
|
||||||
else
|
|
||||||
status='failed'
|
|
||||||
fi
|
|
||||||
driver_string="$driver,$status"
|
|
||||||
echo $driver_string
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
) )
|
|
||||||
xorg_log_data='' # dump from ram, does it matter?
|
|
||||||
fi
|
|
||||||
log_function_data "A_GRAPHIC_DRIVERS: ${A_GRAPHIC_DRIVERS[@]}"
|
|
||||||
|
|
||||||
eval $LOGFE
|
|
||||||
}
|
|
||||||
|
|
||||||
## create array of x vendor/version data
|
## create array of x vendor/version data
|
||||||
get_graphics_x_data()
|
get_graphics_x_data()
|
||||||
{
|
{
|
||||||
|
@ -3303,7 +3335,7 @@ get_graphics_x_data()
|
||||||
# this gives better output than the failure last case, which would only show:
|
# this gives better output than the failure last case, which would only show:
|
||||||
# for example: X.org: 1.9 instead of: X.org: 1.9.0
|
# for example: X.org: 1.9 instead of: X.org: 1.9.0
|
||||||
if [[ -z $x_version ]];then
|
if [[ -z $x_version ]];then
|
||||||
x_version=$( get_x_version )
|
x_version=$( get_graphics_x_version )
|
||||||
fi
|
fi
|
||||||
if [[ -z $x_version ]];then
|
if [[ -z $x_version ]];then
|
||||||
x_version=$( xdpyinfo | gawk -F': +' '
|
x_version=$( xdpyinfo | gawk -F': +' '
|
||||||
|
@ -3326,7 +3358,7 @@ get_graphics_x_data()
|
||||||
A_X_DATA[0]="$x_vendor"
|
A_X_DATA[0]="$x_vendor"
|
||||||
A_X_DATA[1]="$x_version"
|
A_X_DATA[1]="$x_version"
|
||||||
else
|
else
|
||||||
x_version=$( get_x_version )
|
x_version=$( get_graphics_x_version )
|
||||||
if [[ -n $x_version ]];then
|
if [[ -n $x_version ]];then
|
||||||
x_vendor='X.org'
|
x_vendor='X.org'
|
||||||
A_X_DATA[0]="$x_vendor"
|
A_X_DATA[0]="$x_vendor"
|
||||||
|
@ -3337,7 +3369,7 @@ get_graphics_x_data()
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
# if other tests fail, try this one, this works for root, out of X also
|
# if other tests fail, try this one, this works for root, out of X also
|
||||||
get_x_version()
|
get_graphics_x_version()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local x_exists=$( type -p X )
|
local x_exists=$( type -p X )
|
||||||
|
@ -5475,7 +5507,7 @@ print_gfx_data()
|
||||||
# set A_GRAPHIC_DRIVERS
|
# set A_GRAPHIC_DRIVERS
|
||||||
get_graphics_driver
|
get_graphics_driver
|
||||||
|
|
||||||
# this handles the different, shorter, irc colors strings embedded in variable data
|
# this handles the different, longer, irc colors strings embedded in variable data
|
||||||
if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
|
if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
|
||||||
line_max=140
|
line_max=140
|
||||||
fi
|
fi
|
||||||
|
@ -5955,7 +5987,7 @@ print_partition_data()
|
||||||
local partitionIdClean='' part_dev='' full_dev='' part_label='' full_label=''
|
local partitionIdClean='' part_dev='' full_dev='' part_label='' full_label=''
|
||||||
local part_uuid='' full_uuid='' dev_remote='' full_fs=''
|
local part_uuid='' full_uuid='' dev_remote='' full_fs=''
|
||||||
|
|
||||||
# this handles the different, shorter, irc colors strings embedded in variable data
|
# this handles the different, longer, irc colors strings embedded in variable data
|
||||||
if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
|
if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
|
||||||
line_max=130
|
line_max=130
|
||||||
fi
|
fi
|
||||||
|
@ -6343,14 +6375,14 @@ print_sensors_data()
|
||||||
print_system_data()
|
print_system_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local system_data='' bits='' desktop_environment='' line_max=170
|
local system_data='' bits='' desktop_environment='' line_max=165
|
||||||
local host_kernel_string='' de_distro_string='' host_string='' desktop_type='Desktop'
|
local host_kernel_string='' de_distro_string='' host_string='' desktop_type='Desktop'
|
||||||
local host_name=$( hostname )
|
local host_name=$( hostname )
|
||||||
local current_kernel=$( uname -rm ) # | gawk '{print $1,$3,$(NF-1)}' )
|
local current_kernel=$( uname -rm ) # | gawk '{print $1,$3,$(NF-1)}' )
|
||||||
local distro="$( get_distro_data )"
|
local distro="$( get_distro_data )"
|
||||||
local tty_session=$( basename "$( tty 2>/dev/null )" | sed 's/[^0-9]*//g' )
|
local tty_session=$( basename "$( tty 2>/dev/null )" | sed 's/[^0-9]*//g' )
|
||||||
|
|
||||||
# this handles the different, shorter, irc colors strings embedded in variable data
|
# this handles the different, longer, irc colors strings embedded in variable data
|
||||||
if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
|
if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
|
||||||
line_max=150
|
line_max=150
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue