From 230836bb7ca318aec7bad8442954da611d06a172 Mon Sep 17 00:00:00 2001 From: Juraj Hlista Date: Wed, 31 Jan 2024 17:01:18 +0100 Subject: [PATCH] hyprland: fix hyprctl crash `/tmp/hypr` must be present so `hyprctl` doesn't crash. --- modules/services/window-managers/hyprland.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index 65cf0c316..168bab659 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -246,11 +246,13 @@ in { onChange = lib.mkIf (cfg.package != null) '' ( # Execute in subshell so we don't poision environment with vars - # This var must be set for hyprctl to function, but the value doesn't matter. - export HYPRLAND_INSTANCE_SIGNATURE="bogus" - for i in $(${cfg.finalPackage}/bin/hyprctl instances -j | jq ".[].instance" -r); do - HYPRLAND_INSTANCE_SIGNATURE=$i ${cfg.finalPackage}/bin/hyprctl reload config-only - done + if [[ -d "/tmp/hypr" ]]; then + # This var must be set for hyprctl to function, but the value doesn't matter. + export HYPRLAND_INSTANCE_SIGNATURE="bogus" + for i in $(${cfg.finalPackage}/bin/hyprctl instances -j | jq ".[].instance" -r); do + HYPRLAND_INSTANCE_SIGNATURE=$i ${cfg.finalPackage}/bin/hyprctl reload config-only + done + fi ) ''; };