Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lockfile should be in $XDG_RUNTIME_DIR rather than /tmp #40

Open
jasyip opened this issue Jul 8, 2023 · 0 comments
Open

Lockfile should be in $XDG_RUNTIME_DIR rather than /tmp #40

jasyip opened this issue Jul 8, 2023 · 0 comments

Comments

@jasyip
Copy link

jasyip commented Jul 8, 2023

The lockfile should be set to $XDG_RUNTIME_DIR/sworkstyle.lock instead of /tmp/sworkstyle.lock as it may be possible that more than one user may use sway and this program simultaneously. If the lock file is in /tmp/ without accounting for invoking UID, then only one user can use sworkstyle at a time and it would think it's already locked for the other person. $XDG_RUNTIME_DIR is meant to basically be a temporary directory for individual users and would allow individual non-conflicting lockfiles.

To enforce XDG Base directory compliance even further, I would recommend changing the example for Sway configuration in the README from exec sworkstyle &> /tmp/sworkstyle.log to exec sworkstyle &> $XDG_STATE_HOME/sworkstyle.log

@jasyip jasyip changed the title $XDG_RUNTIME_DIR should be preferred over /tmp Lockfile should be in $XDG_RUNTIME_DIR rather than /tmp Jul 8, 2023
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

No branches or pull requests

1 participant