Files
ports/sysutils/solaar/files/devd-solaar.awk
T
Tobias Kortkamp a3543facbc sysutils/solaar: Update to 1.0.1
- Add an awk script that converts the udev rules to a devd config at
  build time and drop the manually maintained file
- Follow GitHub account rename

Changes:	https://github.com/pwr/Solaar/compare/0.9.2-259-gc07c115...1.0.1
Changes:	https://github.com/pwr-Solaar/Solaar/releases
2019-08-05 15:05:59 +00:00

36 lines
905 B
Awk

/^ATTRS/ {
split($0, attrs, /(==|")/)
vendor = attrs[3]
product = attrs[6]
if (devices[vendor] == "") {
devices[vendor] = sprintf("0x%s", product);
} else {
devices[vendor] = sprintf("%s|0x%s", devices[vendor], product);
}
}
END {
printf \
"# Allows non-root users to have raw access to Logitech Unifying USB\n" \
"# Receiver devices.\n\n"
for (vendor in devices) {
if (devices[vendor] ~ /\|/) {
products = sprintf("(%s)", devices[vendor])
} else {
products = devices[vendor]
}
printf \
"notify 100 {\n" \
" match \"system\" \"USB\";\n" \
" match \"subsystem\" \"DEVICE\";\n" \
" match \"type\" \"ATTACH\";\n" \
" match \"vendor\" \"0x%s\";\n" \
" match \"product\" \"%s\";\n" \
"# Please uncomment the line below and change the group name to suit\n" \
"# your own needs.\n" \
"# action \"chgrp solaar /dev/$cdev && chmod 660 /dev/$cdev\";\n" \
"};\n\n", vendor, products
}
}