Postez ici vos trucs & astuces.
Erwan Modérateur Signature : Signature
#1 Message il y a 5 ans Bonjour,
Une petite commande qui permet de surveiller la vitesse du processeur en temps réel :
watch grep \"cpu MHz\" /proc/cpuinfo
Inutile, donc forcément indispensable.
Trouvé ici Manjaro-Xfce-Compiz 64
Desktop
CPU amd-phenom-64(pci=nomsi dans grub)
CG nvidia GeForce GT 730
Ram : 4 Go
kernel : 54 branche : stable, driver GPU : Nvidia-non-libre"Nvidia fuck you" Linus Torvalds qtox : erwan@toxme.io
lemust83 Administrateur Signature : Signature
#3 Message il y a 5 ans salut et merci pour l'info
bon sous plasma, j'ai une applet sur mon bureau pour la vitesse et charge, un petit graphique est toujours plus sympa (on en trouve quelques avec conky)
on peut aussi l'écrire
watch -tx awk -F':' '/cpu MHz/ {print $2}' /proc/cpuinfo
# ou si l'on ne sait pas compter sur ces doigts
watch -tx awk -F':' 'BEGIN{i=1} /cpu MHz/ {print "cpu "i":" $2;i++}' /proc/cpuinfo
Manjaro STABLE - Linux lts - fish - Kde5 - icore N100 - 16Go RAM - ssd - efi
#mount /dev/archlinux /mnt/manjaro
Erwan Modérateur Signature : Signature
#4 Message il y a 5 ans
watch -tx awk -F':' 'BEGIN{i=1} /cpu MHz/ {print "cpu "i":" $2;i++}' /proc/cpuinfo
Celui-là est fait pour moi.
Ce qui est dommage dans ces retours de commande ? Pas très sexy, manque de la couleur, vert pour le cœur au repos et rouge pour celui qui bosse. Manjaro-Xfce-Compiz 64
Desktop
CPU amd-phenom-64(pci=nomsi dans grub)
CG nvidia GeForce GT 730
Ram : 4 Go
kernel : 54 branche : stable, driver GPU : Nvidia-non-libre"Nvidia fuck you" Linus Torvalds qtox : erwan@toxme.io
#5 Message il y a 5 ans puisque je suis dans awk (...), un script awk adaptable
#!/usr/bin/awk -f
BEGIN{
FS="\n"
RS="\n\n"
color="\033[0m"
}
{
for(i=1; i<=NF; i++){
split($i,cpu,":")
if (i==1) printf "cpu%s" cpu[2],""
if ( cpu[1] ~ /MHz/ ) {
if (( cpu[2] < 1300 )) color="\033[34m" # bleu
if (( cpu[2] > 1500 )) color="\033[31m" # rouge
print color, cpu[2], " MHz" , "\033[0m"
}
}
}
reste à l'appeler : ./mycpu /proc/cpuinfo
------------------
------------------
Et la version bash beaucoup + simple:
#!/usr/bin/env bash
color="\033[0m"
while IFS=':' read -ra array; do
if [[ "${array[0]}" =~ ^processor ]]; then
printf "cpu %s" ${array[1]}
fi
if [[ "${array[0]}" =~ "MHz" ]]; then
[[ "${array[1]}" < 1300 ]] && color="\033[34m" # bleu
[[ "${array[1]}" > 1500 ]] && color="\033[31m" # rouge
echo -e "$color ${array[1]} \033[0m"
fi
done < "/proc/cpuinfo"
Manjaro STABLE - Linux lts - fish - Kde5 - icore N100 - 16Go RAM - ssd - efi
#mount /dev/archlinux /mnt/manjaro
Erwan Modérateur Signature : Signature
#6 Message il y a 5 ans C'est bien mieux en couleur Manjaro-Xfce-Compiz 64
Desktop
CPU amd-phenom-64(pci=nomsi dans grub)
CG nvidia GeForce GT 730
Ram : 4 Go
kernel : 54 branche : stable, driver GPU : Nvidia-non-libre"Nvidia fuck you" Linus Torvalds qtox : erwan@toxme.io