mirror of https://framagit.org/kyodev/kyopages.git
getInfo 2.14.0
This commit is contained in:
parent
23b140b5da
commit
ffd7197150
176
scripts/getInfo
176
scripts/getInfo
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=2.13.1
|
||||
version=2.14.0
|
||||
date="22/10/2017"
|
||||
projet="simpledeb"
|
||||
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
|
||||
|
@ -456,7 +456,7 @@ fi_disk(){ # 22/10/2017
|
|||
text+="**types de disque** \n\n"
|
||||
text+="| ata | usb | mmc | nvme | \n"
|
||||
text+="| :---: | :---: | :---: | :---: | \n"
|
||||
text+="| $fget_disk_ata | $fget_disk_usb | $fget_disk_mmc | $fget_disk_nvme | \n\n"
|
||||
text+="| $fget_disk_sata | $fget_disk_usb | $fget_disk_mmc | $fget_disk_nvme | \n\n"
|
||||
# éventuellement hddtemp
|
||||
[ "$dd_temp" ] && f_display "dd_temp" "cmd" "hddtemp /dev/sd?" "(température disques)"
|
||||
if [ "$dd_temp_alert" ]; then
|
||||
|
@ -532,7 +532,7 @@ fi_graph(){ # 22/10/2017
|
|||
unset ig
|
||||
graphCards=${graphCards::-1} # suppression dernier $'\n'
|
||||
[ "$(f__cmd_exist glxinfo)" ] && openGl="$(glxinfo | grep 'OpenGL version')"
|
||||
resolutions="$(xrandr --query | grep '^ *[0-9]' | head -n 10)"
|
||||
[ "$(f__cmd_exist xrandr)" ] && resolutions="$(xrandr --query | grep '^ *[0-9]' | head -n 10)"
|
||||
modules="$(lsmod | grep -iE 'amdgpu|ati|i915|nouveau|nvidia|radeon|video|gma')"
|
||||
[ "$fget_resolution" ] || figet_gpu
|
||||
[ "$fget_resolution" ] || figet_resolution
|
||||
|
@ -543,19 +543,27 @@ fi_graph(){ # 22/10/2017
|
|||
text+="| GPU | **$fget_gpu** | \n\n"
|
||||
text+="**résolution: $fget_resolution** \n\n"
|
||||
f_display "graphCards" "cmd" "lspci -nnv | grep -iEA 13 'vga|display|3d"
|
||||
if [ "$openGl" ]; then
|
||||
f_display "openGl" "cmd" "xrandr --query | grep '^ *[0-9]' | head -n 10" "(10 premières résolutions possibles)"
|
||||
[ "$openGl" ] && f_display "openGl" "cmd" "glxinfo | grep 'OpenGL version"
|
||||
if [ "$resolutions" ]; then
|
||||
f_display "resolutions" "cmd" "xrandr --query | grep '^ *[0-9]' | head -n 10" "(10 premières résolutions possibles)"
|
||||
fi
|
||||
f_display "resolutions" "cmd" "glxinfo | grep 'OpenGL version"
|
||||
text+="### modules video \n\n"
|
||||
text+="liste non garantie complète \n"
|
||||
f_display "modules" "sans"
|
||||
if [ "$modules" ]; then
|
||||
f_display "modules" "var" "liste non garantie complète"
|
||||
else
|
||||
text+="Modules non reconnus. Il serait bien de communiquer le retour de \`lsmod\` pour mettre "
|
||||
text+="à jour le script. Merci de contacter $projet: \n$contact "
|
||||
fi
|
||||
echo -e "$text" >> "$fileOutput" # flush fonction
|
||||
}
|
||||
|
||||
fi_hw(){ # 21/10/2017
|
||||
fi_hw(){ # 22/10/2017
|
||||
figet_hw
|
||||
text="## hardware monitor ACPI \n\n"
|
||||
f_display "fget_hw" "sans"
|
||||
###
|
||||
if [ "$fget_hw" ]; then
|
||||
text="## hardware monitor ACPI \n\n"
|
||||
f_display "fget_hw" "sans"
|
||||
fi
|
||||
}
|
||||
|
||||
fi_journal(){ # 22/10/2017
|
||||
|
@ -604,19 +612,19 @@ fi_journal(){ # 22/10/2017
|
|||
# non kernel
|
||||
text+="## journalctl hors kernel (emergency, alert, erreur, warning ou critique) \n\n"
|
||||
f_display "jctl_alert_nok" "cmd" "journalctl --no-hostname --boot 0 -p 1 | grep -v kernel:" \
|
||||
"(hors kernel emergency 0 & alerte 1, $nb_lignes premières lignes)"
|
||||
"(hors kernel, emergency 0 & alerte 1, $nb_lignes premières lignes)"
|
||||
f_display "jctl_crit_nok" "cmd" "journalctl --no-hostname --boot 0 -p 2..2 | grep -v kernel:" \
|
||||
"(hors kernel critique, $nb_lignes premières lignes)"
|
||||
"(hors kernel, critique, $nb_lignes premières lignes)"
|
||||
f_display "jctl_err_nok" "cmd" "journalctl --no-hostname --boot 0 -p 3..3 | grep -v kernel:" \
|
||||
"(hors kernel erreur, $nb_lignes premières lignes)"
|
||||
"(hors kernel, erreur, $nb_lignes premières lignes)"
|
||||
f_display "jctl_warn_nok" "cmd" "journalctl --no-hostname --boot 0 -p 4..4 | grep -v kernel:" \
|
||||
"(hors kernel warning, $nb_lignes premières lignes)"
|
||||
"(hors kernel, warning, $nb_lignes premières lignes)"
|
||||
text+="**les $nb_lignes premières lignes commencent à la date du dernier boot** \n\n"
|
||||
echo -e "$text" >> "$fileOutput"
|
||||
}
|
||||
|
||||
fi_locale(){ # 22/10/2017
|
||||
local locale timezone keymap keyboard timedatectl alert_Rtc alert_Rtc_info alert_NTP alert_Ntp_info text
|
||||
local locale timezone xKeyboardMap keyboard timedatectl alert_Rtc alert_Rtc_info alert_NTP alert_Ntp_info text
|
||||
locale="$(grep -Ev '#|^$' /etc/default/locale)"
|
||||
timezone="$(< /etc/timezone)"
|
||||
if [ "$(f__cmd_exist timedatectl)" ]; then
|
||||
|
@ -630,38 +638,21 @@ d’été/hiver peuvent être incohérentes quand l’horloge matérielle est en
|
|||
activer le service: timedatectl set-ntp true
|
||||
et/ou installer le démon Ntp: apt install ntp \n"
|
||||
fi
|
||||
keymap="$(setxkbmap -query)"
|
||||
[ "$(f__cmd_exist setxkbmap)" ] && xKeyboardMap="$(setxkbmap -query)"
|
||||
keyboard="$(grep -Ev '#|^$' /etc/default/keyboard)"
|
||||
###
|
||||
text="## localisation \n\n"
|
||||
text+='`'"grep -Ev '#|^$' /etc/default/locale"'` \n'
|
||||
text+='```\n'
|
||||
text+="$locale \n"
|
||||
text+='```\n\n'
|
||||
text+='`'"cat /etc/timezone"'` \n'
|
||||
text+='```\n'
|
||||
text+="$timezone \n"
|
||||
text+='```\n'
|
||||
if [ "$timedatectl" ]; then
|
||||
text+='\n`'"timedatectl status --no-pager"'` \n'
|
||||
text+='```\n'
|
||||
text+="$timedatectl \n"
|
||||
text+='```\n'
|
||||
fi
|
||||
[ "$alert_Rtc" ] && text+="$alert_Rtc_info \n"
|
||||
[ "$alert_Ntp" ] && text+="$alert_Ntp_info \n"
|
||||
text+='\n`'"setxkbmap -query"'` \n'
|
||||
text+='```\n'
|
||||
text+="$keymap \n"
|
||||
text+='```\n\n'
|
||||
text+='`'"grep -Ev '#|^$' /etc/default/keyboard"'` \n'
|
||||
text+='```\n'
|
||||
text+="$keyboard \n"
|
||||
text+='```\n\n'
|
||||
echo -e "$text" >> "$fileOutput"
|
||||
text="## localisation \n\n"
|
||||
f_display "locale" "cmd" "grep -Ev '#|^$' /etc/default/locale"
|
||||
f_display "timezone" "cmd" "cat /etc/timezone"
|
||||
[ "$timedatectl" ] && f_display "timedatectl" "cmd" "timedatectl status --no-pager"
|
||||
[ "$alert_Rtc" ] && text+="$alert_Rtc_info \n"
|
||||
[ "$alert_Ntp" ] && text+="$alert_Ntp_info \n"
|
||||
[ "$xKeyboardMap" ] && f_display "xKeyboardMap" "cmd" "setxkbmap -query"
|
||||
f_display "keyboard" "cmd" "grep -Ev '#|^$' /etc/default/keyboard"
|
||||
}
|
||||
|
||||
fi_log_xorg(){ # 21/10/2017
|
||||
fi_log_xorg(){ # 22/10/2017
|
||||
[ "$ENV_SSH" ] && return 0
|
||||
local logXorg xfile extract text nb_lignes=50
|
||||
# Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice,
|
||||
# (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown (WW) warning, (EE) erreur
|
||||
|
@ -709,7 +700,7 @@ fi_nm(){ # 22/10/2017
|
|||
nm_etat="$(grep -Ev '#|^$' /var/lib/NetworkManager/NetworkManager.state)"
|
||||
nm_conf="$(grep -Ev '#|^$' /etc/NetworkManager/NetworkManager.conf)"
|
||||
###
|
||||
text="## Network Manager \n\n"
|
||||
text="## NetworkManager \n\n"
|
||||
f_display "nm_etat" "cmd" "grep -Ev '#|^$' /var/lib/NetworkManager/NetworkManager.state"
|
||||
f_display "nm_conf" "cmd" "grep -Ev '#|^$' /etc/NetworkManager/NetworkManager.conf"
|
||||
}
|
||||
|
@ -720,6 +711,7 @@ fi_nm_wifis(){ # 22/10/2017
|
|||
nm_wifis="$(nmcli -f SSID,BSSID,MODE,CHAN,FREQ,RATE,SIGNAL,BARS,SECURITY device wifi list)"
|
||||
nm_connected="$(LC_ALL=C nmcli -f SSID,ACTIVE,IN-USE device wifi list | gawk '/yes[[:space:]]+\*/ {print $1}')"
|
||||
###
|
||||
[ "$nm_wifis" ] || return 0
|
||||
text="## wifis à proximité \n\n"
|
||||
f_display "nm_wifis" "cmd" "nmcli -f SSID,BSSID,MODE,CHAN,FREQ,RATE,SIGNAL,BARS,SECURITY device wifi list"
|
||||
}
|
||||
|
@ -741,14 +733,14 @@ fi_nonFree(){ # 22/09/2017
|
|||
}
|
||||
|
||||
fi_reseau(){ # 22/10/2017
|
||||
local slotNetCards netCards ip_a iwconfig interfaces route resolv liste_canaux_wifi ifx text pluriel
|
||||
# netCards="$(lspci -nnk | grep -iEA 5 'network|ethernet')"
|
||||
# netCards="$(lspci -nnv | grep -iEA 15 'network|ethernet')"
|
||||
slotNetCards="$(lspci | grep -iE 'network|ethernet' | sed -En 's/^([0-9.:]+).*$/\1/gp')"
|
||||
for ifx in $slotNetCards; do
|
||||
netCards+="$(lspci -s $ifx -nnv)"$'\n'
|
||||
local slotNetCard netCard ip_a iwconfig interfaces route resolv liste_canaux_wifi ifx text pluriel
|
||||
# netCard="$(lspci -nnk | grep -iEA 5 'network|ethernet')"
|
||||
# netCard="$(lspci -nnv | grep -iEA 15 'network|ethernet')"
|
||||
slotNetCard="$(lspci | grep -iE 'network|ethernet' | sed -En 's/^([0-9.:]+).*$/\1/gp')"
|
||||
for ifx in $slotNetCard; do
|
||||
netCard+="$(lspci -s $ifx -nnv)"$'\n'
|
||||
done
|
||||
netCards=${netCards::-1} # suppression dernier $'\n'
|
||||
netCard=${netCard::-1} # suppression dernier $'\n'
|
||||
ip_a="$(ip a | sed '/link\/ether/d; /valid_lft/d')" # filtre sur adr MAC & bail
|
||||
# ip_a="$(sed '/inet6.*scope global/d; /inet6.*scope link/d' <<< $ip_a)" # filtre sur inet6 scope global & scope link (fe80::)
|
||||
ip_a="$(sed '/inet6.*/d' <<< $ip_a)" # filtre sur inet6)
|
||||
|
@ -756,7 +748,7 @@ fi_reseau(){ # 22/10/2017
|
|||
interfaces="$(grep -Evrs '#|^$' /etc/network/interfaces*)"
|
||||
interfaces="$(sed -E 's/wpa-psk [[:graph:]]+/wpa-psk <WPA key removed>/; s/:/: /' <<< $interfaces )"
|
||||
resolv="$(grep -Ev '#|^$' /etc/resolv.conf)"
|
||||
if [ "$(f__cmd_exist iwlist)" ]; then #paquet wireless-tools requis
|
||||
if [ "$(f__cmd_exist iwconfig)" ]; then #paquet wireless-tools requis
|
||||
iwconfig="$(iwconfig 2>&1 | grep -v 'no wireless extensions' | grep -v '^$')"
|
||||
fi
|
||||
if [ "$(f__cmd_exist iwlist)" ]; then # liste canaux wifi; paquet wireless-tools requis
|
||||
|
@ -774,7 +766,7 @@ fi_reseau(){ # 22/10/2017
|
|||
figet_mod_net
|
||||
###
|
||||
text="## réseau \n\n"
|
||||
f_display "netCards" "cmd" "lspci -nnv | grep -iEA 15 'network|ethernet"
|
||||
f_display "netCard" "cmd" "lspci -nnv | grep -iEA 15 'network|ethernet"
|
||||
f_display "ip_local_type" "var" "IP locale(s):"
|
||||
text+="* les adresses Mac peut être affichées avec "'`./getInfo --mac` ou `getInfo --mac`'" (script installé) \n"
|
||||
text+="* l'IP publique peut être connue avec: "'`./getInfo --ip` ou `getInfo --ip` (script installé) \n\n'
|
||||
|
@ -813,7 +805,13 @@ fi_reseau(){ # 22/10/2017
|
|||
[ "$netmgrrun" ] && text+="**$netmgrrun** \n\n" || text+="aucun \n\n"
|
||||
fi
|
||||
text+="### modules réseau \n\n"
|
||||
f_display "fget_mod_net" "var" "liste non garantie complète"
|
||||
if [ "$fget_mod_net" ]; then
|
||||
f_display "fget_mod_net" "var" "liste non garantie complète"
|
||||
else
|
||||
text+="Modules non reconnus. Il serait bien de communiquer le retour de \`lsmod\` pour mettre "
|
||||
text+="à jour le script. Merci de contacter $projet: \n$contact "
|
||||
fi
|
||||
echo -e "$text" >> "$fileOutput" # flush fonction
|
||||
}
|
||||
|
||||
fi_sources(){ # 22/10/2017
|
||||
|
@ -888,7 +886,7 @@ fi_sources(){ # 22/10/2017
|
|||
}
|
||||
|
||||
fi_ssid(){ # 22/10/2017
|
||||
[ "$(f__cmd_exist nmcli)" ] || f__error "il manque NetworkManager"
|
||||
[ "$(f__cmd_exist nmcli)" ] || f__error "NetworkManager requis"
|
||||
local nm_ssid file="/tmp/$$-$RANDOM-fi_ssid" text
|
||||
# nm_ssid="$(grep -Ev '#|^$' /etc/NetworkManager/system-connections/*)"
|
||||
[ "$EUID" -eq 0 ] || echo
|
||||
|
@ -930,7 +928,7 @@ fi_systeme(){ # 22/10/2017
|
|||
bootImage="$(gawk '/BOOT_IMAGE/ {print $1}' /proc/cmdline)"
|
||||
bootImage="$(gawk '{print $1}{i=2; while (i <= NF-1) { print " ",$i; i++}}' /proc/cmdline)"
|
||||
initDaemon="$(ps -p1 | gawk 'FNR==2 {print $4}')" #? ps -ax | gawk '$1==1' ou ps -p1 | gawk '$1==1'
|
||||
xorg="$XDG_SESSION_TYPE"
|
||||
[ "$ENV_SSH" ] && xorg="n/a (ssh)" || xorg="$XDG_SESSION_TYPE"
|
||||
if [ -z "$xorg" ]; then
|
||||
[ "$(ps -ef | grep -c 'wayland')" -gt 1 ] && xorg="wayland" || xorg="indéterminé"
|
||||
fi
|
||||
|
@ -966,8 +964,8 @@ fi_systeme(){ # 22/10/2017
|
|||
text+="uname: $uname \n"
|
||||
text+="$bootImage \n"
|
||||
text+="démon d'initialisation: $initDaemon \n"
|
||||
text+="résolution: $fget_resolution \n"
|
||||
text+="serveur d'affichage: $xorg \n"
|
||||
text+="résolution: $fget_resolution \n"
|
||||
text+="desktop (DE): $fget_de \n"
|
||||
text+="window manager: $fget_wm \n"
|
||||
text+="shell actif: $fget_shell \n"
|
||||
|
@ -996,7 +994,7 @@ fi_usb(){ # 22/10/2017
|
|||
|
||||
# informations batterie(s), assigne $fget_batt_nb $fget_batt
|
||||
figet_batt(){ #v2 22/10/2017
|
||||
local batt_detail batt_nb batt_alim batt_unit batt_capa_design batt_capa_full batt_capa_now batt_conso
|
||||
local batt_detail batt_nb batt_unit batt_capa_design batt_capa_full batt_capa_now batt_conso
|
||||
local batt_volt_min batt_volt_now batt_status batt_cycle batt_sn alert_batt_alarm
|
||||
local batt_sante batt_restant tempo batRep ibat uevent
|
||||
if [ ! -d /sys/class/power_supply ]; then # anciennes interfaces ou inconnu
|
||||
|
@ -1006,9 +1004,9 @@ figet_batt(){ #v2 22/10/2017
|
|||
batt_nb="-1"
|
||||
return 1
|
||||
fi
|
||||
[ -d /sys/class/power_supply/BAT* ] || return 0
|
||||
batt_nb="$(grep -i 'Battery' /sys/class/power_supply/*/type | grep -c .)"
|
||||
[ -z "$batt_nb" ] && return
|
||||
batt_alim="$(grep '1' /sys/class/power_supply/AC*/online | grep -c .)" # plusieurs alims? -ge1
|
||||
batRep="/sys/class/power_supply"
|
||||
unset batt_detail
|
||||
for ibat in $(ls $batRep); do
|
||||
|
@ -1042,7 +1040,7 @@ figet_batt(){ #v2 22/10/2017
|
|||
batt_sante="$(gawk '$1 != "na" && $2 != "" && $2 != "0" {printf "%.1f", $1/$2*100}' <<< "$batt_capa_full $batt_capa_design")"
|
||||
if [[ "$batt_status" == "Full" || "$batt_status" == "Unknown" ]]; then
|
||||
batt_restant="totalement chargée"
|
||||
elif [ "$batt_status" == "Discharging" ]; then # alt: [ "$batt_alim" == "0" ]
|
||||
elif [ "$batt_status" == "Discharging" ]; then
|
||||
batt_restant="en décharge, reste approximativement: "
|
||||
tempo="$(gawk '$1+$2 != "" && $2!="0 "{print $1*0.9/$2}' <<< "$batt_capa_now $batt_conso")"
|
||||
elif [ "$batt_status" == "Charging" ]; then
|
||||
|
@ -1106,7 +1104,7 @@ figet_cpu(){ #v2 22/10/2017
|
|||
/cpu cores/ { procCore=sprintf("%d",$2); if (procCore>1) pllc="s" }
|
||||
/siblings/ { procThread=sprintf("%d",$2); if (procThread>1) pllt="s" }
|
||||
/microcode/ { sub(/^ /,"",$2); microCode=$2 }
|
||||
END { print nbCpu" x "cpu " (" procCore "c," procThread "t) {" speedCpu "} microcode:" microCode }
|
||||
END { print nbCpu" x "cpu " (" procCore "core" pllc "," procThread "thread" pllt ") {" speedCpu "} microcode:" microCode }
|
||||
' <<< "$cpuinfo "
|
||||
)
|
||||
cpu2=$(
|
||||
|
@ -1128,7 +1126,11 @@ figet_cpu(){ #v2 22/10/2017
|
|||
fget_cpu=$(echo -e "$cpu1\n$cpu2\n$cpu3")
|
||||
}
|
||||
|
||||
figet_de(){ # thanks neofetch, assigne $fget_de #14/10/2017
|
||||
figet_de(){ # thanks neofetch, assigne $fget_de #22/10/2017
|
||||
if [ "$ENV_SSH" ]; then
|
||||
fget_de="n/a (ssh)"
|
||||
return 0
|
||||
fi
|
||||
# local de="${XDG_CURRENT_DESKTOP/i3}" #supprime i3??...
|
||||
local de="$XDG_CURRENT_DESKTOP"
|
||||
de="${de/'X-'}"
|
||||
|
@ -1240,12 +1242,12 @@ figet_distro(){ # thanks neofetch, assigne $fget_distro # 09/10/2017
|
|||
# for debian, add version
|
||||
grep -qi 'Debian' /etc/issue && distro="$(sed 's/"//g' <<< $distro) $(< /etc/debian_version)"
|
||||
fi
|
||||
[[ -z "$distro" ]] && distro="$os (Unknown)"
|
||||
[[ -z "$distro" ]] && distro="$os (non déterminée)"
|
||||
fget_distro="$distro"
|
||||
}
|
||||
|
||||
# informations DMI, assigne $fget_dmi
|
||||
figet_dmi(){ # 12/10/2017
|
||||
figet_dmi(){ # 22/10/2017
|
||||
local product board bios tempo idmi indic1 indic2
|
||||
unset indic1 indic2
|
||||
for idmi in sys_vendor product_name product_version chassis_type; do
|
||||
|
@ -1268,6 +1270,9 @@ figet_dmi(){ # 12/10/2017
|
|||
tempo=$(sed 's/x.xx*//' <<< $tempo | xargs)
|
||||
bios+="$tempo "
|
||||
done
|
||||
product=$(sed 's/To be filled by O\.E\.M\.//g' <<< $product)
|
||||
board=$(sed 's/To be filled by O\.E\.M\.//g' <<< $board)
|
||||
bios=$(sed 's/To be filled by O\.E\.M\.//g' <<< $bios)
|
||||
fget_dmi=$(printf '%7s: %s' "produit" "$product")$' \n'
|
||||
[ "$indic1" != "$indic2" ] && fget_dmi+=$(printf '%7s: %s' "board" "$board")$' \n'
|
||||
fget_dmi+=$(printf '%7s: %s' "bios" "$bios")
|
||||
|
@ -1303,8 +1308,8 @@ figet_gpu(){ # thanks neofetch, assigne $fget_gpu # 09/10/2017
|
|||
fget_gpu="$gpu"
|
||||
}
|
||||
|
||||
# assigne $fget_hw
|
||||
figet_hw(){ #v2 20/10/2017
|
||||
# infos température et fan via acpi, assigne $fget_hw
|
||||
figet_hw(){ #v2 22/10/2017
|
||||
local name labelF inputF labelT inputT critT hystT maxiT fan temp ihw
|
||||
if [ ! -d /sys/class/hwmon/ ]; then
|
||||
fget_hw="gestion acpi hwmon non accessible"
|
||||
|
@ -1338,26 +1343,31 @@ figet_hw(){ #v2 20/10/2017
|
|||
[ "$hystT" ] && hystT=${hystT::-1}
|
||||
[ "$maxiT" ] && maxiT=${maxiT::-1}
|
||||
# formation affichage
|
||||
temp+="$(printf "%-8s %s°C %s " "$name" "$inputT" "$labelT")"
|
||||
[ "$critT" ] && temp+="(crit: $critT""°C) "
|
||||
[ "$hystT" ] && temp+="(hyst: $hystT""°C) "
|
||||
[ "$maxiT" ] && temp+="(maxi: $maxiT""°C) "
|
||||
[ "$temp" ] && temp+=$' \n'
|
||||
if [ "$inputT" ]; then
|
||||
temp+="$(printf "%-8s %s°C %s " "$name" "$inputT" "$labelT")"
|
||||
[ "$critT" ] && temp+="(crit: $critT""°C) "
|
||||
[ "$hystT" ] && temp+="(hyst: $hystT""°C) "
|
||||
[ "$maxiT" ] && temp+="(maxi: $maxiT""°C) "
|
||||
[ "$temp" ] && temp+=$' \n'
|
||||
fi
|
||||
fi
|
||||
## FAN
|
||||
if grep -Eq 'fan[0-9]+' <<< $(ls /sys/class/hwmon/$ihw/) ; then
|
||||
# extraction label
|
||||
labelF=$(printf "%s/" $(cat /sys/class/hwmon/$ihw/fan*_label 2>/dev/null))
|
||||
# extraction vitesse fan
|
||||
inputF=$(printf "%'d/" $(cat /sys/class/hwmon/$ihw/fan*_input 2>/dev/null))
|
||||
# extraction vitesse fan, \047=' pour insérer séparateur de milliers
|
||||
inputF=$(gawk '$0!="" && $0!=0 {printf "%\047d/", $1}' <<< $(cat /sys/class/hwmon/$ihw/fan*_input 2>/dev/null))
|
||||
# suppression dernier caractère (/) fin (nécessaire si multi-valeurs)
|
||||
[ "$labelF" ] && labelF=${labelF::-1}
|
||||
[ "$inputF" ] && inputF=${inputF::-1}
|
||||
# formation affichage
|
||||
fan+="$(printf "%-8s %st/mn %s" "$name" "$inputF" "$labelF")"
|
||||
if [ "$inputF" ]; then
|
||||
fan+="$(printf "%-8s %st/mn %s" "$name" "$inputF" "$labelF")"$' \n'
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fget_hw="$temp$fan"
|
||||
fget_hw=${fget_hw::-1}
|
||||
}
|
||||
|
||||
# assigne $ip_local, $gateways, $gateways_type, $gateway, $gateway_type, $if_prioritaire
|
||||
|
@ -1549,7 +1559,11 @@ figet_mod_net(){ # thanks wireless-info, assigne $fget_mod_net # 01/10/2017
|
|||
fget_mod_net="$(lsmod | grep -E "(^|[[:punct:] ])($MODMATCHES|$LSMODMATCHES)[^[:punct:] ]*([[:punct:] ]|$)")"
|
||||
}
|
||||
|
||||
figet_resolution(){ # thanks neofetch, assigne $fget_resolution # 09/10/2017
|
||||
figet_resolution(){ # thanks neofetch, assigne $fget_resolution # 22/10/2017
|
||||
if [ "$ENV_SSH" ]; then
|
||||
fget_resolution="n/a (ssh)"
|
||||
return 0
|
||||
fi
|
||||
local resolution
|
||||
if type -p xrandr >/dev/null; then
|
||||
resolution="$(xrandr --nograb --current | gawk 'match($0,/[0-9]*\.[0-9]*\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}')"
|
||||
|
@ -1595,6 +1609,7 @@ figet_test_batt(){ # 22/10/2017
|
|||
# acpi éventuel
|
||||
if [ "$(f__cmd_exist acpi)" ]; then
|
||||
var_temp=$(acpi -abi)
|
||||
[ "$var_temp" ] || var_temp="pas de batterie dans $(f__cmd_exist acpi)"
|
||||
f_display "var_temp" "cmd" "acpi -abi"
|
||||
fi
|
||||
# /sys/class/power_supply/
|
||||
|
@ -1656,7 +1671,11 @@ figet_test_hw(){ # 22/10/2017
|
|||
f_display "fget_hw" "var" "figet_hw"
|
||||
}
|
||||
|
||||
figet_wm(){ # thanks neofetch, assigne $fget_wm # 09/10/2017
|
||||
figet_wm(){ # thanks neofetch, assigne $fget_wm # 22/10/2017
|
||||
if [ "$ENV_SSH" ]; then
|
||||
fget_wm="n/a (ssh)"
|
||||
return 0
|
||||
fi
|
||||
local id wm
|
||||
if [ -n "$DISPLAY" ]; then
|
||||
id="$(xprop -root -notype | gawk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}')"
|
||||
|
@ -1928,6 +1947,7 @@ prg_alert_crit(){ # 11/10/2017
|
|||
# initialisation
|
||||
PATH='/usr/sbin:/usr/bin:/sbin:/bin'; TERM=xterm ; IFS=$' \t\n'
|
||||
export PATH TERM IFS
|
||||
[[ "$SSH_CLIENT" || "$SSH_CLIENT" || "$SSH_CLIENT" ]] && ENV_SSH="ssh"
|
||||
|
||||
f__affichage
|
||||
|
||||
|
@ -1985,7 +2005,7 @@ for j in $options; do
|
|||
case $j in
|
||||
-t | --test )
|
||||
prg_1 "$*"
|
||||
fi_nonFree
|
||||
fi_hw
|
||||
prg_3
|
||||
exit ;; # test seulement
|
||||
-c* | all )
|
||||
|
|
|
@ -6,19 +6,30 @@
|
|||
* placer ln dans /usr/local/bin au lieu de /usr/bin ?
|
||||
* réseau réviser, interface name: virbr0
|
||||
* "alertifier" fi-reseau
|
||||
* désactiver wifi si pas de carte réseau
|
||||
* bug fedora: journaux xorg
|
||||
* bug fedora: identification distrib
|
||||
* bug fedora: localisation
|
||||
* bug: acpi, power_supply si vieille tour
|
||||
* bug ssh: setxkbmap : commande introuvable, Can't open display??
|
||||
* bug à confirmer? tableau gpu
|
||||
* refaire/revoir figet_resolution
|
||||
* bug tableau gpu si 2 cartes graphiques
|
||||
* revoir modules réseau
|
||||
|
||||
---
|
||||
|
||||
* f__requis f__wget_test fscript_get_version fscript_update fscript_cronAnacron
|
||||
* f__cmd_exist f__sudo f__requis
|
||||
|
||||
## 2.14.0 22/10/2017
|
||||
|
||||
* nouveau: détection connexion shh
|
||||
* révision: figet_dmi, suppression To be filled by O.E.M.
|
||||
* révision: fi_nm_wifis by-pass wifis à proximité si pas d'interfaces réseau active
|
||||
* révision: figet_hw, filtrage ligne complète si valeur vide, fan ou température
|
||||
* fix ssh, fedora: fi_locale, test si présence xkbmap
|
||||
* fix ssh, fedora: fi_graph, test si présence xrandr
|
||||
* fix ssh: pas de journal xorg si ssh
|
||||
* fix ssh: fi_systeme, figet_resolution, figet_de, figet_wm
|
||||
* fix: affichage résolution/opengl
|
||||
* fix: figet_batt, return meilleur si pas de batterie
|
||||
* fix: fi_hw, by-pass si pas d'info acpi
|
||||
* fix: fi_reseau, fi_graph, avertissement modules vide
|
||||
|
||||
## 2.13.1 22/10/2017
|
||||
|
||||
* nouveau: f__cmd_exist, émule et remplace which
|
||||
|
|
Loading…
Reference in New Issue