mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
Take the first 4 bytes of the device id (a sha), parse them as two 2-byte hex values and mod them by the length of a pre-determined array of rodents and their vocalisation methods. This gives us an index and a device name assignement like this: wailing-squirrel: Logitech G500s Laser Gaming Mouse warbling-groundhog: Logitech MX Anywhere 2S humming-hutia: Logitech Gaming Mouse G303 This relies on the sha's first 4 bytes to be unique enough that they don't add up to the same 2 values. Which is probably safe enough. This does not affect ratbag-command which still uses the hidraw nodes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>