mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
trying a bug fix for scrotwm/dwm issue of sending --version/-v to stderr instead of stdout
This commit is contained in:
parent
7c99d71ecf
commit
8561e00ca9
15
inxi
15
inxi
|
@ -2857,15 +2857,24 @@ get_desktop_environment()
|
|||
# args: $1 - desktop command for --version; $2 - search string; $3 - gawk print number
|
||||
get_de_version()
|
||||
{
|
||||
local version='' get_version='--version'
|
||||
local version_data='' version='' get_version='--version'
|
||||
|
||||
case $1 in
|
||||
dwm|wmii)
|
||||
get_version='-v'
|
||||
;;
|
||||
esac
|
||||
# note, some wm send version info to stderr instead of stdout
|
||||
case $1 in
|
||||
dwm|scrotwm)
|
||||
version_data="$( $1 $get_version )"
|
||||
;;
|
||||
*)
|
||||
version_data="$( $1 $get_version 2>/dev/null )"
|
||||
;;
|
||||
esac
|
||||
|
||||
version=$( $1 $get_version 2>/dev/null | gawk '
|
||||
version=$( gawk '
|
||||
BEGIN {
|
||||
IGNORECASE=1
|
||||
}
|
||||
|
@ -2875,7 +2884,7 @@ get_de_version()
|
|||
gsub(/(,|dwm-|wmii-|v|V)/, "",$'$3')
|
||||
print $'$3'
|
||||
exit # quit after first match prints
|
||||
}' )
|
||||
}' <<< "$version_data" )
|
||||
echo $version
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue