User Tools

Site Tools


ubuntu:mouse:determine_the_mouse

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu:mouse:determine_the_mouse [2021/10/25 08:11] peterubuntu:mouse:determine_the_mouse [2021/10/26 16:35] (current) – [Device Vendor Name (Manufacturer)] peter
Line 38: Line 38:
 ---- ----
  
-===== Which of the **id** to use =====+===== Which id to use ===== 
 + 
 +In the above results, the **Razer DeathAdder** is shown multiple times. 
 + 
 +  * Only the salient id is needed.
  
 <code bash> <code bash>
Line 58: Line 62:
     * This id may change upon system reboot, so for any future scripts using the id, it is best this is calculated beforehand: <code bash>     * This id may change upon system reboot, so for any future scripts using the id, it is best this is calculated beforehand: <code bash>
 xinput | grep -m 1 "DeathAdder" | sed 's/^.*id=\([0-9]*\)[ \t].*$/\1/' xinput | grep -m 1 "DeathAdder" | sed 's/^.*id=\([0-9]*\)[ \t].*$/\1/'
 +</code>
 +    * returns: <code bash>
 +8
 +</code>
 +
 +</WRAP>
 +
 +----
 +
 +===== Determine Other Device Idenfiers =====
 +
 +==== Device Product Name (Model) ====
 +
 +The Product Name (or model):
 +
 +<code bash>
 +xinput --list --short
 </code> </code>
  
Line 63: Line 84:
  
 <code bash> <code bash>
-8+... 
 +Razer Razer DeathAdder V2 
 +...
 </code> </code>
 +
 +<WRAP info>
 +**NOTE:** This is the same as above.
 +</WRAP>
 +
 +----
 +
 +==== Determine the Device Node ====
 +
 +<code bash>
 +xinput list-props 8 | grep 'Device Node'
 +</code>
 +
 +returns:
 +
 +<code bash>
 +Device Node (279): "/dev/input/event7"
 +</code>
 +
 +----
 +==== Device Vendor Name (Manufacturer) ====
 +
 +The manufacturer or vendor name:
 +
 +<code bash>
 +udevadm info --query=property --name=/dev/input/event7 | grep 'VENDOR='
 +</code>
 +
 +returns:
 +
 +<code bash>
 +ID_VENDOR=Razer
 +</code>
 +
 +<WRAP info>
 +**NOTE:** This is the same as above.
 +</WRAP>
 +
 +----
 +
 +<code bash>
 +udevadm info --query=all --path=$(udevadm info --query=path --name=$(xinput list-props `xinput | grep -m 1 "DeathAdder" | sed 's/^.*id=\([0-9]*\)[ \t].*$/\1/'` | grep 'Device Node'| awk '{ print $4; }' | sed 's/\"//g'))
 +
 +or
 +
 +udevadm info --query=all --path=$(udevadm info --query=path --name=/dev/input/event7)
 +</code>
 +
 +returns:
 +
 +<code bash>
 +P: /devices/pci0000:00/0000:00:08.1/0000:0b:00.3/usb5/5-1/5-1:1.0/0003:1532:0084.0006/input/input25/event7
 +N: input/event7
 +L: 0
 +S: input/by-id/usb-Razer_Razer_DeathAdder_V2-event-mouse
 +S: input/by-path/pci-0000:0b:00.3-usb-0:1:1.0-event-mouse
 +E: DEVPATH=/devices/pci0000:00/0000:00:08.1/0000:0b:00.3/usb5/5-1/5-1:1.0/0003:1532:0084.0006/input/input25/event7
 +E: DEVNAME=/dev/input/event7
 +E: MAJOR=13
 +E: MINOR=71
 +E: SUBSYSTEM=input
 +E: USEC_INITIALIZED=2059106657497
 +E: ID_INPUT=1
 +E: ID_INPUT_MOUSE=1
 +E: ID_VENDOR=Razer
 +E: ID_VENDOR_ENC=Razer
 +E: ID_VENDOR_ID=1532
 +E: ID_MODEL=Razer_DeathAdder_V2
 +E: ID_MODEL_ENC=Razer\x20DeathAdder\x20V2
 +E: ID_MODEL_ID=0084
 +E: ID_REVISION=0200
 +E: ID_SERIAL=Razer_Razer_DeathAdder_V2
 +E: ID_TYPE=hid
 +E: ID_BUS=usb
 +E: ID_USB_INTERFACES=:030102:030001:030101:030002:
 +E: ID_USB_INTERFACE_NUM=00
 +E: ID_USB_DRIVER=usbhid
 +E: ID_PATH=pci-0000:0b:00.3-usb-0:1:1.0
 +E: ID_PATH_TAG=pci-0000_0b_00_3-usb-0_1_1_0
 +E: LIBINPUT_DEVICE_GROUP=3/1532/84:usb-0000:0b:00.3-1
 +E: DEVLINKS=/dev/input/by-id/usb-Razer_Razer_DeathAdder_V2-event-mouse /dev/input/by-path/pci-0000:0b:00.3-usb-0:1:1.0-event-mouse
 +</code>
 +
 +
 +----
 +
 +==== Other way to obtain information ====
 +
 +For USB devices:
 +
 +<code bash>
 +lsusb -v | grep -e idProduct -e idVendor
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  lsusb uses /var/lib/usbutils/usb.ids to translate ids to names.
 +</WRAP>
 +
 +----
 +
 +For the IDs only:
 +
 +<code bash>
 +grep . /sys/bus/usb/devices/*/id*
 +</code>
 +
 +
 +----
 +
 +==== XOrg Configuration ====
 +
 +Putting it all together, a new XOrg configuration **InputClass** Section would look like:
 +
 +<file bash /usr/share/X11/xorg.conf.d/60-razer-deathadder-v2.conf>
 +Section "InputClass"
 +    Identifier "Razer Deathadder v2"
 +    MatchDevicePath "/dev/input/event*"
 +    MatchProduct "Razer Razer DeathAdder V2"
 +    MatchVendor "Razer"
 +EndSection
 +</file>
 +
 +<WRAP info>
 +**NOTE:**  See [[Ubuntu:Mouse:Change Mouse Properties|Change Mouse Properties]].
  
 </WRAP> </WRAP>
  
ubuntu/mouse/determine_the_mouse.1635149501.txt.gz · Last modified: 2021/10/25 08:11 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki