mirror of https://framagit.org/kyodev/kyopages.git
getInfo 3.11.0
This commit is contained in:
parent
3ae7052262
commit
dab19b0221
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=3.10.0
|
||||
date="27/01/2018"
|
||||
version=3.11.0
|
||||
date="28/01/2018"
|
||||
projet="simpledeb"
|
||||
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
|
||||
script="getInfo"
|
||||
|
@ -845,7 +845,7 @@ fi_conf(){ # 13/12/2017
|
|||
f_dspl cmd "$confs" "grep -Ersv '^#|^$' <fichiers désirés>"
|
||||
}
|
||||
|
||||
fi_cpu(){ # 26/01/2018
|
||||
fi_cpu(){ # 28/01/2018
|
||||
local cpu_flags text iflag qte_flags text_flags="" pluriel
|
||||
local alert_microcode
|
||||
|
||||
|
@ -854,14 +854,13 @@ fi_cpu(){ # 26/01/2018
|
|||
cpu_flags=$( sed -n 's/^flags.*: \(.*\)$/\1/p;' /proc/cpuinfo | sed -n '1p'| \
|
||||
tr ' ' '\n' | sort | tr '\n' ' ' | xargs )
|
||||
for iflag in $cpu_flags; do
|
||||
text_flags+="$(
|
||||
$c_awk -v motif="$iflag" -F '⟷' '
|
||||
BEGIN { IGNORECASE=1; pattern = "^"motif"[[:blank:]]" }
|
||||
$0 ~ pattern { $1 = motif; exit }
|
||||
END { if( $1 != motif ) {$1 = motif; $2 = "?"}
|
||||
printf ("%-20s %s",$1,$2 ) #ligne
|
||||
}' <<< $CPU_FLAGS
|
||||
)"$'\n'
|
||||
text_flags+=$( $c_awk -v motif="$iflag" -F '⟷' '
|
||||
BEGIN { pattern = "^"toupper(motif) } # recherche sur majuscule
|
||||
$0 ~ pattern { $1 = motif; exit } # $1, flag, en minuscule
|
||||
END { if( $1 != motif ) { $1 = motif; $2 = "?" } # si rien trouvé: ?
|
||||
printf ("%-20s %s",$1,$2 )
|
||||
}
|
||||
' <<< $CPU_FLAGS )$'\n'
|
||||
done
|
||||
text_flags=${text_flags%[[:cntrl:]]} # suppression \n final
|
||||
[ "$cpu_flags" ] && qte_flags=$( f__wcv -w "$cpu_flags" flags )
|
||||
|
@ -1619,7 +1618,7 @@ fi_packagers(){ #v2 23/11/2017
|
|||
fi
|
||||
}
|
||||
|
||||
fi_pkg_apt(){ #v3 27/01/2018
|
||||
fi_pkg_apt(){ #v3 28/01/2018
|
||||
local dateMaj nb_packages ifile info_update text pluriel
|
||||
local sources cmt_sources cmd_sources result
|
||||
local apt_v apt_version apt_prefs cmt_apt_prefs cmd_apt_prefs alert_non_pref
|
||||
|
@ -1639,7 +1638,7 @@ fi_pkg_apt(){ #v3 27/01/2018
|
|||
# sources
|
||||
sources=$( f_grep_file "/etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources" "sources date" )
|
||||
cmt_sources="dépôts"
|
||||
cmd_sources="grep -Ersv '^#|^$' /etc/apt/sources.list /etc/apt/sources.list.d/*.list"
|
||||
cmd_sources="grep -Ersv '^#|^$' /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources"
|
||||
# sources ignorées
|
||||
result=$( f_policy "sources" )
|
||||
if [ "$result" ] ; then
|
||||
|
@ -1648,7 +1647,7 @@ fi_pkg_apt(){ #v3 27/01/2018
|
|||
unset result
|
||||
# preferences
|
||||
apt_prefs=$( f_grep_file "/etc/apt/preferences /etc/apt/preferences.d/*" "lignevide date" )
|
||||
cmd_apt_prefs="grep -Erv '^#|^$' /etc/apt/preferences.d/"
|
||||
cmd_apt_prefs="grep -Erv '^#|^$' /etc/apt/preferences /etc/apt/preferences.d/"
|
||||
cmt_apt_prefs="préférences apt"
|
||||
# preferences ignorées
|
||||
result=$( f_policy "preferences" )
|
||||
|
@ -1737,7 +1736,7 @@ fi_pkg_apt(){ #v3 27/01/2018
|
|||
alert_upgrade="ces paquets peuvent être mis à jour avec: **apt upgrade**"
|
||||
elif [ "${qte_upgradable[0]}" -lt 0 ]; then
|
||||
upgrade="• erreur apt, les paquets à mettre à jour ne peuvent être déterminés"
|
||||
alert_apt="Erreur apt, vérifier avec **apt update ; apt upgrade --simulate**"
|
||||
alert_apt="Erreur apt, vérifier avec **apt update ; apt upgrade** et analyser les messages"
|
||||
fi
|
||||
# full-upgrade
|
||||
if [ "${qte_upgradable[1]}" -gt 0 ]; then
|
||||
|
@ -1860,7 +1859,6 @@ fi_pkg_apt(){ #v3 27/01/2018
|
|||
# kernel
|
||||
# metaPkg=$( dpkg -l | grep -i -E 'linux-(image|headers)-([0-9]{3}|amd)' )
|
||||
metaPkg=$( $c_awk '
|
||||
BEGIN{IGNORECASE=1}
|
||||
/linux-(image|headers)-([0-9]{3}|amd)/ { printf "%-3s %-30s %s ",$1, $2, $3
|
||||
$1=$2=$3=$4=""; print $0
|
||||
}' <<< $( dpkg -l ) )
|
||||
|
@ -1868,7 +1866,6 @@ fi_pkg_apt(){ #v3 27/01/2018
|
|||
cmt_metaPkg="métapaquet noyau"
|
||||
# kernel=$( dpkg -l | grep -i -E "linux-(headers|image)-$(uname -r)" )
|
||||
kernel=$( $c_awk '
|
||||
BEGIN{IGNORECASE=1}
|
||||
/linux-(headers|image)-'$(uname -r)'/ { printf "%-3s %-30s %s ",$1, $2, $3
|
||||
$1=$2=$3=$4=""; print $0
|
||||
}' <<< $( dpkg -l ) )
|
||||
|
@ -3123,8 +3120,8 @@ figet_cpu_uarch(){ # 14/11/2017
|
|||
}
|
||||
|
||||
# assigne $fg_de, $fg_de_panel
|
||||
figet_de(){ #v 26/01/2018 # thanks neofetch
|
||||
local de="n/a"
|
||||
figet_de(){ #v 28/01/2018 # thanks neofetch
|
||||
local de="n/a" ps
|
||||
|
||||
x_de=1
|
||||
fg_de="n/a"
|
||||
|
@ -3143,7 +3140,8 @@ figet_de(){ #v 26/01/2018 # thanks neofetch
|
|||
return 0
|
||||
# fallback to using xprop
|
||||
elif [[ -z "$de" ]]; then
|
||||
de=$( xprop -root | $c_awk 'BEGIN{IGNORECASE = 1};/KDE_SESSION_VERSION|^_MUFFIN/' )
|
||||
de=$( xprop -root )
|
||||
de=$( $c_awk '/KDE_SESSION_VERSION|^_MUFFIN/' <<< ${de^^} ) # critère en majuscule
|
||||
fi
|
||||
# Format strings
|
||||
if [[ "${de,,}" =~ kde ]]; then # test sur minuscules
|
||||
|
@ -3158,10 +3156,11 @@ figet_de(){ #v 26/01/2018 # thanks neofetch
|
|||
fg_de=${fg_de^} # caractère 1 en majuscule
|
||||
###
|
||||
# panel
|
||||
fg_de_panel=$( $c_awk ' BEGIN { IGNORECASE=1 }
|
||||
ps=$( ps -A )
|
||||
fg_de_panel=$( $c_awk '
|
||||
#inclus lxpanel, mate-panel, gnome-panel, xfceX-panel
|
||||
/(gnome-shell|kicker|plasma-desktop|plasma-netbook|lxpanel|panel)$/ { print $NF; exit }
|
||||
' <<< $( ps -A ) )
|
||||
' <<< ${ps,,} )
|
||||
|
||||
}
|
||||
|
||||
|
@ -4399,7 +4398,8 @@ for j in $options; do # deuxième passe options, actions
|
|||
# fi_efi fi_locale fi_conf fi_vrms fi_packagers
|
||||
# fi_reseau fi_nm
|
||||
# fi_system_analyse fi_log_xorg fi_journal
|
||||
fi_cpu
|
||||
fi_touchpad # à fixer sur x230
|
||||
# fi_bluez # long
|
||||
echo; f_prnt_md "$file_output"
|
||||
;; # test
|
||||
-c* | all )
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
* mawk en cours de test
|
||||
|
||||
## getInfo 3.11.0 28/01/2018
|
||||
|
||||
* fix: fonctionnement avec mawk, fi_pkg_apt, figet_de, fi_cpu
|
||||
|
||||
## getInfo 3.10.0 27/01/2018
|
||||
|
||||
* révision: fi_pkg_apt, affichage awk , alerte erreur apt, affichage mineur
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue