Pause flips bank 1 between the cans (36-51) and the movers (84-99). Threshold flashes the cans on bass hits and is exclusive with Sound, and knob 6 is the sides' peak. The Sound and Threshold pads light while on, and the colour pads that were on are pressed again when QLC+ reloads the show. --lock-knobs is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
56 lines
1.8 KiB
Bash
Executable File
56 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Install the SMC-PAD pad controller as a systemd user service and start it.
|
|
#
|
|
# padcontroller/systemd/install.sh # install, enable, start
|
|
# padcontroller/systemd/install.sh --no-lamps # pass options to the pad controller
|
|
# padcontroller/systemd/install.sh --no-enable # install only; start it with
|
|
# # systemctl --user start padcontroller
|
|
# padcontroller/systemd/install.sh --uninstall
|
|
#
|
|
# Logs: journalctl --user -u padcontroller -f
|
|
set -euo pipefail
|
|
|
|
UNIT=padcontroller.service
|
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
ROOT="$(cd "$HERE/../.." && pwd)"
|
|
DEST="${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user"
|
|
|
|
if [[ "${1:-}" == "--uninstall" ]]; then
|
|
systemctl --user disable --now "$UNIT" 2>/dev/null || true
|
|
rm -f "$DEST/$UNIT"
|
|
systemctl --user daemon-reload
|
|
echo "Removed $UNIT."
|
|
exit 0
|
|
fi
|
|
|
|
PYTHON="$ROOT/.venv/bin/python"
|
|
[[ -x "$PYTHON" ]] || PYTHON="$(command -v python3)"
|
|
"$PYTHON" -c "import rtmidi" 2>/dev/null || {
|
|
echo "$PYTHON cannot import rtmidi. Run pipenv install (or pip install python-rtmidi) first." >&2
|
|
exit 1
|
|
}
|
|
|
|
ENABLE=1
|
|
if [[ "${1:-}" == "--no-enable" ]]; then
|
|
ENABLE=
|
|
shift
|
|
fi
|
|
|
|
ARGS="$*"
|
|
mkdir -p "$DEST"
|
|
sed -e "s|@ROOT@|$ROOT|g" -e "s|@PYTHON@|$PYTHON|g" -e "s|@ARGS@|$ARGS|g" \
|
|
"$HERE/$UNIT" >"$DEST/$UNIT"
|
|
|
|
systemctl --user daemon-reload
|
|
if [[ -z "$ENABLE" ]]; then
|
|
# Undo an earlier enable, so it does not start at login here.
|
|
systemctl --user disable "$UNIT" 2>/dev/null || true
|
|
echo "Installed $DEST/$UNIT. It does not start at login."
|
|
echo "Start it with: systemctl --user start padcontroller"
|
|
exit 0
|
|
fi
|
|
systemctl --user enable "$UNIT"
|
|
systemctl --user restart "$UNIT"
|
|
echo "Installed $DEST/$UNIT and started it."
|
|
systemctl --user --no-pager status "$UNIT" | head -5 || true
|