summaryrefslogtreecommitdiff
path: root/hyprctl
diff options
context:
space:
mode:
Diffstat (limited to 'hyprctl')
-rw-r--r--hyprctl/main.cpp5
1 files changed, 5 insertions, 0 deletions
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<SInstanceData> instances() {
std::vector<SInstanceData> 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;