You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
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
toexec sworkstyle &> $XDG_STATE_HOME/sworkstyle.log
The text was updated successfully, but these errors were encountered: