fix two nil errors
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user