Update
This commit is contained in:
9
local/share/sway/scripts/once.sh
Executable file
9
local/share/sway/scripts/once.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
mkdir -p "$HOME/.local/state"
|
||||
LOCKFILE="$HOME/.local/state/once.lock"
|
||||
|
||||
# Kills the process if it's already running
|
||||
lsof -Fp "$LOCKFILE" | sed 's/^p//' | xargs -r kill
|
||||
|
||||
flock --verbose -n "$LOCKFILE" "$@"
|
||||
Reference in New Issue
Block a user