Set up a radio radio knows when it's plugged in, with radio configure --auto
A udev rule starts the hampack-radio-plugged user service when a USB serial port appears, and it runs `radio configure --auto`. That sets up a radio recognised by its USB serial number, unless the radio set up already is plugged in, and says what it did in a desktop notification. It never asks a radio what it is, since that may key the transmitter, and never asks for sudo, so a running Graywolf is skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f2e29ab46d
commit
8d15d2c81e
+13
-3
@@ -266,11 +266,21 @@ if [ -f "$RIGCTLD_UNIT" ]; then
|
||||
systemctl --user daemon-reload 2> /dev/null
|
||||
fi
|
||||
|
||||
# The service update.sh installed to set up a radio when it's plugged in
|
||||
RADIO_SERVICE="${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user/hampack-radio-plugged.service"
|
||||
if [ -f "$RADIO_SERVICE" ]; then
|
||||
rm -f "$RADIO_SERVICE"
|
||||
systemctl --user daemon-reload 2> /dev/null
|
||||
fi
|
||||
|
||||
# The udev rules update.sh installed
|
||||
UDEV_RULES="${HAMPACK_UDEV_RULES_DIR:-/etc/udev/rules.d}/70-hampack-cm108.rules"
|
||||
if [ -e "$UDEV_RULES" ]; then
|
||||
UDEV_RULES=()
|
||||
for rules in "${HAMPACK_UDEV_RULES_DIR:-/etc/udev/rules.d}"/70-hampack-{cm108,radio}.rules; do
|
||||
[ ! -e "$rules" ] || UDEV_RULES+=("$rules")
|
||||
done
|
||||
if [ ${#UDEV_RULES[@]} -gt 0 ]; then
|
||||
echo "Removing HamPack's udev rules..."
|
||||
sudo rm -f "$UDEV_RULES" && sudo udevadm control --reload-rules
|
||||
sudo rm -f "${UDEV_RULES[@]}" && sudo udevadm control --reload-rules
|
||||
fi
|
||||
|
||||
# The flrig autostart entry `radio configure --flrig` added, marked as HamPack's
|
||||
|
||||
Reference in New Issue
Block a user