1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19:45 +01:00

i3: fix reloading when there are several sockets

This can happen after logout/login.

Fixes #527
This commit is contained in:
Guillaume Girol 2022-11-05 12:00:00 +00:00 committed by Robert Helgesson
parent 989d4fa536
commit c5adf29545
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -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
''; '';
}; };
} }