A simple system monitor for Linux, using gtk4/gtkmm-4.0 and written in C++. This project was created as part of a school assignment to learn system-level programming in C++ and explore GUI development in gtk.
This program displays real-time usages statistics for the CPU, GPU, memory, hard drives and internet (upload/download).
The program gets system information from the Linux /proc pseudo-filesystem and uses the Nvidia API to retrieve the GPU stats.
On Arch you would use pacman:
sudo pacman -S gcc gtk4 gtkmm4.0 cmake ninja
Clone the repository:
git clone https://github.com/Helland369/system_monitor.git
cd to project
cd system_monitor
cmake command
cmake --fresh -B build -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cd to build
cd build
run the program
./system_monitor
You can get a binary here, but you need the gtk4 and gtkmm-4.0 dependencies.
This system monitor gathers system statistics by reading files from the /proc pseudo-filesystem and accessing the NVIDIA API for GPU stats. It uses GTK4 and gtkmm-4.0 to build a modern, native Linux GUI.
- While running the program, you can press
1through5to change the layout of the boxes.
-
CPU & Memory Usage:
Retrieved from
/proc/stat,/proc/meminfo, and other related files. -
Disk Usage:
Read from
/proc/diskstats. -
Network Usage:
Calculated Using
/proc/net/dev, tracking changes in RX/TX byte counts over time. -
GPU Usage:
Fetched via the NVIDIA Management Library (NVML).
-
GUI:
Built with GTK4 widgets using the gtkmm C++ bindings, updated in real time using timers.
-
/src/main.cppMain entry point of the program. -
/src/SystemMonitorWindow.cppGTK related UI and rendering. -
/src/CpuUsage.cppLogic for gathering CPU usage info. -
src/FileSystem.cppLogic for gathering Disk usage info. -
src/MemInfo.cppLogic for gathering memory usage info. -
src/NetInfo.cppLogic for gathering Network info. -
src/NvidiaInfo.cppLogic for talking to the Nvidia api (NVML).
After building the project, you can run the binary from the build/ folder:
./system_monitorTested on Arch Linux in I3 and X11
-
GPU monitoring only works with Nvidia GPUs via NVML.
-
The program only supports Linux.
-
GTK themes don't work.
