mirror of
https://github.com/elenapan/dotfiles.git
synced 2025-12-26 15:14:58 +08:00
Add GPU usage daemon
Works for AMD GPUs only using the amdgpu_top utility
This commit is contained in:
parent
ef486f4e39
commit
a8d2ed7aaf
1 changed files with 16 additions and 0 deletions
16
config/awesome/evil/gpu.lua
Normal file
16
config/awesome/evil/gpu.lua
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue