A lightweight, zero-dependency plugin that shows your machine’s CPU and (optionally) GPU temperatures directly in your Zsh prompt.
Originally designed for Raspberry Pi but works on any Linux system exposing /sys/class/thermal/.
Perfect for quick system health checks — no watch, no htop, just glance at your prompt.
- 📊 Displays CPU and GPU temperatures in °C or °F
- 🎨 Auto-colorizes temperatures (green / yellow / red) based on thresholds
- ⚙️ User-configurable decimals, format, units, and position
- ⚡ Lightweight (no polling daemon; reads on prompt render)
- 🧠 Smart caching to keep your prompt snappy
- 🔁 Resilient to
source ~/.zshrcreloads (auto-reattaches) - 🧩 Compatible with any theme (manual or auto placement)
git clone https://github.com/groberth/temperatures-zsh "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/temperatures-zsh"Then in your ~/.zshrc:
plugins+=(temperatures-zsh)
# optional configuration belowReload your shell:
exec zshgit clone https://github.com/groberth/temperatures-zsh ~/.zsh/temperatures-zsh
source ~/.zsh/temperatures-zsh/temperatures-zsh.plugin.zshAdd $(temperatures_prompt) anywhere in your PROMPT or RPROMPT.
All options are set via environment variables before the plugin loads (usually in .zshrc).
Each has a default, so you can override only what you need.
| Variable | Default | Description |
|---|---|---|
TEMPERATURES_AUTO |
true |
Whether to automatically inject the temperature display into your prompt. Set to false if you want to place it manually in your theme. |
TEMPERATURES_POSITION |
right |
Position when auto-inserting. right puts it in RPROMPT, left prepends it to PROMPT. |
TEMPERATURES_UNIT |
C |
Unit of measurement — C for Celsius or F for Fahrenheit. |
TEMPERATURES_DECIMALS |
1 |
Number of decimal places (e.g. 0 for integers, 2 for high precision). |
TEMPERATURES_POLL_INTERVAL |
2 |
Number of seconds to cache readings between prompt draws (performance trade-off). |
TEMPERATURES_FORMAT |
CPU:%s°%s GPU:%s°%s |
printf-style format string (cpu, unit, gpu, unit). Collapses gracefully if GPU is disabled/unavailable. |
TEMPERATURES_THRESHOLDS |
50 70 |
Two numeric thresholds (in °C) that separate low → medium → high temperature coloring. |
TEMPERATURES_COLOR_LOW |
%F{green} |
Zsh color for “cool” temperatures (below first threshold). |
TEMPERATURES_COLOR_MED |
%F{yellow} |
Color for medium temperatures. |
TEMPERATURES_COLOR_HIGH |
%F{red} |
Color for hot temperatures (above second threshold). |
TEMPERATURES_SHOW_GPU |
auto |
Controls GPU reading. auto enables only if vcgencmd exists, true always tries, false disables. |
You can manually insert the output anywhere in your prompt:
RPROMPT='$(temperatures_prompt) %~'Add this to ~/.p10k.zsh:
function prompt_temperatures() {
local s="$(temperatures_prompt)"
[[ -n "$s" ]] || return
p10k segment -t "$s"
}
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS+=(temperatures-zsh)# ~/.zshrc
plugins+=(temperatures-zsh)
# show in °F with no decimals
TEMPERATURES_UNIT=F
TEMPERATURES_DECIMALS=0
# make it appear on the left of the prompt
TEMPERATURES_POSITION=left
# longer cache for faster prompts
TEMPERATURES_POLL_INTERVAL=5
# hide GPU
TEMPERATURES_SHOW_GPU=falseResult:
CPU:118°F ~/projects
- CPU: any Linux system exposing
/sys/class/thermal/thermal_zone0/temp - GPU (optional): Raspberry Pi or similar, with
vcgencmdin PATH - Shell: Zsh ≥ 5.0
- Framework: optional (works with or without Oh My Zsh)
MIT © 2025 Groberth See the LICENSE file for details.