mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00: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" = {
|
||||
source = checkI3Config;
|
||||
onChange = ''
|
||||
i3Socket=''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*
|
||||
if [ -S $i3Socket ]; then
|
||||
${cfg.package}/bin/i3-msg -s $i3Socket reload >/dev/null
|
||||
fi
|
||||
# There may be several sockets after log out/log in, but the old ones
|
||||
# will fail with "Connection refused".
|
||||
for i3Socket in ''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*; do
|
||||
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