mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 17:07:49 +00:00
by special Mint request, adding shell/panel type extra extra extra output to desktop, this is so easy to do
I decided to just add an -xxx option, for extra extra extra data, no output if nothing detected. No big support issues, and Mint has used inxi by default for a while, so I think it's fine to add this for them.
This commit is contained in:
parent
ce04297c0f
commit
4d219d23a5
53
inxi
53
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.8.6
|
#### version: 1.8.7
|
||||||
#### Date: June 24 2012
|
#### Date: June 24 2012
|
||||||
#### Patch Number: 00
|
#### Patch Number: 00
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -1995,9 +1995,10 @@ get_parameters()
|
||||||
B_SHOW_FULL_OPTICAL='true'
|
B_SHOW_FULL_OPTICAL='true'
|
||||||
B_SHOW_PARTITIONS_FULL='true'
|
B_SHOW_PARTITIONS_FULL='true'
|
||||||
B_SHOW_UNMOUNTED_PARTITIONS='true'
|
B_SHOW_UNMOUNTED_PARTITIONS='true'
|
||||||
|
B_EXTRA_EXTRA_DATA='true'
|
||||||
fi
|
fi
|
||||||
if [[ $OPTARG -ge 7 ]];then
|
if [[ $OPTARG -ge 7 ]];then
|
||||||
B_EXTRA_EXTRA_DATA='true'
|
B_EXTRA_EXTRA_EXTRA_DATA='true'
|
||||||
B_SHOW_IP='true'
|
B_SHOW_IP='true'
|
||||||
B_SHOW_RAID_R='true'
|
B_SHOW_RAID_R='true'
|
||||||
fi
|
fi
|
||||||
|
@ -2010,11 +2011,14 @@ get_parameters()
|
||||||
V) print_version_info
|
V) print_version_info
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
# this will trigger either with xx or with Fx but not with xF
|
# this will trigger either with x, xx, xxx or with Fx but not with xF
|
||||||
x) if [[ $B_EXTRA_DATA == 'true' ]];then
|
x) if [[ $B_EXTRA_EXTRA_DATA == 'true' ]];then
|
||||||
|
B_EXTRA_EXTRA_EXTRA_DATA='true'
|
||||||
|
elif [[ $B_EXTRA_DATA == 'true' ]];then
|
||||||
B_EXTRA_EXTRA_DATA='true'
|
B_EXTRA_EXTRA_DATA='true'
|
||||||
fi
|
else
|
||||||
B_EXTRA_DATA='true'
|
B_EXTRA_DATA='true'
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
z) B_OUTPUT_FILTER='true'
|
z) B_OUTPUT_FILTER='true'
|
||||||
;;
|
;;
|
||||||
|
@ -2234,6 +2238,8 @@ show_options()
|
||||||
print_screen_output " read ahead, raid events). Adds if present, unused device line. Resync line, shows progress bar."
|
print_screen_output " read ahead, raid events). Adds if present, unused device line. Resync line, shows progress bar."
|
||||||
print_screen_output " -S - Adds display manager (dm) to desktop output, if in X (like kdm, gdm3, lightdm)."
|
print_screen_output " -S - Adds display manager (dm) to desktop output, if in X (like kdm, gdm3, lightdm)."
|
||||||
print_screen_output " -xx -@ <11-14> - Automatically uploads debugger data tar.gz file to ftp.techpatterns.com."
|
print_screen_output " -xx -@ <11-14> - Automatically uploads debugger data tar.gz file to ftp.techpatterns.com."
|
||||||
|
print_screen_output "-xxx Show extra, extra, extra data (only works with verbose or line output, not short form): "
|
||||||
|
print_screen_output " -S - Adds panel/shell information to desktop output, if in X (like gnome-shell, cinnamon, )."
|
||||||
print_screen_output "-z Adds security filters for IP addresses, Mac, and user home directory name. Default on for irc clients."
|
print_screen_output "-z Adds security filters for IP addresses, Mac, and user home directory name. Default on for irc clients."
|
||||||
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 " "
|
||||||
|
@ -3353,6 +3359,31 @@ get_desktop_environment()
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_desktop_extra_data()
|
||||||
|
{
|
||||||
|
eval $LOGFS
|
||||||
|
local de_data=$( ps -A | gawk '
|
||||||
|
BEGIN {
|
||||||
|
IGNORECASE=1
|
||||||
|
desktops=""
|
||||||
|
separator=""
|
||||||
|
}
|
||||||
|
/cinnamon|gnome-shell|gnome-panel|lxpanel|mate-panel|plasma-desktop|xfce4-panel/ {
|
||||||
|
# only one entry per type, can be multiple
|
||||||
|
if ( desktops !~ $NF ) {
|
||||||
|
desktops = desktops separator $NF
|
||||||
|
separator = ","
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
print desktops
|
||||||
|
}
|
||||||
|
' )
|
||||||
|
echo $de_data
|
||||||
|
|
||||||
|
eval $LOGFE
|
||||||
|
}
|
||||||
|
|
||||||
# note: gawk doesn't support white spaces in search string, gave errors, so use [[:space:]] instead
|
# note: gawk doesn't support white spaces in search string, gave errors, so use [[:space:]] instead
|
||||||
# args: $1 - desktop command for --version; $2 - search string; $3 - gawk print number
|
# args: $1 - desktop command for --version; $2 - search string; $3 - gawk print number
|
||||||
get_de_app_version()
|
get_de_app_version()
|
||||||
|
@ -3393,7 +3424,7 @@ get_de_app_version()
|
||||||
# see which dm has started if any
|
# see which dm has started if any
|
||||||
get_display_manager()
|
get_display_manager()
|
||||||
{
|
{
|
||||||
eval $LOGFE
|
eval $LOGFS
|
||||||
local dm_id_list='entrance/entranced.pid gdm.pid gdm3.pid kdm.pid lightdm.pid lxdm.pid mdm.pid nodm.pid slim.lock wdm.pid xdm.pid'
|
local dm_id_list='entrance/entranced.pid gdm.pid gdm3.pid kdm.pid lightdm.pid lxdm.pid mdm.pid nodm.pid slim.lock wdm.pid xdm.pid'
|
||||||
local dm_id='' dm='' separator=''
|
local dm_id='' dm='' separator=''
|
||||||
local x_is_running=$( ps aux | grep '/usr.*/X' | grep -Eivc '(grep|/Xprt)' )
|
local x_is_running=$( ps aux | grep '/usr.*/X' | grep -Eivc '(grep|/Xprt)' )
|
||||||
|
@ -8312,7 +8343,7 @@ print_sensors_data()
|
||||||
print_system_data()
|
print_system_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local system_data='' bits='' desktop_environment='' dm_data=''
|
local system_data='' bits='' desktop_environment='' dm_data='' de_extra_data=''
|
||||||
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)}' )
|
||||||
|
@ -8332,6 +8363,12 @@ print_system_data()
|
||||||
fi
|
fi
|
||||||
dm_data=" ${C1}dm$SEP3${C2} $dm_data"
|
dm_data=" ${C1}dm$SEP3${C2} $dm_data"
|
||||||
fi
|
fi
|
||||||
|
if [[ $B_EXTRA_EXTRA_EXTRA_DATA == 'true' ]];then
|
||||||
|
de_extra_data=$( get_desktop_extra_data )
|
||||||
|
if [[ -n $de_extra_data ]];then
|
||||||
|
de_extra_data=" ${C1}info$SEP3${C2} $de_extra_data"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
if [[ -z $tty_session && $B_CONSOLE_IRC == 'true' ]];then
|
if [[ -z $tty_session && $B_CONSOLE_IRC == 'true' ]];then
|
||||||
tty_session=$( get_console_irc_tty )
|
tty_session=$( get_console_irc_tty )
|
||||||
|
@ -8343,7 +8380,7 @@ print_system_data()
|
||||||
desktop_type='Console'
|
desktop_type='Console'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
de_distro_string="${C1}$desktop_type$SEP3${C2} $desktop_environment$dm_data ${C1}Distro$SEP3${C2} $distro"
|
de_distro_string="${C1}$desktop_type$SEP3${C2} $desktop_environment$de_extra_data$dm_data ${C1}Distro$SEP3${C2} $distro"
|
||||||
if [[ $B_EXTRA_DATA == 'true' ]];then
|
if [[ $B_EXTRA_DATA == 'true' ]];then
|
||||||
gcc_string=$( get_gcc_kernel_version )
|
gcc_string=$( get_gcc_kernel_version )
|
||||||
if [[ -n $gcc_string ]];then
|
if [[ -n $gcc_string ]];then
|
||||||
|
|
4
inxi.8
4
inxi.8
|
@ -303,6 +303,10 @@ Supports most known display managers, like xdm, gdm, kdm, slim, lightdm, or mdm.
|
||||||
.B -xx -@ <11-14>
|
.B -xx -@ <11-14>
|
||||||
- Automatically uploads debugger data tar.gz file to ftp.techpatterns.com.
|
- Automatically uploads debugger data tar.gz file to ftp.techpatterns.com.
|
||||||
.TP
|
.TP
|
||||||
|
.B -xxx -S
|
||||||
|
- Adds, if run in X, shell/panel type info to Desktop information, if present. If none, shows nothing.
|
||||||
|
Supports some current desktop extras like gnome-panel, lxde-panel, and others. Added mainly for Mint support.
|
||||||
|
.TP
|
||||||
.B -z
|
.B -z
|
||||||
Adds security filters for IP addresses, Mac, and user home directory name. Default on for irc clients.
|
Adds security filters for IP addresses, Mac, and user home directory name. Default on for irc clients.
|
||||||
.TP
|
.TP
|
||||||
|
|
Loading…
Reference in a new issue