Advertisement
keiaa070500

see temps

Dec 7th, 2024 (edited)
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.46 KB | Source Code | 0 0
  1. #!/bin/bash
  2.  
  3. echo -e "\033[1;34mThermal Zone  Temp (°C)\033[0m"
  4. echo -e "\033[1;34m------------------------\033[0m"
  5.  
  6. colors=( "\033[1;31m" "\033[1;33m" "\033[1;32m" "\033[1;36m" "\033[1;35m" "\033[1;34m" )
  7.  
  8. for file in /sys/class/thermal/thermal_zone*/temp; do
  9.   zone=$(basename $(dirname $file))
  10.   temp=$(cat $file)
  11.   temp_c=$(echo "scale=1; $temp / 1000" | bc)
  12.   color=${colors[$RANDOM % ${#colors[@]} ]}
  13.   echo -e "$color$zone  $temp_c°C\033[0m"
  14. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement