fix #10 and #13. Various other fixes and small changes

This commit is contained in:
Kievits Rene
2022-05-25 11:27:03 +02:00
parent b5f513a344
commit ff202de163
28 changed files with 1664 additions and 1280 deletions

View File

@@ -54,7 +54,7 @@ return function(widget)
end,
widget = wibox.container.background
}
Hover_signal(gpu_usage_widget, color["Green200"])
Hover_signal(gpu_usage_widget, color["Green200"], color["Grey900"])
local gpu_temp_widget = wibox.widget {
{
@@ -102,8 +102,8 @@ return function(widget)
[[ bash -c "nvidia-smi -q -d UTILIZATION | grep Gpu | awk '{print $3}'"]],
3,
function(_, stdout)
gpu_usage_widget.container.gpu_layout.label.text = stdout:gsub("\n", "") .. "%"
end
gpu_usage_widget.container.gpu_layout.label.text = stdout:gsub("\n", "") .. "%"
end
)
-- GPU Temperature
@@ -112,26 +112,26 @@ return function(widget)
3,
function(_, stdout)
local temp_icon
local temp_color
local temp_num = tonumber(stdout)
local temp_icon
local temp_color
local temp_num = tonumber(stdout)
if temp_num < 50 then
temp_color = color["Green200"]
temp_icon = icon_dir .. "thermometer-low.svg"
elseif temp_num >= 50 and temp_num < 80 then
temp_color = color["Orange200"]
temp_icon = icon_dir .. "thermometer.svg"
elseif temp_num >= 80 then
temp_color = color["Red200"]
temp_icon = icon_dir .. "thermometer-high.svg"
if temp_num < 50 then
temp_color = color["Green200"]
temp_icon = icon_dir .. "thermometer-low.svg"
elseif temp_num >= 50 and temp_num < 80 then
temp_color = color["Orange200"]
temp_icon = icon_dir .. "thermometer.svg"
elseif temp_num >= 80 then
temp_color = color["Red200"]
temp_icon = icon_dir .. "thermometer-high.svg"
end
Hover_signal(gpu_temp_widget, temp_color, color["Grey900"])
gpu_temp_widget.container.gpu_layout.icon_margin.icon_layout.icon:set_image(temp_icon)
gpu_temp_widget:set_bg(temp_color)
gpu_temp_widget.container.gpu_layout.label.text = tostring(temp_num) .. "°C"
end
Hover_signal(gpu_temp_widget, temp_color)
gpu_temp_widget.container.gpu_layout.icon_margin.icon_layout.icon:set_image(temp_icon)
gpu_temp_widget:set_bg(temp_color)
gpu_temp_widget.container.gpu_layout.label.text = tostring(temp_num) .. "°C"
end
)
if widget == "usage" then