Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create NVIDIA GPU usage/temperature widget #548

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tronfy
Copy link

@tronfy tronfy commented Jan 1, 2023

Adds widget/contrib/nvidia.lua, for accessing NVIDIA GPU usage and temperature info.

Requires nvidia-smi to be installed.
This is made clear in a comment and in the proposed wiki page for the widget.

Proposed wiki page: https://github.com/tronfy/lain/wiki/nvidia

@lcpz
Copy link
Owner

lcpz commented Jan 3, 2023

As this widget is quite simple, I'd suggest creating a watch recipe instead:

local nvidia = awful.widget.watch( -- dependency: nvidia-smi
    "nvidia-smi --query-gpu=utilization.gpu,temperature.gpu --format=csv,noheader,nounits",
    5, -- timeout in seconds
    function(widget, stdout)
        local usage, temp = stdout:match("([^,]+),([^,]+)")

        widget:set_text(string.format("%d%% %.1f", usage, temp)) -- customize here
end)

Please create a PR to awesome-www. See here for previous examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants