Skip to content

i3-sway: only return current user's socket#2914

Merged
teto merged 1 commit intonix-community:masterfrom
nathantypanski:sway-onchange
Apr 24, 2022
Merged

i3-sway: only return current user's socket#2914
teto merged 1 commit intonix-community:masterfrom
nathantypanski:sway-onchange

Conversation

@nathantypanski
Copy link
Copy Markdown
Contributor

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.

Description

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all.

    • I was only able to run the Sway tests because my local build is blocked by bug: The use of shellDryRun breaks my build #2693 as I don't currently use unstable:
      sway-bindkeys-to-code: OK
      sway-default: OK
      sway-followmouse: OK
      sway-followmouse-legacy: OK
      sway-modules: OK
      sway-no-xwayland: OK
      sway-null-config: OK
      sway-null-package: OK
      sway-post-2003: OK
      sway-workspace-default: OK
      sway-workspace-output: OK
      swaynag-empty-settings: OK
      swaynag-example-settings: OK
      
  • Test cases updated/added. See example.

    • Not sure how to test this as it requires multiple users and home-manager normally only manages one user at a time. Happy to try to make a test case if someone can give me pointers.
  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

    • Added myself and the module files to .github/CODEOWNERS.

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 nix-community#2912.
@teto teto merged commit 6f025b3 into nix-community:master Apr 24, 2022
teto pushed a commit to teto/home-manager that referenced this pull request Apr 28, 2022
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 nix-community#2912.
@teto teto mentioned this pull request Aug 22, 2022
7 tasks
teto pushed a commit to teto/home-manager that referenced this pull request Aug 22, 2022
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 nix-community#2912.
spacekookie pushed a commit to spacekookie/home-manager that referenced this pull request Feb 10, 2023
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 nix-community#2912.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Sway onChange script displays incorrect behavior with multiple Sway processes

2 participants