Lightweight System Temperature Monitor for Arch Linux
  • C++ 87.7%
  • Shell 9.1%
  • Makefile 3.2%
Find a file
2026-01-25 17:25:02 +00:00
assets Add files via upload 2026-01-25 17:22:57 +00:00
src Merge branch 'main' into experimental/create-arch-linux-temperature-tray-application-v1p7ia 2026-01-25 17:07:32 +00:00
install.sh Add alerts, history graph, and system stats 2026-01-25 17:05:49 +00:00
LICENSE Initial commit 2026-01-25 15:45:21 +00:00
Makefile Add alerts, history graph, and system stats 2026-01-25 17:05:49 +00:00
PKGBUILD Create PKGBUILD 2026-01-25 16:23:37 +00:00
README.md Update README.md 2026-01-25 17:25:02 +00:00
tempmon.desktop Create tempmon.desktop 2026-01-25 16:21:36 +00:00
tempmon.service Add alerts, history graph, and system stats 2026-01-25 17:05:49 +00:00

๐ŸŒก๏ธ TempMon

TempMon Logo

Lightweight System Temperature Monitor for Arch Linux

License: MIT Language: C++ Platform: Linux AUR: Arch Linux Build: Make

A native, lightweight system tray application for monitoring CPU/GPU temperatures, power consumption, and fan speeds.

Similar to CoreTemp or iStat Menus, but built specifically for Linux with minimal resource usage.

Features โ€ข Installation โ€ข Usage โ€ข Project Structure โ€ข GitHub Setup โ€ข Troubleshooting


โœจ Features

๐Ÿ“Š Monitoring Capabilities

  • ๐ŸŒก๏ธ Temperature Monitoring
    • CPU core temperatures
    • GPU temperatures
    • Motherboard sensors
    • Disk/NVMe sensors (when exposed via hwmon)
    • Other hardware sensors
  • โšก Power Consumption
    • CPU package power (watts)
    • GPU power draw
  • ๐ŸŒ€ Fan Speed Monitoring
    • All system fans (RPM)
  • ๐Ÿ“ˆ System Stats
    • CPU frequency (MHz)
    • Network throughput (Rx/Tx)

๐Ÿš€ Performance & Features

  • ๐Ÿชถ Lightweight
    • ~5MB RAM usage
    • Minimal CPU overhead
  • ๐ŸŽฏ Native Implementation
    • Pure C++17
    • GTK3 + libappindicator
  • ๐Ÿ“Š Auto-Discovery
    • Automatically finds all sensors
    • No manual configuration needed
  • ๐Ÿ”„ Real-time Updates
    • 2-second refresh rate
    • Live system tray display
  • โš™๏ธ CoreTemp-like Tray Icon
    • Multiple icon styles (compact, rounded, square)
    • Optional temperature delay for the tray icon
    • Settings window for quick customization

๐Ÿ“ธ Screenshots

System Tray Dropdown Menu
Tray Icon showing 52ยฐC Menu with sensors

The app displays current CPU temperature in the tray and all sensors in a dropdown menu


๐Ÿ“‹ Requirements

๐Ÿ“ฆ System Requirements

Component Requirement
OS Arch Linux (or Arch-based distro)
Compiler GCC with C++17 support
Libraries GTK3, libappindicator-gtk3
Build Tools make, pkg-config
Kernel Linux kernel with hwmon support

๐Ÿ”ง Dependencies

sudo pacman -S base-devel gtk3 libappindicator-gtk3
Optional: GPU-specific drivers

For NVIDIA GPUs

sudo pacman -S nvidia-utils

For AMD GPUs

The amdgpu kernel driver should already expose temperature sensors.

For Better Sensor Detection

sudo pacman -S lm_sensors
sudo sensors-detect

๐Ÿš€ Installation

git clone https://github.com/yourusername/tempmon.git
cd tempmon
chmod +x install.sh
./install.sh

The script will:

  • โœ… Check and install dependencies
  • โœ… Compile the application
  • โœ… Optionally install to /usr/local/bin
  • โœ… Optionally add to autostart
  • โœ… Check for sensor kernel modules

Method 2: Manual Installation

sudo pacman -S base-devel gtk3 libappindicator-gtk3
make
sudo make install
tempmon

Method 3: Build Arch Package

makepkg -si

๐ŸŽฎ Usage

Starting TempMon

tempmon

The application will:

  1. ๐Ÿ” Auto-discover all available hardware sensors
  2. ๐Ÿ“Š Display the highest CPU temperature in the system tray
  3. ๐Ÿ“‹ Show all sensors in a dropdown menu when clicked
  4. ๐Ÿ”„ Update readings every 2 seconds
  5. โš™๏ธ Provide a Settings window for icon style, delay, and sensor selection

Stopping TempMon

  • Click the tray icon and select Quit
  • Or use: killall tempmon

โš™๏ธ Autostart Configuration

# Install systemd user unit and enable autostart
sudo make install
systemctl --user daemon-reload
systemctl --user enable --now tempmon.service

Disable it later with:

systemctl --user disable --now tempmon.service

For Desktop Environments (GNOME, KDE, Xfce, MATE)

mkdir -p ~/.config/autostart
cp tempmon.desktop ~/.config/autostart/

Or create the file manually:

cat > ~/.config/autostart/tempmon.desktop << 'EOF'
[Desktop Entry]
Type=Application
Name=TempMon
Comment=Temperature Monitor
Exec=tempmon
Terminal=false
X-GNOME-Autostart-enabled=true
EOF

For Window Managers (i3, Sway, bspwm)

i3 WM

Add to ~/.config/i3/config:

exec --no-startup-id tempmon

Sway

Add to ~/.config/sway/config:

exec tempmon

bspwm

Add to ~/.config/bspwm/bspwmrc:

tempmon &

๐Ÿ”ง How It Works

``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Linux Kernel (hwmon interface) โ”‚ โ”‚ /sys/class/hwmon/hwmon* โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ–ผ โ–ผ โ–ผ temp*_input power*_input fan*_input โ”‚ โ”‚ โ”‚ Temperature (ยฐC) Power (Watts) Fan Speed (RPM) โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ TempMon Application โ”‚ โ”‚ โ€ข Auto-discovers sensors โ”‚ โ”‚ โ€ข Reads values every 2 seconds โ”‚ โ”‚ โ€ข Updates GTK tray indicator โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ```

๐Ÿ“Š Supported Sensor Types

Sensor Type Interface Example Hardware
๐ŸŒก๏ธ Temperature hwmon/temp*_input CPU cores, GPU, chipset
โšก Power hwmon/power*_input CPU package, GPU power
๐ŸŒ€ Fan Speed hwmon/fan*_input Case fans, CPU cooler

๐Ÿ–ฅ๏ธ Compatible Hardware

Intel Systems

  • CPU: coretemp driver
    • Core temperatures
    • Package power
  • GPU: i915 driver (integrated)

AMD Systems

  • CPU: k10temp driver
    • Tctl/Tdie temperatures
    • Package power
  • GPU: amdgpu driver
    • Junction/edge temps
    • GPU power

NVIDIA GPUs

  • GPU: nvidia driver
    • GPU temperature
    • Power draw
    • Fan speed

๐Ÿ“ Project Structure

tempmon/
โ”œโ”€โ”€ ๐Ÿ“„ .gitignore             # Git ignore rules
โ”œโ”€โ”€ ๐Ÿ“„ LICENSE                # MIT License
โ”œโ”€โ”€ ๐Ÿ“„ README.md              # This file
โ”œโ”€โ”€src/                       
   โ””โ”€โ”€ ๐Ÿ’ป tempmon.cpp         # Main C++ source (~300 lines)
โ”œโ”€โ”€ ๐Ÿ”จ Makefile               # Build configuration
โ”œโ”€โ”€ ๐Ÿš€ install.sh             # Automated installer
โ”œโ”€โ”€ ๐Ÿ–ฅ๏ธ tempmon.desktop        # Desktop entry for autostart
โ”œโ”€โ”€ ๐Ÿงฐ tempmon.service        # systemd user service (autostart)
โ”œโ”€โ”€ ๐Ÿ“ฆ PKGBUILD               # Arch package build script
โ”œโ”€โ”€ ๐Ÿ“š ENHANCEMENTS.md        # Customization guide
โ””โ”€โ”€ ๐Ÿ–ผ๏ธ images/                # Screenshots (optional)
    โ”œโ”€โ”€ how-it-works.png
    โ”œโ”€โ”€ tray-icon.png
    โ””โ”€โ”€ dropdown-menu.png

What Files Do I Need?

Quick Start (Just Use It):

tempmon.cpp + Makefile + install.sh

Manual Installation:

tempmon.cpp + Makefile

Build Arch Package:

tempmon.cpp + Makefile + tempmon.desktop + PKGBUILD

Total repository size: ~50-300 KB (extremely lightweight!)


๐Ÿ™ GitHub Setup

Initial Repository Setup

cd tempmon
git init
git add .
git commit -m "Initial commit: TempMon system monitor"
git remote add origin https://github.com/yourusername/tempmon.git
git branch -M main
git push -u origin main

Repository Configuration

Topics (Tags):

arch-linux, temperature-monitor, system-tray, gtk3, cpp, linux, hardware-monitoring, sensors, lightweight

Description:

Lightweight system tray monitor for CPU/GPU temps, power, and fans

Creating First Release

git tag -a v1.0.0 -m "Initial release of TempMon"
git push origin v1.0.0

On GitHub: Releases โ†’ Create a new release โ†’ Tag: v1.0.0

.gitignore File

# Compiled binary
tempmon

# Build artifacts
*.o
*.so
*.a
*.out

# Editor files
*.swp
*.swo
*~
.vscode/
.idea/
*.sublime-*

# OS files
.DS_Store
Thumbs.db
desktop.ini

# Backup files
*.bak
*.backup

# Package files
*.tar.gz
*.tar.xz
*.pkg.tar.zst
pkg/
src/

# Debug files
*.log
core

# IDE specific
.clangd/
compile_commands.json

Optional: GitHub Actions CI/CD

Create .github/workflows/build.yml:

name: Build

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@v3
    
    - name: Install dependencies
      run: |
        sudo apt-get update
        sudo apt-get install -y build-essential libgtk-3-dev libappindicator3-dev
    
    - name: Build
      run: make
    
    - name: Upload binary
      uses: actions/upload-artifact@v3
      with:
        name: tempmon
        path: tempmon

๐ŸŽจ Customization

Changing Update Interval

Edit tempmon.cpp line ~270:

// Change from 2000ms (2 seconds) to desired value
timer_id = g_timeout_add(2000, updateCallback, this);

Open Settings from the tray menu to configure:

  • Temperature source (auto or a specific sensor)
  • Update interval and icon display delay
  • Icon style (compact, rounded, square)
  • Theme (dark, light, accent)
  • Decimal precision and degree symbol

Settings are stored in ~/.config/tempmon/config.ini.

Changing Tray Display

Edit the computeAutoTemperature() function to show GPU temp instead:

// Search for GPU temperature instead of CPU
if (sensor.type == "temp" && sensor.name.find("GPU") != std::string::npos) {
    // Show GPU temp in tray
}

Adding Temperature Alerts

See ENHANCEMENTS.md for examples of adding:

  • ๐Ÿ”” Desktop notifications for high temps
  • ๐ŸŽจ Color-coded temperature warnings
  • ๐Ÿ“ˆ Temperature history and graphs
  • โš™๏ธ Configuration file support

๐Ÿ› Troubleshooting

โŒ No sensors detected

Solution 1: Load kernel modules

# For Intel CPUs
sudo modprobe coretemp

# For AMD CPUs  
sudo modprobe k10temp

# For AMD GPUs
sudo modprobe amdgpu

# Make permanent
echo "coretemp" | sudo tee -a /etc/modules-load.d/sensors.conf

Solution 2: Run sensors-detect

sudo pacman -S lm_sensors
sudo sensors-detect
# Answer YES to save configuration
sudo reboot

Solution 3: Verify sensors exist

# List available hardware monitors
ls -la /sys/class/hwmon/

# Check what sensors are detected
sensors

# Check specific device
cat /sys/class/hwmon/hwmon0/name
cat /sys/class/hwmon/hwmon0/temp1_input

๐Ÿšซ App doesn't appear in system tray

GNOME:

sudo pacman -S gnome-shell-extension-appindicator
gnome-extensions enable appindicatorsupport@rgcjonas.gmail.com

KDE Plasma: Should work out of the box. Check System Settings โ†’ System Tray.

i3/Sway: Make sure you're running a status bar that supports tray icons (i3bar, polybar, waybar).

Xfce: Panel should support indicators by default. Right-click panel โ†’ Add Items โ†’ Notification Area.

โš ๏ธ Build errors

Error: gtk/gtk.h: No such file or directory

sudo pacman -S gtk3 libappindicator-gtk3 pkg-config

Error: undefined reference to 'app_indicator_new'

sudo pacman -S libappindicator-gtk3

Check pkg-config:

pkg-config --modversion gtk+-3.0
pkg-config --modversion appindicator3-0.1

๐Ÿ”ฅ Temperatures seem wrong

Compare with other tools:

sudo pacman -S lm_sensors
sensors
watch -n 1 sensors

# For NVIDIA
nvidia-smi

Note about AMD Tctl vs Tdie:

AMD reports two temperatures:

  • Tctl: Control temperature (with offset)
  • Tdie: Die temperature (actual)

TempMon shows both if available.


๐Ÿ—‘๏ธ Uninstallation

# Remove binary
sudo make uninstall

# Remove autostart entry
rm -f ~/.config/autostart/tempmon.desktop

# Remove source directory
cd .. && rm -rf tempmon

๐Ÿค Contributing

Contributions are welcome! Here are some ideas:

๐ŸŽฏ Feature Ideas

  • Configuration file support
  • Temperature alert notifications
  • Historical graphs
  • Disk temperature monitoring
  • Network statistics
  • CPU frequency display

๐Ÿ› Improvements

  • Multi-language support
  • GUI preferences window
  • Custom color themes
  • Export data to CSV
  • Wayland native support
  • Plugin system

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“Š Comparison with Other Tools

Feature TempMon conky psensor i3status htop
System Tray โœ… โŒ โœ… โŒ โŒ
Lightweight โœ… โš ๏ธ โš ๏ธ โœ… โœ…
Auto-discovery โœ… โŒ โœ… โŒ N/A
Power Monitoring โœ… โŒ โŒ โŒ โŒ
No Config Needed โœ… โŒ โœ… โŒ โœ…
RAM Usage ~5MB ~20MB ~15MB ~2MB ~10MB

Why TempMon?

  • โœ… vs CoreTemp: Native Linux, monitors all hardware types
  • โœ… vs iStat Menus: Open source, free, customizable
  • โœ… vs conky: System tray integration, zero configuration
  • โœ… vs psensor: Lighter weight, cleaner interface, includes power monitoring

๐Ÿ“„ License

MIT License - see LICENSE file for details.

Copyright (c) 2025 [Your Name]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.


๐Ÿ“ž Support


๐Ÿ™ Acknowledgments

  • GTK Project - UI toolkit
  • libappindicator - System tray support
  • Linux kernel - hwmon interface
  • Arch Linux - The inspiration for lightweight tools

โฌ† Back to Top

Made with โค๏ธ for the Arch Linux community

Arch Linux C++ Linux