mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
i3: fix reloading when there are several sockets
This can happen after logout/login. Fixes #527
This commit is contained in:
parent
989d4fa536
commit
c5adf29545
1 changed files with 7 additions and 4 deletions
|
@ -249,10 +249,13 @@ in {
|
||||||
xdg.configFile."i3/config" = {
|
xdg.configFile."i3/config" = {
|
||||||
source = checkI3Config;
|
source = checkI3Config;
|
||||||
onChange = ''
|
onChange = ''
|
||||||
i3Socket=''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*
|
# There may be several sockets after log out/log in, but the old ones
|
||||||
if [ -S $i3Socket ]; then
|
# will fail with "Connection refused".
|
||||||
${cfg.package}/bin/i3-msg -s $i3Socket reload >/dev/null
|
for i3Socket in ''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*; do
|
||||||
fi
|
if [[ -S $i3Socket ]]; then
|
||||||
|
${cfg.package}/bin/i3-msg -s $i3Socket reload >/dev/null |& grep -v "Connection refused" || true
|
||||||
|
fi
|
||||||
|
done
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue