Bragi protocol over hidraw, device service with heartbeat and notifications, PySide6 UI with animated preview, profiles, tray, autostart, udev rule and installer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
31 lines
1.3 KiB
Bash
Executable File
31 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
# Installs K65 Studio for the current user (app) and the udev rule (system, needs sudo).
|
|
set -eu
|
|
SRC="$(cd "$(dirname "$0")" && pwd)"
|
|
PREFIX="${PREFIX:-$HOME/.local}"
|
|
APPDIR="$PREFIX/share/k65studio"
|
|
|
|
python3 -c "import PySide6" 2>/dev/null || { echo "PySide6 fehlt: sudo pacman -S pyside6"; exit 1; }
|
|
|
|
mkdir -p "$APPDIR" "$PREFIX/bin" "$PREFIX/share/applications" "$PREFIX/share/icons/hicolor/scalable/apps"
|
|
rm -rf "$APPDIR/k65studio"
|
|
cp -r "$SRC/k65studio" "$APPDIR/"
|
|
find "$APPDIR" -name __pycache__ -prune -exec rm -rf {} +
|
|
|
|
cat > "$PREFIX/bin/k65studio" <<LAUNCHER
|
|
#!/bin/sh
|
|
PYTHONPATH="$APPDIR\${PYTHONPATH:+:\$PYTHONPATH}" exec python3 -m k65studio "\$@"
|
|
LAUNCHER
|
|
chmod +x "$PREFIX/bin/k65studio"
|
|
cp "$SRC/packaging/k65studio.desktop" "$PREFIX/share/applications/"
|
|
cp "$SRC/k65studio/assets/k65studio.svg" "$PREFIX/share/icons/hicolor/scalable/apps/"
|
|
echo "App installiert nach $APPDIR (Start: k65studio)"
|
|
|
|
if [ ! -f /etc/udev/rules.d/60-k65studio.rules ] || ! cmp -s "$SRC/packaging/60-k65studio.rules" /etc/udev/rules.d/60-k65studio.rules; then
|
|
echo "Installiere udev-Regel (sudo)..."
|
|
sudo install -m 644 "$SRC/packaging/60-k65studio.rules" /etc/udev/rules.d/60-k65studio.rules
|
|
sudo udevadm control --reload-rules
|
|
sudo udevadm trigger --subsystem-match=hidraw
|
|
fi
|
|
echo "Fertig."
|