Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPU, Memory & GPU Status Widget for KDE Plasma 6

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.

Why?

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.

CPU & Memory Status Widget

Features

  • 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/meminfo and /sys/class/hwmon/).
    • Skips hardware calls (like nvidia-smi) for disabled monitors to save system resources.
  • 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 to ksysguard.
    • Native Tooltip: Detailed hovering tooltips showing precise numbers for all active metrics.
  • Robust Hardware Detection: Automatic search for CPU-specific thermal sensors on /sys/class/hwmon/ (supporting AMD k10temp/zenpower and Intel coretemp drivers), falling back to /sys/class/thermal/.

Requirements

To build and run this widget, you need:

  • OS: Linux (with /proc and /sys filesystems)
  • 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

Installation

1. Build and Install (Command Line)

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 build

2. Restart the Panel

For Plasma to recognize and load the newly compiled C++ plugin binary:

systemctl --user restart plasma-plasmashell.service

3. Add to Panel

Right-click on your Plasma panel ➔ select Add Widgets ➔ search for "CPU & Memory Status" ➔ drag and drop it onto your panel.


Configuration

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.

Development (Qt Creator Setup)

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:

  1. Open Qt CreatorPreferencesKitsQt Versions.
  2. Click Add... and select your system's qmake executable (usually /usr/bin/qmake6 or /usr/lib/qt6/bin/qmake).
  3. Under the Kits tab, create or select a kit (e.g. Desktop (System Qt6)) and link it to this system Qt version.
  4. Open the project's CMakeLists.txt and use this kit for building.

Project Structure

  • 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.

License

This project is licensed under the GPL-2.0-or-later License - see the package/metadata.json file for details.

About

Native C++/QML widget to monitor CPU temperature and RAM usage in KDE Plasma 6.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages