#!/bin/bash

# omarchy:hidden=true
# omarchy:summary=Watch USBGuard for devices awaiting user approval

set -euo pipefail

event_handler="$OMARCHY_PATH/bin/omarchy-usb-authorization-event"

# The handler scans blocked devices on IPC.Connected, including reconnects
# after a daemon restart, once the event subscription is established.
exec usbguard watch --wait --exec "$event_handler"
