Skip to content

Instantly share code, notes, and snippets.

@showrav-ansary
Last active January 15, 2026 20:02
Show Gist options
  • Select an option

  • Save showrav-ansary/99fafe61941e4673eeb1b43f245c5b8c to your computer and use it in GitHub Desktop.

Select an option

Save showrav-ansary/99fafe61941e4673eeb1b43f245c5b8c to your computer and use it in GitHub Desktop.
this gist contains how to create a module for waybar to monitor nVidia GPUs.

Screenshot-20250109-181624.png
This custom module will require nvidia-smi installed as I have chosen to use it to pull real-time data. For icons to work correctly install nerd-fonts.

In your ~/.config/waybar/Modules you can choose to add these:

  • GPU Usage:
"custom/gpu-usage": {
    "format": "{}% {icon}",
    "format-icons": "󰾲",
    "on-click": "nvidia-settings", // will required nvidia-settings installed as well, comes with the driver by default.
    "exec": "nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits",
    "interval": 1,
},

You may comment out the on-click entry if you do not wish to make it a shortcut to open nvidia-settings.\

  • GPU Temperature:
"custom/gpu-temperature": {
    "format": "{}°C {icon}",
    "format-icons": "󰾲",
    "on-click": "kitty --title nvtop sh -c 'nvtop'", // I prefer `nvtop`, install it according to your distro if you want the same
    "exec": "nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits",
    "interval": 1,
},

nvtop is not required for GPU monitoring, I prefer it over nvidia-smi. There is actually no advantage of doing so.

  • GPU Memory:
"custom/gpu-memory": {
    "format": "{} ",
    //"on-click":"", // upto you what you want to add, your preference really
    "exec": "nvidia-smi --query-gpu=memory.used --format=csv,noheader",
    "interval": 1,
    },




Don't forget to add the modules you want to include in your waybar to ~/.config/waybar/config. For example:

"modules-left": [
    //other predefined/user defined modules
    .
    .
    .
    "custom/gpu-temperature",
    .
    .
    .
    //other predefined/user defined modules
    


 ],

You may parse more informations from nvidia-smi, run nvidia-smi --help-query-gpu to get more parameters.

Screenshot-20250109-181843.png

@showrav-ansary
Copy link
Author

If you use anything other than kitty, write down on-click part accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment