diff --git a/nix-monitor/nix_monitor_service.luau b/nix-monitor/nix_monitor_service.luau index 334249d..7ea991f 100644 --- a/nix-monitor/nix_monitor_service.luau +++ b/nix-monitor/nix_monitor_service.luau @@ -146,20 +146,20 @@ function checkGenerations() setState("lastGenerationsCheckTime", os.time()) noctalia.runAsync(nixosGenerationsCmd, function(result) - setState("nixosGenerations", result.stdout) + setState("nixosGenerations", noctalia.string.trim(result.stdout)) end) noctalia.runAsync(nixosCurrentGenCmd, function(result) - setState("nixosCurrentGen", result.stdout) + setState("nixosCurrentGen", noctalia.string.trim(result.stdout)) end) if getState("hasHomeManager") then noctalia.runAsync(hmGenerationsCmd, function(result) - setState("hmGenerations", result.stdout) + setState("hmGenerations", noctalia.string.trim(result.stdout)) end) noctalia.runAsync(hmCurrentGenCmd, function(result) - setState("hmCurrentGen", result.stdout) + setState("hmCurrentGen", noctalia.string.trim(result.stdout)) end) end end diff --git a/nix-monitor/panel.luau b/nix-monitor/panel.luau index b901a34..2b662d4 100644 --- a/nix-monitor/panel.luau +++ b/nix-monitor/panel.luau @@ -110,7 +110,8 @@ local function render() statLabel(`{tr("panel.current")}: {getState("nixosCurrentGen")}`, "device-desktop-check") } - if getState("hasHomeManager") then + if getState("hasHomeManager") and getState("hmGenerations") ~= "" + and getState("hmCurrentGen") ~= "" then table.insert(generationItems, statLabel(`HM: {getState("hmGenerations")}`, "home") )