mirror of https://framagit.org/kyodev/kyopages.git
getInfo 2.45.2
This commit is contained in:
parent
c298cf012b
commit
cade0177a2
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
version=2.45.1
|
version=2.45.2
|
||||||
date="25/11/2017"
|
date="25/11/2017"
|
||||||
projet="simpledeb"
|
projet="simpledeb"
|
||||||
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
|
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
|
||||||
|
@ -1964,16 +1964,25 @@ figet_batt(){ #v2 11/11/2017
|
||||||
|
|
||||||
# assigne $fg_cpu (3 lignes description cpu), fg_nb_threads, $fg_cpu_arch, $fg_uarch, $fg_vendor=AMD|Intel
|
# assigne $fg_cpu (3 lignes description cpu), fg_nb_threads, $fg_cpu_arch, $fg_uarch, $fg_vendor=AMD|Intel
|
||||||
figet_cpu(){ #v2 24/11/2017
|
figet_cpu(){ #v2 24/11/2017
|
||||||
local cpuinfo speedNom speedMax speedMin speedCpu cpu1 cpu2 cpu3
|
local cpuinfo speedNom speedMax speedMin speedCpu descrCpu cpu1 cpu2 cpu3
|
||||||
cpuinfo="$(cat /proc/cpuinfo)"
|
cpuinfo="$(cat /proc/cpuinfo)"
|
||||||
# speed
|
# speed
|
||||||
speedNom=$(gawk -F ':' '/cpu MHz/ {printf "%.2f", $2/1000;exit}' <<< "$cpuinfo")
|
speedNom=$(gawk -F ':' '/cpu MHz/ {printf "%.2f", $2/1000;exit}' <<< "$cpuinfo")
|
||||||
speedMax=$(gawk '{printf "%.2f", $1/1000000}' /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq 2>/dev/null)
|
speedMax=$(gawk '{printf "%.2f", $1/1000000}' /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq 2>/dev/null)
|
||||||
speedMin=$(gawk '{printf "%.2f", $1/1000000}' /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq 2>/dev/null)
|
speedMin=$(gawk '{printf "%.2f", $1/1000000}' /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq 2>/dev/null)
|
||||||
speedCpu=""
|
speedCpu=""
|
||||||
[ "$speedMin" ] && speedCpu+="$speedMin/"
|
if [ "$speedMin" ]; then
|
||||||
[ "$speedNom" ] && speedCpu+="$speedNom"
|
speedCpu+="$speedMin/"
|
||||||
[[ "$speedMax" && "$speedMax" != "$speedNom" ]] && speedCpu+="/$speedMax"
|
descrCpu+="fréq. min/"
|
||||||
|
fi
|
||||||
|
if [ "$speedNom" ]; then
|
||||||
|
speedCpu+="$speedNom"
|
||||||
|
descrCpu+="nom"
|
||||||
|
fi
|
||||||
|
if [[ "$speedMax" && "$speedMax" != "$speedNom" ]]; then
|
||||||
|
speedCpu+="/$speedMax"
|
||||||
|
descrCpu+="/max"
|
||||||
|
fi
|
||||||
[ "$speedCpu" ] && speedCpu=$(printf "%sGHz" $speedCpu)
|
[ "$speedCpu" ] && speedCpu=$(printf "%sGHz" $speedCpu)
|
||||||
[ "$speedCpu" ] || speedCpu=$(gawk -F '@' '/model name/ {sub(/^ | $/,"",$2); print $2;exit}' <<< "$cpuinfo")
|
[ "$speedCpu" ] || speedCpu=$(gawk -F '@' '/model name/ {sub(/^ | $/,"",$2); print $2;exit}' <<< "$cpuinfo")
|
||||||
# motifs?: Processor Dual-Core Quad-Core Six-Core Eight-Core Core 'with Radeon * Graphics'
|
# motifs?: Processor Dual-Core Quad-Core Six-Core Eight-Core Core 'with Radeon * Graphics'
|
||||||
|
@ -1991,13 +2000,13 @@ figet_cpu(){ #v2 24/11/2017
|
||||||
}' <<< "$cpuinfo "
|
}' <<< "$cpuinfo "
|
||||||
)
|
)
|
||||||
cpu2=$(
|
cpu2=$(
|
||||||
gawk -F ':' '
|
gawk -v "descrCpu=$descrCpu" -F ':' '
|
||||||
/^vendor_id/{gsub(/ /,"");gsub(/AuthenticAMD/,"AMD");gsub(/GenuineIntel/,"Intel");vendor=$2}
|
/^vendor_id/{gsub(/ /,"");gsub(/AuthenticAMD/,"AMD");gsub(/GenuineIntel/,"Intel");vendor=$2}
|
||||||
/^cpu family/{family=$2}
|
/^cpu family/{family=$2}
|
||||||
/^model[^ ]/{model=$2}; /^stepping/{rev=$2}
|
/^model[^ ]/{model=$2}; /^stepping/{rev=$2}
|
||||||
END {
|
END {
|
||||||
code=sprintf("{0x%.2X|0x%.2X}",family,model);
|
code=sprintf("{0x%.2X|0x%.2X}",family,model);
|
||||||
print "{fréq. mini/nominale[/maxi]} " vendor" famille" family", modèle"model,code", révision" rev
|
print "{" descrCpu "}, " vendor" famille" family", modèle"model,code", révision" rev
|
||||||
}' <<< "$cpuinfo"
|
}' <<< "$cpuinfo"
|
||||||
)
|
)
|
||||||
cpu3=$(
|
cpu3=$(
|
||||||
|
@ -2418,11 +2427,11 @@ figet_de(){ #v 25/11/2017 # thanks neofetch
|
||||||
[[ "$fg_de" =~ : ]] && return 0 # retourne n/a ...
|
[[ "$fg_de" =~ : ]] && return 0 # retourne n/a ...
|
||||||
##
|
##
|
||||||
de="$XDG_CURRENT_DESKTOP"
|
de="$XDG_CURRENT_DESKTOP"
|
||||||
de=${de/X-} # supression de X-
|
de=${de/X-} # supression de X- (X-Cinnamon)
|
||||||
de=${de/Budgie:GNOME/Budgie} # remplacement Budgie:GNOME par Budgie
|
|
||||||
if [ -z "$de" ]; then
|
if [ -z "$de" ]; then
|
||||||
de="$DESKTOP_SESSION"
|
de="$DESKTOP_SESSION"
|
||||||
de=${DESKTOP_SESSION##*/} # suppression plus grande chaine au début jusqu'à /
|
de=${DESKTOP_SESSION##*/} # suppression plus grande chaine au début jusqu'à /
|
||||||
|
de=${DESKTOP_SESSION##*=} # suppression plus grande chaine au début jusqu'à =
|
||||||
fi
|
fi
|
||||||
# fallback to using xprop
|
# fallback to using xprop
|
||||||
if [[ "$wayland" && "$EUID" -eq 0 && -z "$de" ]]; then
|
if [[ "$wayland" && "$EUID" -eq 0 && -z "$de" ]]; then
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* ! f__requis (debOnly), fscript_install, f__scandir
|
* ! f__requis (debOnly), fscript_install, f__scandir
|
||||||
|
|
||||||
|
|
||||||
## 2.45.1 25/11/2017
|
## 2.45.2 25/11/2017
|
||||||
|
|
||||||
* nouveau: gestion no $DISPLAY
|
* nouveau: gestion no $DISPLAY
|
||||||
* révision: version bash en test et affichage
|
* révision: version bash en test et affichage
|
||||||
|
@ -12,6 +12,7 @@
|
||||||
* révision: général, LC_ALL=C oubliés
|
* révision: général, LC_ALL=C oubliés
|
||||||
* révision: figet_wm, fi_graph
|
* révision: figet_wm, fi_graph
|
||||||
* révision: fi_disk, affichage hddtemp
|
* révision: fi_disk, affichage hddtemp
|
||||||
|
* révision: figet_cpu, affichage unités freq selon le nombre détecté
|
||||||
* fix: fi_systeme, openSuse uptime
|
* fix: fi_systeme, openSuse uptime
|
||||||
* fix: figet_de, cinnamon
|
* fix: figet_de, cinnamon
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue