fix two nil errors

This commit is contained in:
Rene Kievits
2022-09-22 18:18:37 +02:00
parent b5c6dc31f7
commit 6cdda097c1
2 changed files with 2 additions and 0 deletions

View File

@@ -346,6 +346,7 @@ return function()
capi.awesome.connect_signal( capi.awesome.connect_signal(
"update::gpu_usage", "update::gpu_usage",
function(gpu_usage) function(gpu_usage)
if not gpu_usage then return end
tooltip.text = "GPU Usage: " .. gpu_usage .. "%" tooltip.text = "GPU Usage: " .. gpu_usage .. "%"
rubato_timer.target = tonumber(gpu_usage) rubato_timer.target = tonumber(gpu_usage)
end end

View File

@@ -14,6 +14,7 @@ watch(
awful.spawn.easy_async_with_shell( awful.spawn.easy_async_with_shell(
"paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp)", "paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp)",
function(stdout2) function(stdout2)
if (not stdout2) or stdout:match("\n") then return end
temp = math.floor((tonumber(stdout2:match("x86_pkg_temp(.%d+)")) / 1000) + 0.5) temp = math.floor((tonumber(stdout2:match("x86_pkg_temp(.%d+)")) / 1000) + 0.5)
capi.awesome.emit_signal( capi.awesome.emit_signal(
"update::cpu_temp", "update::cpu_temp",