add and install udev rules to enable non-root access (thanks to Patrick Huesmann for contribution)

master
Dominic Radermacher 2024-04-18 09:29:38 +02:00
rodzic 8aaeecd84b
commit a51fcf98f8
2 zmienionych plików z 23 dodań i 0 usunięć

Wyświetl plik

@ -69,3 +69,8 @@ add_custom_target(git-version ALL
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ptouch-print.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
if(EXISTS /etc/udev/rules.d)
install(FILES udev/90-usb-ptouch-permissions.rules DESTINATION /etc/udev/rules.d)
install(CODE "execute_process(COMMAND udevadm control --reload-rules)")
endif()

Wyświetl plik

@ -0,0 +1,18 @@
# Enable non-root access for known ptouch printers
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "2007", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "2011", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "2019", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "201f", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "202c", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "202d", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "2041", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "205e", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "205f", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "2061", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "2062", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "2073", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "2074", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "20af", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "20df", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "20e0", MODE = "0666"
SUBSYSTEM == "usb", ATTRS{idVendor} == "04f9", ATTRS{idProduct} == "20e1", MODE = "0666"