From 6cdda097c1c81b1e105a86d70d02b2d482255718 Mon Sep 17 00:00:00 2001 From: Rene Kievits Date: Thu, 22 Sep 2022 18:18:37 +0200 Subject: [PATCH] fix two nil errors --- awesome/src/modules/notification-center/status_bars.lua | 1 + awesome/src/tools/helpers/cpu_temp.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/awesome/src/modules/notification-center/status_bars.lua b/awesome/src/modules/notification-center/status_bars.lua index eeaff11..df96d79 100644 --- a/awesome/src/modules/notification-center/status_bars.lua +++ b/awesome/src/modules/notification-center/status_bars.lua @@ -346,6 +346,7 @@ return function() capi.awesome.connect_signal( "update::gpu_usage", function(gpu_usage) + if not gpu_usage then return end tooltip.text = "GPU Usage: " .. gpu_usage .. "%" rubato_timer.target = tonumber(gpu_usage) end diff --git a/awesome/src/tools/helpers/cpu_temp.lua b/awesome/src/tools/helpers/cpu_temp.lua index 54690e2..1ef97c5 100644 --- a/awesome/src/tools/helpers/cpu_temp.lua +++ b/awesome/src/tools/helpers/cpu_temp.lua @@ -14,6 +14,7 @@ watch( awful.spawn.easy_async_with_shell( "paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp)", 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) capi.awesome.emit_signal( "update::cpu_temp",