rsc-dev / loophole

Polar devices Python API and CLI.
MIT License
148 stars 16 forks source link

Display example udev rule... #10

Closed jedie closed 7 years ago

jedie commented 7 years ago

...and how can it looks like?!?

Maybe display a example udev rule, if the current user can't access, as here #8

Maybe something like this:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0da4", ATTRS{idProduct}=="0008", OWNER="<username>"

Fill ids and username automaticlly. (I don't test this rule and don't know if it`s a good idea and a common rule...)

rsc-dev commented 7 years ago

This is outside the scope of loophole project. Users should know how to run code which needs an access to USB on they system. Error message with suggestion is just fine.

jedie commented 7 years ago

Users should know how to run code which needs an access to USB on they system.

Users should easy use this project, isn't it? ;)

First step was to give them a helpful error message: #9 The Question here is: Is it possible to explicit check if the user has the right permissions ?!? I asked here: https://github.com/walac/pyusb/issues/139#issuecomment-294114589

Next step is to document how to setup the system. IMHO it would be help to display a example udev rule. Why not something like this:

$ loophole --udev Found 1 device. Example udev rule for device 0da4:0008 on Bus 001 Address 004:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0da4", ATTRS{idProduct}=="0008", OWNER=""

More information is in our README ;)