- C++ 87.7%
- Shell 9.1%
- Makefile 3.2%
|
|
||
|---|---|---|
| assets | ||
| src | ||
| install.sh | ||
| LICENSE | ||
| Makefile | ||
| PKGBUILD | ||
| README.md | ||
| tempmon.desktop | ||
| tempmon.service | ||
๐ก๏ธ TempMon
Lightweight System Temperature Monitor for Arch Linux
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
|
๐ Performance & Features
|
๐ธ Screenshots
| System Tray | Dropdown Menu |
|---|---|
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
Method 1: Quick Install Script (Recommended)
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:
- ๐ Auto-discover all available hardware sensors
- ๐ Display the highest CPU temperature in the system tray
- ๐ Show all sensors in a dropdown menu when clicked
- ๐ Update readings every 2 seconds
- โ๏ธ 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
systemd User Service (Recommended)
# 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
๐ 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
|
AMD Systems
|
NVIDIA GPUs
|
|
๐ 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);
Settings Window (Recommended)
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
|
๐ Improvements
|
How to Contribute
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
- ๐ Bug Reports: Open an issue
- ๐ก Feature Requests: Start a discussion
- ๐ Documentation: Check ENHANCEMENTS.md for customization examples
๐ Acknowledgments
- GTK Project - UI toolkit
- libappindicator - System tray support
- Linux kernel - hwmon interface
- Arch Linux - The inspiration for lightweight tools