From 4b388ee90267a54c5bed0b922ba8669b7d85c427 Mon Sep 17 00:00:00 2001 From: Nikita Uvarov Date: Fri, 25 May 2018 17:25:49 +0200 Subject: [PATCH] i3: fix reloading for nixos module By default, i3-msg gets socket from X11 property which is not available when home manager is running as nixos module. This patch changes i3-msg command call by specifying all i3 sockets found in $XDG_RUNTIME_DIR/i3 folder. Fixes #252. --- modules/services/window-managers/i3.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/services/window-managers/i3.nix b/modules/services/window-managers/i3.nix index 043716642..a6675651c 100644 --- a/modules/services/window-managers/i3.nix +++ b/modules/services/window-managers/i3.nix @@ -763,9 +763,10 @@ in ''; home.activation.reloadI3 = dag.entryAfter [ "linkGeneration" ] '' - if [[ -v i3Changed && -v DISPLAY ]]; then + SOCKET=''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.* + if [ -v i3Changed ] && [ -S $SOCKET ]; then echo "Reloading i3" - ${cfg.package}/bin/i3-msg reload 1>/dev/null + ${cfg.package}/bin/i3-msg -s $SOCKET reload 1>/dev/null fi ''; }