Fix duplicate CAVA instances via lockfile
pkill pattern was wrong (path has dancingcharacter not skeledance). Now uses a lockfile to prevent QML from spawning multiple instances. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
39e7c07309
commit
d0f72716c2
1 changed files with 11 additions and 2 deletions
|
|
@ -1,6 +1,15 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
pkill -f "cava -p.*skeledance" 2>/dev/null
|
LOCK=/tmp/skeledance_cava.lock
|
||||||
pkill -f "cava-server.py" 2>/dev/null
|
|
||||||
|
# Prevent multiple instances
|
||||||
|
if [ -f "$LOCK" ] && kill -0 "$(cat "$LOCK")" 2>/dev/null; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo $$ > "$LOCK"
|
||||||
|
trap 'rm -f "$LOCK"' EXIT
|
||||||
|
|
||||||
|
pkill -x cava 2>/dev/null
|
||||||
|
pkill -f cava-server 2>/dev/null
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
|
|
||||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue