i3-sway: only return current user's socket (#2914)
Constrain the pgrep command to only return results for the current user. Additionally, quote the socket variables to prevent splitting. Previously, if multiple users on a system were running `sway`, the `pgrep` used in finding `swaySocket` would return multiple results. As a result, reloads of sway would fail. Fixes #2912.
This commit is contained in:
parent
65a32578d9
commit
6f025b3825
|
@ -434,8 +434,8 @@ 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.$(${pkgs.procps}/bin/pgrep -x sway || true).sock
|
swaySocket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/sway-ipc.$UID.$(${pkgs.procps}/bin/pgrep --uid $UID -x sway || true).sock"
|
||||||
if [ -S $swaySocket ]; then
|
if [ -S "$swaySocket" ]; then
|
||||||
${pkgs.sway}/bin/swaymsg -s $swaySocket reload
|
${pkgs.sway}/bin/swaymsg -s $swaySocket reload
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue