.plan | rss | finger | motd | adduser | login
Login: rjc                              Name: Rafał "Raf" Członka
Directory: /home/rjc                   Shell: /bin/plan.cat
Last login Sat Jul 18 17:37:46 2020 UTC
Mail forwarded to rczlonka+plancat@gmail.com.
Plan:

Figuring out how to get hotplugd(8) to change permission bits and/or ownership
on a USB game contoller (gamepad) multiple HID device nodes - so far, it isn't
playing ball. So far, I have:

#!/bin/sh

devclass=$1
devname=$2

case $devclass in
0)
        case $devname in
        uaudio*)
                rcctl reload sndiod
                ;;
        ugen*)
busname=$(usbdevs -vv | egrep "Controller|$devname\$" | grep -B
1 "$devname\$" | awk -F'[ :]' '/^Controller/ { print $2 }')
                echo $busname > /var/run/${devname}.bus
                chown _cups:_saned /dev/${devname}.* &&
                        chmod 660 /dev/${devname}.*
                chown _cups:_saned $busname &&
                        chmod 660 $busname
                ;;
        uhid*)
                for uhid in $devname
                do
                        test -c /dev/$uhid && {
                                user=$(/usr/local/bin/find-x11-user) &&
                                        chown "$user" /dev/$uhid
                        }
                done
                ;;
        esac
        ;;
esac

What am I missing?