OBS: Developed with AI assistance
A personal lightweight, native, and reactive C++ & QML mini-applet (plasmoid) for the KDE Plasma 6 panel. It monitors and displays real-time CPU temperature, RAM usage, GPU temperature, and VRAM usage in a compact layout, with custom visibility settings and click-to-launch system monitor.
I wanted a lightweight and minimalist system monitor widget for the KDE Plasma status bar to track CPU, RAM, GPU, and VRAM usage without cluttering the panel.
- Real-Time Monitoring:
- CPU Temperature (in °C) with dynamic sensor detection.
- RAM Usage (in GB / Total GB).
- GPU Temperature (in °C) via
nvidia-smi. - VRAM Usage (in GB / Total GB) via
nvidia-smi.
- Configurable Visibility:
- Native KDE Plasma 6 configuration page (Right-click ➔ Configure...).
- Enable or disable CPU, RAM, GPU, and VRAM graphs independently.
- Automatic fallback placeholder ("Sem monitores") if all graphs are unchecked.
- Resource-Efficient:
- Written in C++17 reading directly from Linux kernel pseudo-filesystems (
/proc/meminfoand/sys/class/hwmon/). - Skips hardware calls (like
nvidia-smi) for disabled monitors to save system resources.
- Written in C++17 reading directly from Linux kernel pseudo-filesystems (
- Responsive Visuals: Vertical status bars with color gradients (green ➔ yellow ➔ red) and smooth height transition animations.
- System Integration:
- Click to Launch: Clicking anywhere on the widget launches the default KDE System Monitor (
plasma-systemmonitor), with automatic fallback toksysguard. - Native Tooltip: Detailed hovering tooltips showing precise numbers for all active metrics.
- Click to Launch: Clicking anywhere on the widget launches the default KDE System Monitor (
- Robust Hardware Detection: Automatic search for CPU-specific thermal sensors on
/sys/class/hwmon/(supporting AMDk10temp/zenpowerand Intelcoretempdrivers), falling back to/sys/class/thermal/.
To build and run this widget, you need:
- OS: Linux (with
/procand/sysfilesystems) - Desktop Environment: KDE Plasma 6
- Optional:
nvidia-smi(for NVIDIA GPU & VRAM monitoring) - Dependencies (Ubuntu/Debian):
sudo apt install -y build-essential cmake extra-cmake-modules \ libkf6coreaddons-dev libkf6config-dev \ libplasma-dev qt6-base-dev qt6-declarative-dev
To compile and install the widget using your system's native Qt6 and KDE Frameworks:
# 1. Configure the build directory (pointing to system paths)
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
# 2. Compile the plugin library
cmake --build build
# 3. Install the plugin and QML packages to system directories
sudo cmake --install buildFor Plasma to recognize and load the newly compiled C++ plugin binary:
systemctl --user restart plasma-plasmashell.serviceRight-click on your Plasma panel ➔ select Add Widgets ➔ search for "CPU & Memory Status" ➔ drag and drop it onto your panel.
Right-click the widget on the panel and select Configure CPU & Memory Status...:
- Toggle visibility for CPU Temperature, RAM Usage, GPU Temperature, and VRAM Usage.
If you are using Qt Creator, make sure you configure it to use your system's native Qt6 compiler rather than a local standalone Kit (e.g. Qt 6.11.x) to avoid ABI version mismatches:
- Open Qt Creator ➔ Preferences ➔ Kits ➔ Qt Versions.
- Click Add... and select your system's qmake executable (usually
/usr/bin/qmake6or/usr/lib/qt6/bin/qmake). - Under the Kits tab, create or select a kit (e.g. Desktop (System Qt6)) and link it to this system Qt version.
- Open the project's
CMakeLists.txtand use this kit for building.
CMakeLists.txt: Build configuration, library target naming (org.kde.plasma.cpumemstatus), and package install directories.assets/: Repository images and screenshots.package/: QML package files.metadata.json: Applet definition, versioning, minimum Plasma version requirements, and package structure.contents/config/: Configuration metadata (main.xml,config.qml).contents/ui/: Interface views (main.qml,CpuBar.qml,MemBar.qml,GpuBar.qml,VramBar.qml,configGeneral.qml).
src/: Backend C++ code (cpumemapplet.h/cpp) handling kernel/GPU stats reading and subprocess spawning.
This project is licensed under the GPL-2.0-or-later License - see the package/metadata.json file for details.
