logoalt Hacker News

jmgao • yesterday at 9:24 PM • 0 replies • view on HN

What the fuck. Thanks, I think you just solved a bug that's been on my TODO list for like 6 months.

I wrote a library [1] that lets you use CSS selectorish syntax to select USB devices (e.g. "any device that's on port 3 of a hub that also has a Logitech device connected on port 4" -> "(!hub > device[vid=046d, port=4]) > device[port=3]") so I could do automations for things like plugging in my laptop at one desk vs another, but one of my selectors I use on my desktop for a USB-C cable would rarely fail to trigger despite the device definitely being connected and working. I'll have to check this when I get home...

1: https://github.com/jmgao/usbselector