Fix string to number conversion

This commit is contained in:
don philipe
2023-12-17 21:08:03 +01:00
parent 4fa74ea78c
commit a7b10c63fa

View File

@@ -48,11 +48,11 @@ awful.tooltip(
preferred_positions = { "right", "left", "top", "bottom" }, preferred_positions = { "right", "left", "top", "bottom" },
timer_function = function() timer_function = function()
local num_vpnc_proc = awful.spawn.with_shell("ps aux | grep vpnc | wc -l") local num_vpnc_proc = awful.spawn.with_shell("ps aux | grep vpnc | wc -l")
if (num_vpnc_proc > 1) then if (tonumber(num_vpnc_proc) > 1) then
return "VPNC" return "VPNC"
end end
local num_openconnect_proc = awful.spawn.with_shell("ps aux | grep openconnect | wc -l") local num_openconnect_proc = awful.spawn.with_shell("ps aux | grep openconnect | wc -l")
if (num_openconnect_proc > 1) then if (tonumber(num_openconnect_proc) > 1) then
return "OPENCONNECT" return "OPENCONNECT"
end end
end end