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>
16 lines
392 B
Bash
Executable file
16 lines
392 B
Bash
Executable file
#!/usr/bin/env bash
|
|
LOCK=/tmp/skeledance_cava.lock
|
|
|
|
# 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
|
|
|
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cava -p "$DIR/cava.conf" | python3 "$DIR/cava-server.py"
|