branch test, no version change, adding quassel support

This commit is contained in:
inxi-svn 2009-03-13 22:18:03 +00:00
parent bdb12380f3
commit 1ab0749006

93
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.0.4-b1-t5 #### version: 1.0.7-b1-t1
#### Date: 1 March 2009 #### Date: 13 March 2009
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
######################################################################## ########################################################################
@ -1037,7 +1037,7 @@ print_version_info()
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"
print_screen_output "Subsequent changes and modifications (after Infobash 3.02) are:" print_screen_output "Subsequent changes and modifications (after Infobash 3.02) are:"
print_screen_output "Copyright (C) 2008 Scott Rogers, Harald Hope, aka trash80 & h2" print_screen_output "Copyright (C) 2008-9 Scott Rogers, Harald Hope, aka trash80 & h2"
print_screen_output "" print_screen_output ""
print_screen_output "This program is free software; you can redistribute it and/or modify" print_screen_output "This program is free software; you can redistribute it and/or modify"
print_screen_output "it under the terms of the GNU General Public License as published by" print_screen_output "it under the terms of the GNU General Public License as published by"
@ -1086,7 +1086,9 @@ get_start_client()
# as they appear. # as they appear.
case $app_working_name in case $app_working_name in
irssi-text|irssi) irssi-text|irssi)
IRC_CLIENT_VERSION=" $( $irc_client_path -v | gawk 'NR == 1 { print $2 }' )" IRC_CLIENT_VERSION=" $( $irc_client_path -v | gawk 'NR == 1 {
print $2
}' )"
IRC_CLIENT="Irssi" IRC_CLIENT="Irssi"
;; ;;
konversation) konversation)
@ -1121,8 +1123,7 @@ get_start_client()
T2="${T[0]}" T2="${T[0]}"
fi fi
# Remove any dots except the first, and make sure there are no trailing zeroes, # Remove any dots except the first, and make sure there are no trailing zeroes,
T2=$( echo "$T2" | gawk ' T2=$( echo "$T2" | gawk '{
{
sub(/\./, " ") sub(/\./, " ")
gsub(/\./, "") gsub(/\./, "")
sub(/ /, ".") sub(/ /, ".")
@ -1137,11 +1138,15 @@ get_start_client()
IRC_CLIENT="Konversation" IRC_CLIENT="Konversation"
;; ;;
xchat-gnome) xchat-gnome)
IRC_CLIENT_VERSION=" $( $irc_client_path -v | gawk 'NR == 1 { print $2 }' )" IRC_CLIENT_VERSION=" $( $irc_client_path -v | gawk 'NR == 1 {
print $2
}' )"
IRC_CLIENT="X-Chat-Gnome" IRC_CLIENT="X-Chat-Gnome"
;; ;;
xchat) xchat)
IRC_CLIENT_VERSION=" $( $irc_client_path -v | gawk 'NR == 1 { print $2 }' )" IRC_CLIENT_VERSION=" $( $irc_client_path -v | gawk 'NR == 1 {
print $2
}' )"
IRC_CLIENT="X-Chat" IRC_CLIENT="X-Chat"
;; ;;
bitchx) bitchx)
@ -1161,17 +1166,58 @@ get_start_client()
IRC_CLIENT="BitchX" IRC_CLIENT="BitchX"
;; ;;
ircii) ircii)
IRC_CLIENT_VERSION=" $( $irc_client_path -v | gawk 'NR == 1 { print $3 }' )" IRC_CLIENT_VERSION=" $( $irc_client_path -v | gawk 'NR == 1 {
print $3
}' )"
IRC_CLIENT="ircII" IRC_CLIENT="ircII"
;; ;;
gaim) gaim)
IRC_CLIENT_VERSION=" $( $irc_client_path -v | gawk 'NR == 1 { print $2 }' )" IRC_CLIENT_VERSION=" $( $irc_client_path -v | gawk 'NR == 1 {
print $2
}' )"
IRC_CLIENT="Gaim" IRC_CLIENT="Gaim"
;; ;;
pidgin) pidgin)
IRC_CLIENT_VERSION=" $( $irc_client_path -v | gawk 'NR == 1 { print $2 }' )" IRC_CLIENT_VERSION=" $( $irc_client_path -v | gawk 'NR == 1 {
print $2
}' )"
IRC_CLIENT="Pidgin" IRC_CLIENT="Pidgin"
;; ;;
quassel*)
# sample: quassel -v
# Qt: 4.5.0
# KDE: 4.2.65 (KDE 4.2.65 (KDE 4.3 >= 20090226))
# Quassel IRC: v0.4.0 [+60] (git-22effe5)
# note: early < 0.4.1 quassels do not have -v
IRC_CLIENT_VERSION=" $( $irc_client_path -v 2>/dev/null | gawk -F ': ' '
BEGIN {
IGNORECASE=1
clientVersion=""
}
/Quassel IRC/ {
clientVersion = $2
}
END {
# this handles pre 0.4.1 cases with no -v
if ( clientVersion == "" ) {
clientVersion = "(pre v0.4.1)"
}
print clientVersion
}' )"
# now handle primary, client, and core. quasselcore doesn't actually
# handle scripts with exec, but it's here just to be complete
case $app_working_name in
quassel)
IRC_CLIENT="Quassel [M]"
;;
quasselclient)
IRC_CLIENT="Quassel"
;;
quasselcore)
IRC_CLIENT="Quassel (core)"
;;
esac
;;
weechat-curses) weechat-curses)
IRC_CLIENT_VERSION=" $( $irc_client_path -v ) " IRC_CLIENT_VERSION=" $( $irc_client_path -v ) "
IRC_CLIENT="Weechat" IRC_CLIENT="Weechat"
@ -2375,16 +2421,22 @@ get_partition_data()
BEGIN { BEGIN {
IGNORECASE=1 IGNORECASE=1
} }
# this is required because below we are subtracting from NF, so it has to be # this has to be nulled for every iteration so it does not retain value from last iteration
# > 1, actually greater than 4, but that is so unlikely to occur because devBase=""
# this is required because below we are subtracting from NF, so it has to be > 4
# the real issue is long file system names that force the wrap of df output: //fileserver/main # the real issue is long file system names that force the wrap of df output: //fileserver/main
# but we still need to handle more dynamically long space containing file names, but later.
( NF < 5 ) && ( $0 !~ /[0-9]+\%/ ) { ( NF < 5 ) && ( $0 !~ /[0-9]+\%/ ) {
# set the dev location here for cases of wrapped output
if ( NF == 1 ){
devBase=gensub( /^(\/dev\/)(.+)$/, "\\2", 1, $1 )
}
getline getline
} }
# this handles yet another fredforfaen special case where a mounted drive # this handles yet another fredforfaen special case where a mounted drive
# has the search string in its name # has the search string in its name
$NF ~ /^\/$|^\/boot$|^\/var$|^\/home$|^\/tmp$|^\/usr$/ { $NF ~ /^\/$|^\/boot$|^\/var$|^\/home$|^\/tmp$|^\/usr$/ {
print $NF "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",main" print $NF "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",main," devBase
} }
# skip all these, including the first, header line. Use the --exclude-type # skip all these, including the first, header line. Use the --exclude-type
# to handle new filesystems types we do not want listed here # to handle new filesystems types we do not want listed here
@ -2393,14 +2445,14 @@ get_partition_data()
# the test show the wrong data in each of the fields, if no x%, then do not use # the test show the wrong data in each of the fields, if no x%, then do not use
# using 3 cases, first default, standard, 2nd, 3rd, handles one and two spaces in name # using 3 cases, first default, standard, 2nd, 3rd, handles one and two spaces in name
if ( $(NF - 1) ~ /[0-9]+\%/ ) { if ( $(NF - 1) ~ /[0-9]+\%/ ) {
print $NF "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",secondary" print $NF "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",secondary," devBase
} }
# these two cases construct the space containing name # these two cases construct the space containing name
else if ( $(NF - 2) ~ /[0-9]+\%/ ) { else if ( $(NF - 2) ~ /[0-9]+\%/ ) {
print $(NF - 1) " " $NF "," $(NF - 5) "," $(NF - 4) "," $(NF - 2) ",secondary" print $(NF - 1) " " $NF "," $(NF - 5) "," $(NF - 4) "," $(NF - 2) ",secondary," devBase
} }
else if ( $(NF - 3) ~ /[0-9]+\%/ ) { else if ( $(NF - 3) ~ /[0-9]+\%/ ) {
print $(NF - 2) " " $(NF - 1) " " $NF "," $(NF - 6) "," $(NF - 5) "," $(NF - 3) ",secondary" print $(NF - 2) " " $(NF - 1) " " $NF "," $(NF - 6) "," $(NF - 5) "," $(NF - 3) ",secondary," devBase
} }
} }
' ) ' )
@ -2420,7 +2472,7 @@ get_partition_data()
swapCounter = ++swapCounter swapCounter = ++swapCounter
}' ) ) }' ) )
IFS="$ORIGINAL_IFS" IFS="$ORIGINAL_IFS"
echo A_PARTITION_DATA ${A_PARTITION_DATA[@]}
if [[ $B_SHOW_LABELS == 'true' || $B_SHOW_UUIDS == 'true' ]];then if [[ $B_SHOW_LABELS == 'true' || $B_SHOW_UUIDS == 'true' ]];then
get_partition_data_advanced get_partition_data_advanced
fi fi
@ -2475,7 +2527,7 @@ get_partition_data_advanced()
partition = "" partition = ""
} }
# handle Arch /dev/root for / id # handle /dev/root for / id
if ( partition == "root" ) { if ( partition == "root" ) {
# if this works, great, otherwise, just set this to null values # if this works, great, otherwise, just set this to null values
partTemp="'$( readlink /dev/root 2>/dev/null )'" partTemp="'$( readlink /dev/root 2>/dev/null )'"
@ -2485,9 +2537,11 @@ get_partition_data_advanced()
} }
else if ( partTemp ~ /by-uuid/ ) { else if ( partTemp ~ /by-uuid/ ) {
uuid=gensub( /^(\/dev\/disk\/by-uuid\/)(.+)$/, "\\2", 1, partTemp ) uuid=gensub( /^(\/dev\/disk\/by-uuid\/)(.+)$/, "\\2", 1, partTemp )
partition="" # set null to let real location get discovered
} }
else if ( partTemp ~ /by-label/ ) { else if ( partTemp ~ /by-label/ ) {
label=gensub( /^(\/dev\/disk\/by-label\/)(.+)$/, "\\2", 1, partTemp ) label=gensub( /^(\/dev\/disk\/by-label\/)(.+)$/, "\\2", 1, partTemp )
partition="" # set null to let real location get discovered
} }
} }
else { else {
@ -3300,6 +3354,7 @@ print_partition_data()
dev_remote='remote' dev_remote='remote'
fi fi
else else
dev_remote='dev'
part_dev='N/A' part_dev='N/A'
fi fi
full_dev=" ${C1}$dev_remote:${C2} $part_dev" full_dev=" ${C1}$dev_remote:${C2} $part_dev"