Skip to content

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