diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index 1f7f8d74..4ee2d598 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -66,6 +66,11 @@ std::string getRuntimeDir() { std::vector instances() { std::vector result; + try { + if (!std::filesystem::exists(getRuntimeDir())) + return {}; + } catch (std::exception& e) { return {}; } + for (const auto& el : std::filesystem::directory_iterator(getRuntimeDir())) { if (!el.is_directory() || !std::filesystem::exists(el.path().string() + "/hyprland.lock")) continue;