From 8571e568e05e3abcc676c86fa06ea13f6c09f9a4 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Thu, 12 Mar 2020 23:17:36 -0700 Subject: [PATCH] sway: fix onChange when defunct sockets exist Fixes `..../generation/activate: line 181: [: too many arguments` when, for whatever reason, the user has multiple `sway-ipc` sockets. PR #1086 --- modules/services/window-managers/i3-sway/sway.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index 31a94e46..314d9210 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -379,7 +379,7 @@ in { xdg.configFile."sway/config" = { source = configFile; onChange = '' - swaySocket=''${XDG_RUNTIME_DIR:-/run/user/$UID}/sway-ipc.$UID.*.sock + swaySocket=''${XDG_RUNTIME_DIR:-/run/user/$UID}/sway-ipc.$UID.$(${pkgs.procps}/bin/pgrep -x sway).sock if [ -S $swaySocket ]; then echo "Reloading sway" $DRY_RUN_CMD ${cfg.package}/bin/swaymsg -s $swaySocket reload