Add GPU usage daemon

Works for AMD GPUs only using the amdgpu_top utility
This commit is contained in:
elenapan 2024-07-17 11:21:26 +03:00
parent ef486f4e39
commit a8d2ed7aaf

View file

@ -0,0 +1,16 @@
-- Provides:
-- evil::gpu
-- used percentage (integer from 0 to 100)
local awful = require("awful")
local update_interval = 5
-- For AMD GPUs
local gpu_script = [[
sh -c "
amdgpu_top -gm --single | awk '/average_gfx_activity/ {print substr($2, 1, length($2)-1)}'
"]]
awful.widget.watch(gpu_script, update_interval, function(_, stdout)
awesome.emit_signal("evil::gpu", tonumber(stdout))
end)