#!/bin/sh
# SPDX-FileCopyrightText: 2026 Adam DePrince
# SPDX-License-Identifier: Apache-2.0
set -e
if [ "$1" = configure ]; then
    if command -v udevadm >/dev/null 2>&1; then
        udevadm control --reload-rules || true
    fi
    modprobe uinput || true
    if command -v udevadm >/dev/null 2>&1; then
        udevadm trigger --subsystem-match=misc --sysname-match=uinput || true
    fi
    if command -v update-desktop-database >/dev/null 2>&1; then
        update-desktop-database -q /usr/share/applications || true
    fi
    echo 'SereniBrain Mouse installed. Log out and back in once for Bluetooth menu integration.'
    echo 'You can open SereniBrain Mouse from Applications immediately.'
fi
