Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo -e "\033[1;34mThermal Zone Temp (°C)\033[0m"
- echo -e "\033[1;34m------------------------\033[0m"
- colors=( "\033[1;31m" "\033[1;33m" "\033[1;32m" "\033[1;36m" "\033[1;35m" "\033[1;34m" )
- for file in /sys/class/thermal/thermal_zone*/temp; do
- zone=$(basename $(dirname $file))
- temp=$(cat $file)
- temp_c=$(echo "scale=1; $temp / 1000" | bc)
- color=${colors[$RANDOM % ${#colors[@]} ]}
- echo -e "$color$zone $temp_c°C\033[0m"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement