mirror of
https://github.com/smxi/inxi.git
synced 2025-09-04 03:29:10 +00:00
Fixed version number display to handle that part dynamically, fixed more code
This commit is contained in:
parent
12492a95ba
commit
9e013bcab7
1 changed files with 23 additions and 13 deletions
36
inxi
36
inxi
|
@ -50,9 +50,11 @@ shopt -u nullglob
|
||||||
#### UNCALCULATED VARIABLES
|
#### UNCALCULATED VARIABLES
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
SELF="inxi"
|
SCRIPT_NAME="inxi"
|
||||||
SELF_LC=$(echo "$SELF" | tr '[A-Z]' '[a-z]')
|
SCRIPT_LOWER_CASE=$( tr '[A-Z]' '[a-z]' <<< $SCRIPT_NAME )
|
||||||
MYVERSION="$SELF 0.1.0"
|
SCRIPT_PATH=$( dirname $0 )
|
||||||
|
SCRIPT_VERSION_NUMBER=$( grep -m 1 'version:' $SCRIPT_PATH/$SCRIPT_NAME | awk '{print $3}' )
|
||||||
|
MY_VERSION="$SCRIPT_NAME $SCRIPT_VERSION_NUMBER"
|
||||||
LC_ALL="C" # Make sure every program speaks English.
|
LC_ALL="C" # Make sure every program speaks English.
|
||||||
export LC_ALL
|
export LC_ALL
|
||||||
OIFS="$IFS" # Backup the current Internal Field Seperator
|
OIFS="$IFS" # Backup the current Internal Field Seperator
|
||||||
|
@ -93,11 +95,19 @@ XPATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" # Extra pat
|
||||||
PARAMLIMIT=30 # This is a variable that controls how many parameters infobash will parse in a /proc/<pid>/cmdline file before stopping.
|
PARAMLIMIT=30 # This is a variable that controls how many parameters infobash will parse in a /proc/<pid>/cmdline file before stopping.
|
||||||
CRAP=0 # New parameter
|
CRAP=0 # New parameter
|
||||||
FLAG=0 # A throw-away 'flag' variable intended to be used throughout infobash
|
FLAG=0 # A throw-away 'flag' variable intended to be used throughout infobash
|
||||||
KONVICFG="konversation/scripts/$SELF_LC.conf" # relative path to $(kde-config --path data)
|
KONVICFG="konversation/scripts/$SCRIPT_LOWER_CASE.conf" # relative path to $(kde-config --path data)
|
||||||
DCOPOBJ="default"
|
DCOPOBJ="default"
|
||||||
|
|
||||||
[[ -s /etc/$SELF_LC.conf ]] && source /etc/$SELF_LC.conf # Source global config overrides
|
# Source global config overrides
|
||||||
[[ -s $HOME/.$SELF_LC ]] && source $HOME/.$SELF_LC # Source user config overrides
|
if [[ -s /etc/$SCRIPT_LOWER_CASE.conf ]]
|
||||||
|
then
|
||||||
|
source /etc/$SCRIPT_LOWER_CASE.conf
|
||||||
|
fi
|
||||||
|
# Source user config overrides
|
||||||
|
if [[ -s $HOME/.$SCRIPT_LOWER_CASE ]]
|
||||||
|
then
|
||||||
|
source $HOME/.$SCRIPT_LOWER_CASE
|
||||||
|
fi
|
||||||
# WARNING: In the main part below (search for 'KONVI')
|
# WARNING: In the main part below (search for 'KONVI')
|
||||||
# there's a check for Konversation-specific config files.
|
# there's a check for Konversation-specific config files.
|
||||||
# Any one of these can override the above if infobash is run
|
# Any one of these can override the above if infobash is run
|
||||||
|
@ -133,22 +143,22 @@ error()
|
||||||
{
|
{
|
||||||
case $1 in
|
case $1 in
|
||||||
2)
|
2)
|
||||||
say "$SELF: large flood danger, debug buffer full!"
|
say "$SCRIPT_NAME: large flood danger, debug buffer full!"
|
||||||
;;
|
;;
|
||||||
3)
|
3)
|
||||||
say "$SELF: error in colorscheme, or unknown parameter: $2"
|
say "$SCRIPT_NAME: error in colorscheme, or unknown parameter: $2"
|
||||||
;;
|
;;
|
||||||
4)
|
4)
|
||||||
say "$SELF: unknown verbosity level $2"
|
say "$SCRIPT_NAME: unknown verbosity level $2"
|
||||||
;;
|
;;
|
||||||
5)
|
5)
|
||||||
say "$SELF: dependency not met: $2 not found in path"
|
say "$SCRIPT_NAME: dependency not met: $2 not found in path"
|
||||||
;;
|
;;
|
||||||
6)
|
6)
|
||||||
say "$SELF: /proc not found! Quitting..."
|
say "$SCRIPT_NAME: /proc not found! Quitting..."
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
say "$SELF: error unknown: $@"
|
say "$SCRIPT_NAME: error unknown: $@"
|
||||||
set -- 99
|
set -- 99
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -1047,7 +1057,7 @@ then
|
||||||
then
|
then
|
||||||
LNLAST="${LNLAST}$(echo -ne " | ${C1}Client${C2} ${IRC}${IRCV}${CN}")"
|
LNLAST="${LNLAST}$(echo -ne " | ${C1}Client${C2} ${IRC}${IRCV}${CN}")"
|
||||||
fi
|
fi
|
||||||
LNLAST="${LNLAST}$(echo -ne " | ${C1}${MYVERSION}")"
|
LNLAST="${LNLAST}$(echo -ne " | ${C1}${MY_VERSION}")"
|
||||||
if ((SCHEME))
|
if ((SCHEME))
|
||||||
then
|
then
|
||||||
LNLAST="${LNLAST}$(echo -ne "${NORMAL}")"
|
LNLAST="${LNLAST}$(echo -ne "${NORMAL}")"
|
||||||
|
|
Loading…
Add table
Reference in a new issue