-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·27 lines (24 loc) · 897 Bytes
/
Copy pathrun
File metadata and controls
executable file
·27 lines (24 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
# Start (or restart) the Stream Deck controller from source.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT"
if ! compgen -G "/etc/udev/rules.d/*streamdeck*" >/dev/null && \
! grep -qs '0fd9' /etc/udev/rules.d/*.rules 2>/dev/null; then
echo "Missing udev rule for Stream Deck USB access."
echo "Run: $ROOT/setup-once (or replug the deck after installing the rule)"
exit 1
fi
for hid in /dev/hidraw*; do
if udevadm info -a -n "$hid" 2>/dev/null | grep -q 'ATTRS{idVendor}=="0fd9"'; then
if [ ! -r "$hid" ] || [ ! -w "$hid" ]; then
echo "Cannot access $hid (Stream Deck) — update udev rule and replug the deck:"
echo " ./setup-once"
exit 1
fi
break
fi
done
pkill -f "[p]ython -m streamdeck_app.controller" 2>/dev/null || true
sleep 0.2
exec "$ROOT/.venv/bin/python" -m streamdeck_app.controller