swayest_workstyle
swayest_workstyle copied to clipboard
Lockfile should be in $XDG_RUNTIME_DIR rather than /tmp
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