26 lines
974 B
Bash
26 lines
974 B
Bash
#!/usr/bin/env bash
|
|
# Second root step: let sf-remote own the Siri Remote's HID service.
|
|
# BlueZ's HID (HoG) plugin drops the remote's vendor reports, so we disable it
|
|
# and sf-remote reads the GATT characteristics itself over D-Bus.
|
|
# Run: sudo bash setup-host-2.sh
|
|
set -euo pipefail
|
|
|
|
if command -v dnf >/dev/null; then
|
|
dnf install -y dbus-devel pkgconf-pkg-config
|
|
elif command -v apt-get >/dev/null; then
|
|
apt-get install -y libdbus-1-dev pkg-config
|
|
fi
|
|
|
|
BTD=$(systemctl cat bluetooth | sed -n 's/^ExecStart=\(\/[^ ]*bluetoothd\).*/\1/p' | head -1)
|
|
mkdir -p /etc/systemd/system/bluetooth.service.d
|
|
cat >/etc/systemd/system/bluetooth.service.d/smartfox.conf <<EOF
|
|
[Service]
|
|
ExecStart=
|
|
ExecStart=$BTD --noplugin=input,hog
|
|
EOF
|
|
systemctl daemon-reload
|
|
systemctl restart bluetooth
|
|
sleep 2
|
|
systemctl --no-pager status bluetooth | head -5
|
|
echo "== done (undo: rm /etc/systemd/system/bluetooth.service.d/smartfox.conf && systemctl daemon-reload && systemctl restart bluetooth)"
|