1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 19:49:45 +01: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" = { xdg.configFile."sway/config" = {
source = configFile; source = configFile;
onChange = '' 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 if [ -S $swaySocket ]; then
echo "Reloading sway" echo "Reloading sway"
$DRY_RUN_CMD ${cfg.package}/bin/swaymsg -s $swaySocket reload $DRY_RUN_CMD ${cfg.package}/bin/swaymsg -s $swaySocket reload