Made as an example it is simple and has many descriptive comments.
Gets temperature in one of 3 ways,
Either runs a command and uses it's direct output or
loads a temp file that stores the temperature as a simple number being the temperature X 1000
For raspberry pi many other systems simply give it the file path...
'/sys/class/thermal/thermal_zone0/temp'
Auto-detect checks ALL /sys/class/thermal zones and reports the hottest one found.
or it can use a shell command like sensors (from package lm-sensors) with grep and awk to get the temperature text.
Use 'sudo apt-get install lm-sensors' or use your package manager to install.
Command Example...
Code: Select all
sensors|grep 'Core 0'|awk '{print $3}'
Core 0: +45.0°C (high = +82.0°C, crit = +100.0°C)
and then uses awk to get the 3rd bit of text '+45.0°C' (space separation makes 'Core 0:' 2 words)
Written in Gambas basic
Code has FULL comments explaining everything.
Has a minimum-requirement-installer to install required gambas components.
Other features...
Change background / text and highlight colour
Set Time delay between checks.
Show/Hide Window border/titlebar
Drag-Move/resize window
Bruce
(Note this is version 1.2 , scroll down for updated version 1.4)