info sys moved in specific function + desktop and shell infos added

This commit is contained in:
Francois B 2018-03-22 10:51:16 +01:00
parent c92d31d7f7
commit 0b1c96f7ee
2 changed files with 59 additions and 7 deletions

View file

@ -548,6 +548,8 @@ function dispLogo () {
#
function usage () {
dispLogo
dispSysInfos
printf "\n"
printf "$NORMAL"
printf "Usage : yggdrasil [options]\n"
printf " -f : full install (see doc for more details)\n"
@ -556,3 +558,59 @@ function usage () {
printf " -v : show verison number\n"
printf " -h : show help & informations\n"
}
function dispSysInfos () {
printf "$BOLDVERT""Architecture : ""$NORMAL"
uname -m
printf "$BOLDVERT""User (userdir) :""$NORMAL"" $myHomedir\n"
printf "$BOLDVERT""OS : ""$NORMAL"
lsb_release -d | awk -F':' '{print $2}' | awk -F'\t' '{print $2}'
printf "$BOLDVERT""Kernel : ""$NORMAL"
uname -r
printf "$BOLDVERT""Desktop : ""$NORMAL"
#printf $DESKTOP_SESSION"\n"
case $XDG_CURRENT_DESKTOP in
"ENLIGHTENMENT")
printf "Enlightenment"
printf "\n"
;;
"GNOME")
printf "Gnome"
printf "\n"
;;
"KDE")
printf "KDE"
printf "\n"
;;
"LXDE")
printf "LXDE"
printf "\n"
;;
"MATE")
printf "Mate"
printf "\n"
;;
"XFCE")
printf "XFCE"
printf "\n"
;;
"X-Cinnamon")
printf "Cinnamon"
printf "\n"
;;
"Unity")
printf "Unity"
printf "\n"
;;
esac
printf "$BOLDVERT""Shell : ""$NORMAL"
shellType=$(ps -p $PPID -o cmd --no-heading)
shellType=${shellType/-}
shellType=${shellType//*\/}
printf $shellType"\n"
}

View file

@ -117,13 +117,7 @@ clear
dispLogo
printf "$BOLDVERT""User (userdir) :""$NORMAL"" $myHomedir\n"
printf "$BOLDVERT""OS : ""$NORMAL"
lsb_release -d | awk -F':' '{print $2}' | awk -F'\t' '{print $2}'
printf "$BOLDVERT""Kernel : ""$NORMAL"
uname -r
printf "$BOLDVERT""Architecture : ""$NORMAL"
uname -m
dispSysInfos
# Useless by itself, but is used to don't be annoyed later in the script
sudo echo