diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2009-12-15 11:49:12 +0100 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2009-12-15 11:49:12 +0100 |
commit | 9c0c2fe6bb6c3e73d54c65149657dcfdba9b20b0 (patch) | |
tree | 7a95a9241ba663b15b3b2a4cb12537127e7d7ead | |
parent | 8350d0b9ec1f1b47e84549cb1cdd68127ed0e89b (diff) |
keymap: fix findkeyboards
Update findkeyboards for the recent ID_CLASS deprecation, use ID_INPUT_KEYBOARD
instead. This simplifies the logic a bit, too.
-rwxr-xr-x | extras/keymap/findkeyboards | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/extras/keymap/findkeyboards b/extras/keymap/findkeyboards index 4fafc7775d..acff534056 100755 --- a/extras/keymap/findkeyboards +++ b/extras/keymap/findkeyboards @@ -17,21 +17,18 @@ # print a list of input devices which are keyboard-like keyboard_devices() { - input_devs=`udevadm trigger --dry-run --verbose --subsystem-match=input --attr-match=dev` - # standard AT keyboard - for dev in $input_devs; do + for dev in `udevadm trigger --dry-run --verbose --property-match=ID_INPUT_KEYBOARD=1`; do walk=`udevadm info --attribute-walk --path=$dev` - env=`udevadm info --query=env --path=$dev` - + env=`udevadm info --query=env --path=$dev` if echo "$walk" | grep -q 'DRIVERS=="atkbd"'; then echo -n 'AT keyboard: ' - udevadm info --query=name --path=$dev - fi - if echo "$env"| grep -q '^ID_CLASS=kbd' && echo "$env" | grep -q '^ID_USB_DRIVER=usbhid'; then + elif echo "$env" | grep -q '^ID_USB_DRIVER=usbhid'; then echo -n 'USB keyboard: ' - udevadm info --query=name --path=$dev + else + echo -n 'Unknown type: ' fi + udevadm info --query=name --path=$dev done # modules |