Skip to content
3 changes: 2 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ config:
# Choose the appropriate method for reading your hardware sensors:
# - PYTHON use Python libraries (psutils, GPUtil...) to read hardware sensors (supports all OS but not all HW)
# - LHM use LibreHardwareMonitor library to read hardware sensors (Windows only - NEEDS ADMIN RIGHTS)
# - APPLE_SILICON use Apple Silicon SMC/IOReport/IOKit for full sensor support (macOS ARM64 only, no root needed)
# - STUB / STATIC use random/static data instead of real hardware sensors
# - AUTO use the best method based on your OS: Windows OS will use LHM, other OS will use Python libraries
# - AUTO use the best method based on your OS: WindowsLHM, macOS ARM64→Apple Silicon, other→Python
HW_SENSORS: AUTO

# Network interfaces
Expand Down
750 changes: 750 additions & 0 deletions library/sensors/sensors_apple_silicon.py

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion library/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,20 @@
elif HW_SENSORS == "STATIC":
logger.warning("Stub sensors, not real HW sensors")
import library.sensors.sensors_stub_static as sensors
elif HW_SENSORS == "APPLE_SILICON":
if platform.system() == 'Darwin' and platform.machine() == 'arm64':
import library.sensors.sensors_apple_silicon as sensors
else:
logger.error("Apple Silicon sensor support is only available on Apple Silicon Macs")
try:
sys.exit(1)
except Exception:

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exit fallback differs from the existing pattern above: except Exception will not catch SystemExit raised by sys.exit(), so the os._exit(1) fallback is effectively unreachable if some outer layer catches SystemExit. For consistency with the other branches (and to guarantee termination when intended), catch BaseException / use a bare except: here as well.

Suggested change
except Exception:
except BaseException:

Copilot uses AI. Check for mistakes.
os._exit(1)
elif HW_SENSORS == "AUTO":
if platform.system() == 'Windows':
import library.sensors.sensors_librehardwaremonitor as sensors
elif platform.system() == 'Darwin' and platform.machine() == 'arm64':
import library.sensors.sensors_apple_silicon as sensors
else:
import library.sensors.sensors_python as sensors
else:
Expand Down Expand Up @@ -768,7 +779,7 @@ def stats():
time_format = hour_theme_data.get("FORMAT", 'medium')
display_themed_value(
theme_data=hour_theme_data,
value=f"{babel.dates.format_time(date_now, format=time_format, locale=lc_time)}"
value=f"{babel.dates.format_time(date_now, format=time_format, locale=lc_time)}".replace('\u202f', ' ')
)


Expand Down
Binary file added res/themes/AppleSiliconDiag/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading