1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-28 17:38:33 +02:00

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
This commit is contained in:
Cole Helbling 2020-03-12 23:17:36 -07:00 committed by Robert Helgesson
parent fe145b12cd
commit 8571e568e0
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89

View File

@ -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