Files
Arch-R/scripts/archr-bluetooth-agent
Douglas Teles 06dc2d16f3 Add system scripts, services, and boot splash
System daemons: hotkeys (volume/brightness), automount, bluetooth agent,
memory manager, sleep/suspend, USB gadget mode, save-config persistence.

Boot splash: initramfs SVG renderer (fbsplash + svg_parser) for 0.7s splash.

Panel tools: generate-panel-dtbos.sh rewrite, convert-panel.py for ROCKNIX
panel data extraction, archr-dtbo.py for runtime overlay management.

Input: archr-gptokeyb.c gamepad-to-keyboard mapper via uinput.

Launch wrappers: emulationstation.sh and retroarch-launch.sh updated for
KMS/DRM + Mesa 26 Panfrost environment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 17:22:30 -03:00

43 lines
1.1 KiB
Bash

#!/bin/bash
# Arch R — Bluetooth Auto-Pairing Agent
# Accepts pairing requests and configures connected devices as input devices.
# Runs as a systemd service alongside bluetoothd.
log() { logger -t archr-bt-agent "$1"; }
# Wait for bluetoothd to be ready
for i in $(seq 1 30); do
bluetoothctl show &>/dev/null && break
sleep 1
done
log "Bluetooth agent starting..."
# Power on and make discoverable
bluetoothctl power on 2>/dev/null
bluetoothctl discoverable on 2>/dev/null
bluetoothctl pairable on 2>/dev/null
# Set default agent
bluetoothctl agent NoInputNoOutput 2>/dev/null
bluetoothctl default-agent 2>/dev/null
log "Bluetooth agent ready (NoInputNoOutput mode)"
# Monitor connections and auto-trust paired devices
while true; do
# Get list of paired devices
PAIRED=$(bluetoothctl paired-devices 2>/dev/null | awk '{print $2}')
for dev in $PAIRED; do
# Auto-trust paired devices
TRUSTED=$(bluetoothctl info "$dev" 2>/dev/null | grep "Trusted: yes")
if [ -z "$TRUSTED" ]; then
bluetoothctl trust "$dev" 2>/dev/null
log "Auto-trusted: $dev"
fi
done
sleep 10
done