490 Commits

Author SHA1 Message Date
Yaroslav Chvanov
925b2a2a0a libratbag 0.17 2022-11-09 10:43:27 +00:00
Yaroslav Chvanov
df42eeb1ca CI: update runners to use Node 16
Fixes warnings.
2022-11-09 10:43:05 +00:00
Yaroslav Chvanov
aab91b4b11 data: add another SinoWealth Generic Mouse (258a:0029) 2022-11-09 10:42:34 +00:00
Yaroslav Chvanov
c39640d943 asus: fix include order
It caused an `implicit function declaration` warning.
2022-10-12 22:16:19 +03:00
Kyoken
0c3cfe71a0 asus: remove extern 2022-10-12 21:20:30 +03:00
Kyoken
dcba13152f asus driver 2022-10-12 18:11:28 +03:00
Andreas Grosse
61da98ffd4 Add Support for G502 X over USB 2022-10-10 21:39:53 +02:00
PeakKS
98eec0941a Add support for G502 X Wireless 2022-09-11 19:21:27 -04:00
Yaroslav Chvanov
d8301414c7 libratbag-data: add a missing include
To fix `Declaration of X will not be visible outside of this function`
Clang warnings.
2022-08-02 12:12:42 +03:00
Yaroslav Chvanov
a4da425298 sinowealth: move device-specific data out of the driver
This moves device data out of the driver into device files. However, a
_single_ device file contains data for _several mice_ at the same time.
The reason for this is that different mice by SinoWealth may use the
same VID:PID pair. This is unfortunate, as we only allow a single
device file a given VID:PID pair.

Also move `sinowealth_led_format` enum into a header file and rename
its constants to fit in outside of the driver.
2022-08-02 12:12:42 +03:00
Yaroslav Chvanov
ea7b4b6821 sinowealth: null-terminate the buffer with firmware version 2022-08-02 12:12:42 +03:00
Yaroslav Chvanov
833468b292 sinowealth: use a constant instead of a magic number 2022-08-02 12:12:39 +03:00
Yaroslav Chvanov
cc954af7a7 steelseries: ensure that device has a version number set
Otherwise there would be hard to diagnose errors later on.
2022-08-01 07:55:40 +00:00
Yaroslav Chvanov
213ccce0a8 steelseries: add fallback button and LED count
Otherwise if there is a device file without them set, will try to create
UINT_MAX-1 instances of them and obviously fail with an out-of-memory
error.
2022-08-01 07:55:40 +00:00
Linus
bb6ab46a1a Fix presumed typo 2022-08-01 09:27:27 +10:00
listout
05c5815fb9 Use fprintf instead of error
hidpp files were using the error function from error.h header file.
Unfortunately not every libc comes with this particular header file, so
with this patch we won't be requiring to be rely on error function and
use fprintf function.

Thanks to developer Yaroslav Chvanov <staticssleever668> for the
original suggestion

Closes: https://github.com/libratbag/libratbag/issues/1253

Signed-off-by: listout <listout@protonmail.com>
2022-07-29 14:22:05 +00:00
Thomas Weißschuh
0fc6764b47 libratbag-data: fix possible NULL dereferences
This can happen when a device has not properly initialized and this
fields have not been set.
2022-07-21 09:09:04 +00:00
Peter Hutterer
07b40316fb test: add the Bolt receiver C548 to the receiver list
Listed here: https://pwr-solaar.github.io/Solaar/devices.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-06-08 12:23:44 +10:00
Sami Olmari
260e4adffc Add device-file for Logitech MX Anywhere 3B (#1313)
This variant stands for Logitech MX Anywhere 3 for Business.

Bluetooth match only, the receiver is not yet supported by the 
kernel and the device thus has the receiver's USB id

Signed-off-by: Sami Olmari <sami@olmari.fi>
2022-06-07 10:08:16 +10:00
Ilya Guterman
8c3c6598c3 hidpp20: verbose log the get current profile 2022-06-06 17:20:42 +03:00
Yaroslav Chvanov
1140875cd8 sinowealth: fix all devices being detected as generic device 2022-06-06 20:13:19 +10:00
Yaroslav Chvanov
f87bccb370 sinowealth: add data for Marvo Scorpion G961
I did not add the data entry for ratbagd though, as there has been
reported breakage with Ant Esports GM500, which uses the same VID:PID.
2022-06-06 07:54:17 +00:00
Yaroslav Chvanov
c1955598fe sinowealth: note that debounce time command doesn't work on shorter mice 2022-06-06 07:54:17 +00:00
Yaroslav Chvanov
d261458cae sinowealth: limit the resolution to sensor's upper bound 2022-06-06 07:54:17 +00:00
Yaroslav Chvanov
ef3822af82 sinowealth: fix crashing on mice with unknown sensors 2022-06-06 07:54:17 +00:00
Yaroslav Chvanov
2d8115d2bf sinowealth: detect sensor type automatically 2022-06-06 07:54:17 +00:00
Yaroslav Chvanov
4c102358a2 sinowealth: make device detection less imperative
..and rename sensor types along the way:
- Prefix them;
- Fix PMW sensors being named PWM.
2022-06-06 07:54:17 +00:00
Yaroslav Chvanov
d133d30f62 sinowealth: add numeric IDs to sensor types
These IDs match the ones in SinoWealth's configuration software.
2022-06-06 07:54:17 +00:00
Yaroslav Chvanov
16a1028e1d sinowealth: add sensor type field to configuration data 2022-06-06 07:54:17 +00:00
Yaroslav Chvanov
704d5d2e65 sinowealth: decrease minimal configuration size
Configuration size on 1007 mice is smaller for sure. With these changes
the driver has been reported to successfully work with Marvo Scorpion
G961.
2022-06-06 07:54:17 +00:00
Yaroslav Chvanov
bef26c1890 sinowealth: make dpi_to_raw return 8 bit number
It would otherwise get converted implicitly anyway.
2022-06-06 07:54:17 +00:00
Yaroslav Chvanov
85241fdd1b sinowealth: handle RGB_NOT_SUPPORTED explicitly
This should technically be unreachable but this is good for code
quality.
2022-06-06 07:54:17 +00:00
Yaroslav Chvanov
2dea887d2f sinowealth: prefix a function name 2022-06-06 07:54:17 +00:00
Yaroslav Chvanov
2004a3c13e sinowealth: fix a typo 2022-06-06 07:54:17 +00:00
Ilya Guterman
48bccf4c98 hidpp20: fetch active profile index only once
currently the active profile index is fetched for each profile,
this adds unnecessary overhead.

change the behavior to fetch the active profile only once during the driver data initialization.
2022-06-06 15:11:02 +10:00
Andreas Schwab
3ea0d44176 meson.build: use valgrind only if available 2022-05-06 15:33:46 +01:00
Ilya Guterman
3e1bc79aac hidpp20: fix set onboard mode 2022-04-29 01:03:45 +03:00
Yaroslav Chvanov
9715c5c150 libratbag-data: fix a memory leak
In driver data of hidpp10 and steelseries drivers `dpi_list` and
`dpi_range` were allocated with calloc, but never got freed.
2022-04-27 22:16:32 +03:00
Yaroslav Chvanov
07f0eafa57 sinowealth: add support for writing macros 2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
72f8708e0e sinowealth: add support for writing key button actions 2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
6ac5ba6dbb sinowealth: add support for changing button mappings 2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
45a8fd9ec3 sinowealth: add support for reading button bindings 2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
e9dff40258 sinowealth: add types for buttons
This button mapping reading and writing support is partially based on a
previous work of @phomes and @enkore. Thank you both very much!
2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
94f28df134 sinowealth: set button count from detected device 2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
4d646db24f sinowealth: fix rave lighting mode settings being shifted by one byte
Turns out I missed a field a bit lower and made an `unknown` section
bigger to compensate for that.
2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
e21366e5e5 sinowealth: mark color order on Genesis Xenon 770 as tested 2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
21ac98e5f9 sinowealth: fix DPI being off by 100 on PWM3327 sensor
Thanks @hrw for testing.
2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
567d666b96 sinowealth: use a union instead of doing pointer arithmetic on DPI slots
This makes the code a bit more self-explaining and less error-prone as
we don't have to think about memory addresses when modifying DPI.
Also fixes several `bugprone-implicit-widening-of-multiplication-result`
clang-tidy warnings.
2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
b62565da56 sinowealth: fix breathing LED mode on 0027 mice 2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
3ff3705dbf sinowealth: add partial support for reading BREATHING7 lighting mode
Only partial as libratbag can only have 1 color in breathing lighting
mode.
2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
2aa9f012fe sinowealth: fix active resolution slot reading and writing
It turns out the field with active resolution only counts active
resolution slots. This was probably missed before because probably no
one sets for instance slots 1 and 3 but disables slot 2. I already added
a comment explaining this behavior before because I noticed this while
trying to implement this in ratbag-python and be surprised it didn't
work, but I didn't notice that the implementation here was lacking.
2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
e7cc62a9c8 sinowealth: return an error code instead of doing an assert
While I doubt it will actually ever get hit, there is no reason to crash
the whole daemon because of this.
2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
0608a0156d sinowealth: don't redundantly unreference a profile
Not needed anymore as a `for_each` macro is now used to get profiles.
2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
3723c5177f sinowealth: add command ID for putting the device into DFU mode
This is not right now and will never be actually used, I put it here
just for the sake of completeness.
2022-04-21 00:37:44 +03:00
Yaroslav Chvanov
9d59c1992a libratbag: remove now unused deprecated driver methods 2022-04-16 02:24:40 +03:00
Yaroslav Chvanov
ee54001032 roccat-kone-pure: migrate to profile-oriented API 2022-04-16 02:24:40 +03:00
Yaroslav Chvanov
7f0d058b66 roccat: migrate to profile-oriented API 2022-04-16 02:24:40 +03:00
Yaroslav Chvanov
cd2ad37db7 etekcity: only write profile once 2022-04-16 02:24:40 +03:00
Yaroslav Chvanov
d08f1f21b7 etekcity: migrate to profile-oriented API 2022-04-16 02:24:40 +03:00
Yaroslav Chvanov
2d21c0dac1 test: migrate to profile-oriented API 2022-04-16 02:24:40 +03:00
Peter Hutterer
7016b50f1b roccat: remove an unnecessary #include
No obvious reason why we need to include that header and it appears to
be glibc-specific. Let's use stdint.h instead (which is already
included).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-02-15 11:32:17 +10:00
Yaroslav Chvanov
217847adde steelseries: only write report rate if it's dirty 2022-02-11 14:32:14 +10:00
Yaroslav Chvanov
c12edcd4c7 steelseries: fix length of LED cycle output report being incorrect
It probably meant to use the macro directly, not `sizeof` of it (which
made it be 4 instead of 64).
2022-02-11 14:31:37 +10:00
Rafael Silva
ae53f6123b ibratbag-hidraw: add optional filter to hidraw read
Currently, these functions will read and timeout after 1s if
no packets were received. The issue with this is that a lot of times we
may catch unrelated packets, such as mouse or keyboard changes.
To solve this, this patch adds a new optional filter argument, when a filter
is passed the functions now will keep reading packets until a valid packet is found.
The filter argument is user written function that returns true or false.

Co-authored-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Rafael Silva <perigoso@riseup.net>
2022-02-04 14:27:08 +10:00
Yaroslav Chvanov
6dbaeaf506 steelseries: fix a memory leak
Found by valgrind. I also feel that there is another memory leak of the
same nature a bit higher in `init_data_hidpp10`.

Introduced by me. :^)
2022-02-01 07:30:01 +10:00
Yaroslav Chvanov
75c8cf83c3 sinowealth: fix several misspellings 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
706fe34382 sinowealth: explain how active_dpi works 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
5e57aa07ea sinowealth: add helpers for doing raw HID queries
Removes a lot of duplicated code.
There is one place, however, where these helpers were not used -
`sinowealth_read_raw_config`. It has some custom handling of data
because of unexpected behavior from mice.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
1f4bf8fe5f sinowealth: rename a struct member to show that it's bit field 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
dadfb06b98 sinowealth: put command buffer size into a macro 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
d3c37a6836 sinowealth: fix two struct fields having swapped places 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
1b04bcffba sinowealth: visually separate config report data specific to long mice 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
e5093e1009 sinowealth: prefix some of our data type names 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
132fc21212 sinowealth: sanity check output of all raw data getters
Well, of almost all, config getter's output is not checked as it may
have seemingly incorrect data in some cases.

Potentially some mice may not support some commands but look like they
do. You can see this guard in action if you run
`sinowealth_print_long_lod_and_anglesnapping` after any other command
that sets 6 byte long buffer on non-long mice.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
3793e32ebd sinowealth: put a macro into an enum 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
4e931cb712 sinowealth: remove a now unused macro 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
e1682171ce sinowealth: improve comments
- Add comments to almost all functions.
- Add comments to some data types and macros.
- Add missing periods where it's needed.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
e1334214b8 sinowealth: make the sensor maximum DPI getter return 0 on error 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
fd0954dbdc sinowealth: remove new-lines between data types and their size checks 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
aa1ab47f59 sinowealth: make update_profile_from_config a void function
It only ever returned `0`.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
7585d73ff5 sinowealth: rename macros with config size to make more sense 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
81ca281f2c sinowealth: don't mark inactive profile as active 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
48d654827e sinowealth: cache current profile index in driver data 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
6c9306b199 sinowealth: store config report in an array 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
a9c0060029 sinowealth: add a macro for profile count 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
a289612d85 sinowealth: initialize all variables
While none of them were actually used before being initialized, I got
tired of constantly seeing `uninitialized variable` warnings in my
editor.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
f7b7007897 sinowealth: declare a variable right before it's initialization
It's not in the beginning of the function anyway, so why not make it a
bit more concise.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
16333068b7 sinowealth: use for_each instead of manually getting profiles 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
eace92870a sinowealth: set the command before writing config
This will help if the config report has a different command in it for
some reason. This has happened to me when I tried using the second
profile.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
c176825051 sinowealth: use uint8_t instead of char for report IDs
Also move one of them up, this may make the function a bit more readable
if we ever decide to support the second mouse profile.

Fixes a clang-tidy warning.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
ba3547457c sinowealth: split commit into raw data update and raw write helpers
This will get handy if we decide to add multiple profile support.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
3f936eff68 data: add another name to Glorious Model O - O- 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
c25864c18a data: add SinoWealth Generic Mouse (258a:0027) 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
cf64aac5f1 sinowealth: set the RGB effect to unsupported if LED type is not defined 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
0a39552a65 sinowealth: add default sensor type and LED type 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
03d2d71f82 sinowealth: don't enable LED support if LED type is not defined 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
1edb6df25b sinowealth: define set_active_profile method in the driver 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
9c7494c5c0 sinowealth: select first profile before getting any data from the mouse 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
7f29c0423f sinowealth: add active profile setter 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
07307b85d3 sinowealth: add commands IDs for the second profile 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
219218118d sinowealth: print LOD and angle snapping value 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
1e2489c9e7 sinowealth: add LOD and angle snapping value getter
LOD - lift-off distance.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
479c4352af sinowealth: print debounce time 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
763655516c sinowealth: add debounce time getter 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
944c4f0af5 sinowealth: print profile index 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
268ccab111 sinowealth: add profile index getter
Thank you so much, @araghon007!
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
603b0ca1fc sinowealth: use RGB or RBG colors depending on device 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
4e50c506de sinowealth: format code 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
4351eb3d72 sinowealth: support different sensors 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
9f4a1ba405 sinowealth: print device model based on firmware version
sinowealth: detect Glorious Model O with old firmware
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
451894b1b4 sinowealth: make the firmware version printing helper return it instead 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
c6051cb9ea sinowealth: handle new RGB effects 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
34fafbc0f8 sinowealth: use enum types in config report directly
Although I'm not sure this if this would work on every compiler, having
a bit of extra type safety is always nice.
It does work with GCC and Clang at the very least.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
75d075cc67 sinowealth: make some utility functions take unsigned integers
To avoid implicit conversions.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
2f330b6466 sinowealth: use a struct to store lighting mode 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
c7adc9b9f6 sinowealth: print config data size 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
16a7b6ed18 sinowealth: use NULL instead of 0 for pointers 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
7ff73c8515 sinowealth: rename a config entry to make more sense 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
f11e31d671 sinowealth: add some hidden lighting types
These are not available in Glorious software.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
f69457c280 sinowealth: add breathing_mode to config report 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
756fee1202 sinowealth: sort values in an enum 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
d4126463e4 sinowealth: don't say that amount of breathing colors is constant
Based on information in gloryctl's documentation, it's not. I guess it
was marked as such because Glorious software doesn't allow to change it.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
00832cb9f0 sinowealth: add a lift off distance value to config report 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
866d4e6433 sinowealth: put some macros into enums 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
cbba00f997 sinowealth: use a map to convert report rates 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
d2e4fcc23e sinowealth: put report rate conversion comparison in order
And also not use some random number in the comparison.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
f0c66d0e1f sinowealth: separate config to real config and report_rate nibbles 2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
b2fb91e261 sinowealth: use correct bits for report rate
Turns out it takes the whole nibble, not just three bits.
2022-02-01 07:20:28 +10:00
Yaroslav Chvanov
1a64d2b85d Add a TODO to make ratbag_button_action_match support macro actions 2022-02-01 07:11:43 +10:00
Yaroslav Chvanov
8f5fdf8590 Fix ratbag_button_action_match not matching on type NONE 2022-02-01 07:11:43 +10:00
Yaroslav Chvanov
baad36060d util: fix a string of text being printed out of nowhere 2022-02-01 07:06:38 +10:00
Yaroslav Chvanov
7ecabea70d sinowealth: remove a redundant comment 2022-01-28 10:31:09 +10:00
Yaroslav Chvanov
c0c8d6c544 sinowealth: increase log level of printed firmware version 2022-01-28 10:31:09 +10:00
Yaroslav Chvanov
37587bb99c sinowealth: fix a memory leak
We were getting profiles, but never unreferenced them afterwards.
2022-01-28 10:31:09 +10:00
Yaroslav Chvanov
cc2fff9c06 sinowealth: rename some functions to be more clear
So that they would match button data reading later on.
2022-01-28 10:31:09 +10:00
Yaroslav Chvanov
b80d3ac0a3 sinowealth: use the detected LED count
I put this in a separate commit as 99% of this is just a change of
indentation levels, which doesn't look nice in git.
2022-01-28 10:31:09 +10:00
Yaroslav Chvanov
a757180d60 sinowealth: detect LED count at run-time 2022-01-28 10:31:09 +10:00
Yaroslav Chvanov
8c0124d654 sinowealth: move raw data reading from init function to probe function 2022-01-28 10:31:09 +10:00
Yaroslav Chvanov
b5d41e3657 sinowealth: put reading of raw configuration data into a helper 2022-01-28 10:31:09 +10:00
Yaroslav Chvanov
bfd2fc9969 sinowealth: print firmware version on profile init, not on reading 2022-01-28 10:31:09 +10:00
Yaroslav Chvanov
566d160de3 sinowealth: make init_profile return error codes 2022-01-28 10:31:09 +10:00
Kyoken
e0dc0a3a5b fix ratbag-command led setting 2022-01-24 12:55:12 +10:00
Peter Hutterer
5b7af0ec14 CI: actually test with the various meson args
Different variable names and no-one noticed.

This means we need to add a few dependencies that weren't needed before.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-01-22 12:09:34 +10:00
Peter Hutterer
44a9959344 roccat: name two fields correctly
In hindsight, these should've been obvious.
2022-01-20 19:32:14 +00:00
Peter Hutterer
755dbddfb3 meson.build: fix spelling of receiver 2022-01-20 15:47:11 +10:00
Peter Hutterer
1e3a85433a CI: add a github pages job to the CI
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-12-15 14:40:56 +10:00
Peter Hutterer
b3b3e3f838 Drop CircleCI
Right now, CircleCI fails with ssh errors because for some reason it
wants to clone the repo over ssh, not https. This is probably fixable
but CircleCI now limits how many runs we can do per month anyway so it's
borderline useless if we do actual developement.

Having to re-learn the Circle CI syntax to fix the current issue is not
an efficient use of our time, so let's just drop this completely, git
will keep the history of what we used to do in the CI for us.

02f3487f52 added a github workflow which
is comparatively incomplete but could be extended to do the previous
test runs. That's a more future-proof path anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-12-15 14:40:56 +10:00
Peter Hutterer
f05b671dc1 Install all data files as subdir
This removes the need of listing every device in meson.build which is a
common enough mistake for new contributors.

And move the validation tests over to test/ so we don't have to list
them in the exclude_files of the install_subdir() command.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-12-13 10:39:42 +10:00
Peter Hutterer
bfadfc3c91 Change the data validation tests to take the directory instead of files
Instead of passing a million files, let's pass the directory and do a
pathlib glob instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-12-13 10:39:42 +10:00
Peter Hutterer
96d93ae387 meson.build: require meson 0.50.0
Released March 2019 we've already relied on some of its features anyway,
let's get rid of the warnings.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-12-13 10:38:59 +10:00
Peter Hutterer
03891189da hidpp20: add missing #define to the feature report strings (#1237)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-12-06 08:46:40 +10:00
Peter Hutterer
02f3487f52 Add a GitHub Workflow as CI run (#1238)
CircleCI is limiting how many runs we can do, which results in pipelines
randomly failing when we've used up the credits for this month.

Let's add a github workflow instead. Unfortunately github workflows are
a bit of a toy api, no support for YAML anchors or extending other jobs,
so there's a lot of duplication needed to get a job to do something.

The actions added in this patch help a bit to make the jobs easier to
understand (copied from libwacom).

This only runs on Ubuntu right now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-12-06 08:43:14 +10:00
Ilya guterman
d2f1ff0ca2 tests: test for additonal lightspeed receviers pids
PR #1225
2021-11-06 16:53:01 +00:00
Rafael Silva
d5a7ad3730 device: g635: Set buttons as 0 2021-11-06 03:27:32 +02:00
Carlos Mogas da Silva
e98f86fa2a Add Logitech G635 Headset 2021-11-06 03:27:32 +02:00
Rafael Silva
fb14cb576b README: add uninstall instruction 2021-11-04 09:35:30 +00:00
Ilya Guterman
2c83f9c3ef add static assert 2021-11-04 03:36:41 +02:00
Ilya Guterman
b71f439ed6 fix ci failures 2021-11-04 03:36:41 +02:00
Ilya Guterman
dff102be43 steelseries: prefix hidraw writes with 0 2021-11-04 03:36:41 +02:00
mtayllan
6bb92dc313 Set buttons as 0 for logitech g733 2021-11-01 08:25:03 +02:00
mtayllan
92c5923255 Add support to Logitech G733 2021-11-01 08:25:03 +02:00
staticssleever668
6c8a2d36fe sinowealth: use proper config size when writing 2021-10-26 11:57:53 +03:00
staticssleever668
875aae6985 sinowealth: add support for mice with longer configuration data 2021-10-26 11:57:53 +03:00
Ilya Guterman
a55297e0fa fix button count and default report rate always zero 2021-10-20 11:29:55 +03:00
staticssleever668
fa95abbc33 hidpp20: give some structures names
Fixes SWIG's 503 warnings.
2021-10-16 22:43:37 +03:00
staticssleever668
48d1b21036 driver-hidpp20: cast an internal log priority enumeration to the general one
Fixes an 'enum-conversion' warning by clang.
2021-10-16 22:43:37 +03:00
staticssleever668
904aedc555 driver-hidpp10: cast an internal log priority enumeration to the general one
Fixes an 'enum-conversion' warning by clang.
2021-10-16 22:43:37 +03:00
staticssleever668
4fa8663cfb driver-hidpp10: remove a redundant character array null check
It is never null. Fixes a 'pointer-bool-conversion' warning by clang.
2021-10-16 22:43:37 +03:00
staticssleever668
58086882a3 ratbagd: initialize a variable
Fixes a 'sometimes-uninitialized' warning by clang.
2021-10-16 22:43:37 +03:00
Tayllan
aef92645b7 hidpp20: allow setting a default buttons count
PR #1212
2021-10-16 20:08:44 +01:00
staticssleever668
514ce5419f data: add SteelSeries Rival 100/105 2021-10-16 19:31:11 +01:00
staticssleever668
2a0a3cf203 steelseries: add support for changing LEDs on Rival 100 2021-10-16 19:31:11 +01:00
staticssleever668
f96ba13f07 libratbag-data: add 'Rival100' quirk to SteelSeries driver 2021-10-16 19:31:11 +01:00
staticssleever668
724d31c8fe steelseries: make settings unique to SteelSeries Sensei RAW a quirk 2021-10-16 19:31:11 +01:00
staticssleever668
66e44d76b9 steelseries: add 'Quirk' setting 2021-10-16 19:31:11 +01:00
Filipe Laíns
e908871e82 hidpp20: allow setting a default report rate (#969)
In case we can't get the report rate value from the device, allow
setting in the device file.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2021-10-11 02:14:02 +03:00
Kristian Klausen
9732aa009e steelseries: only use the HID vendor device
Rival mice are composite devices with multiple HID devices and only the
HID vendor device can be used to configure the device.

Tested with a SteelSeries Rival 300 (1038:1710).

Fix #888
2021-10-10 21:10:20 +01:00
Ilya guterman
92299d4673 data: support steelseries rival variations
PR #1209
2021-10-10 18:51:35 +01:00
LittleWhite-tb
5c3df3b218 Support for Roccat Kone EMP (#1131) 2021-10-07 16:00:36 +10:00
Filipe Laíns
62f26e797e Revert "data: Add (old) Logitech Performance Mouse MX"
This reverts commit d47f2ed946.

Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-07-24 22:25:38 +01:00
Filipe Laíns
d460743bd7 Revert "data: add additional identifier for MX Anywhere 2"
This reverts commit 2ce254e51b.

Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-07-24 22:25:25 +01:00
strangemax
d47f2ed946 data: Add (old) Logitech Performance Mouse MX
PR #1146
2021-07-24 22:19:17 +01:00
João Ferreira
2ce254e51b data: add additional identifier for MX Anywhere 2
PR #1155
2021-07-24 22:18:19 +01:00
staticssleever668
c7c9c908e1 ratbagd-profile: allow report rates up to 8000 2021-07-24 22:17:19 +01:00
staticssleever668
b339370b6a ratbagd-profile: do not align report rates to 100 2021-07-24 22:17:19 +01:00
staticssleever668
37ae638a7c steelseries: improve v1 LED breathing duration configuration
SteelSeries mice using V1 driver don't support changing LED breathing
duration precisely, so it was always locked on 5 seconds. Now we try to
match desired duration with factory preset values: 3, 5 and 7 seconds.
2021-07-24 22:05:49 +01:00
staticssleever668
6a071dc1ee sinowealth: expose all eight resolution slots
It was limited to six because Glorious' software exposes only so many of
them, but SinoWealth mice firmware allows up to eight.
2021-07-24 22:05:16 +01:00
staticssleever668
7c9a75da9e sinowealth: add support for changing report rate 2021-07-24 22:04:55 +01:00
staticssleever668
dd1c72a1d0 sinowealth: add support for reading current report rate 2021-07-24 22:04:55 +01:00
staticssleever668
8d7cbcba4f steelseries: fix report rate changing for version 1 devices
Judging by rivalcfg's data for Sensei Raw, Rival 100, Rival (300) and Kinzu v2 (all are version 1 devices in our data), it should have been like that from the beginning.
Confirmed on Rival 100.
2021-07-24 22:04:14 +01:00
staticssleever668
4075227eb7 sinowealth: add support for changing active resolution number 2021-07-24 22:03:44 +01:00
Stephan Lachnit
abcec1d349 Register Roccat Kone Pure driver
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2021-07-24 21:25:56 +01:00
Stephen Kitt
206bc5996d man: add both variants in ratbagctl.1 synopsis
PR #1188
2021-06-30 19:23:30 +01:00
Stephen Kitt
366f19abdd openinput: fix "Unknown" typo
PR #1187
2021-06-30 19:21:47 +01:00
Filipe Laíns
952bd9dc07 libratbag 0.16
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-06-24 15:11:34 +01:00
staticssleever668
6b97d94a2f sinowealth: print out firmware version when probing 2021-06-23 15:40:38 +00:00
Thomas Weißschuh
ccaa8d1b6c ratbagd: register task to run as soon as possible
Previously the scheduled task would only have been executed after some
other event woke up the mainloop.
If no such event happens, the task will be delayed significantly.

Fixes #1121
2021-06-21 22:47:42 +01:00
Elián Hanisch
abe451df33 sinowealth-nubwo: fix implicit declaration of function ‘vasprintf’
driver-sinowealth-nubwo.c was missing to include "config.h" so
_GNU_SOURCE wasn't defined soon enough.

Co-authored-by: Elián Hanisch <elian.hanisch@ing.unlp.edu.ar>
2021-04-29 01:38:03 +01:00
Sethox
a3fa876c3d data: add SEL variant to Roccat Kone Pure
The last part added is for a variant called "Roccat Kone Pure SEL".

PR #1152
2021-04-21 03:45:25 +01:00
Filipe Laíns
230647c7f3 openinput: fail probe if we can't enumerate
These functions are mandatory[1], fail to probe if they fail.

[1] https://github.com/openinput-fw/openinput-protocol/tree/master/specification/device-protocol#mandatory-functions

Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-04-04 15:08:21 +01:00
Filipe Laíns
3f99446a1b ci: temporarily disable arch
See my description of the problem in [1].
Essentially, docker is mishandling the failuire when a syscall is not
available, returning EPERM instead of ENOSYS, and making code misbehave.
The current issue with arch is glibc, which explodes on EPERM, causing
pacman to misbehave.

Once the fix hits CircleCI, we will re-enable.

[1] https://github.com/fwupd/fwupd/issues/2894

Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-03-01 10:34:10 +10:00
Filip Laurentiu
a766f8e909 data: add new identifier for DeviceMatch to match MX Anywhere2 mouse
PR #1137
2021-02-28 19:02:52 +00:00
Pavel Kovar
9ae975f9a9 data: add support for Logitech M500s mouse 2021-02-17 17:53:27 +00:00
Filipe Laíns
780934b1a1 data: add openinput device
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-02-16 00:15:59 +00:00
Filipe Laíns
337fb935c4 openinput: refactor function discovery
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-02-16 00:15:59 +00:00
Filipe Laíns
c9cf5fe90c openinput: add function discovery
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-02-16 00:15:59 +00:00
Filipe Laíns
18af0f97d2 openinput: print device protocol name
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-02-16 00:15:59 +00:00
Filipe Laíns
286f13c654 openinput: read firmware information
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-02-16 00:15:59 +00:00
Filipe Laíns
c6b9cc0c2a openinput: add error support
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-02-16 00:15:59 +00:00
Filipe Laíns
7d82bb51a6 openinput: save protocol version
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-02-16 00:15:59 +00:00
Filipe Laíns
8976033da7 openinput: add openinput_send_report
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-02-16 00:15:59 +00:00
Filipe Laíns
c9c6a1675f openinput: add barebones driver
This is the minimal code required to have a working driver, now we just
need a .device file.

Note the hardcoding of `profile->is_active = true` in
openinput_read_profile, this works because we just have one profile.

Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-02-16 00:15:59 +00:00
the Weld
f1e2a4ccff data: add extra USB device ID for MX Vertical
Fixes #1132, for my own model of MX Vertical at the least.
2021-02-15 20:00:34 +00:00
Filipe Laíns
104543fdf1 data: add G Pro X Wireless Superlight
Support for this receiver, and for the device using the powerplay
receiver, still needs to be added to the kernel driver. For now, you can
used the wired connection to configure the device.

You should also not try to use with the powerplay receiver as the kernel
driver does not support the connection and won't forward any input
events to userspace.

Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-01-30 10:59:37 +00:00
Matt
b3275e10d7 data: add Logitech M545 2020-12-30 17:43:52 +00:00
Filipe Laíns
120908bda8 data: add G915 TKL
Closes #1008

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-10-22 20:20:04 +01:00
Filipe Laíns
32d6443553 data: add an ID to the MX Anywhere 2
Fixes #1078

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-10-17 18:22:54 +01:00
Calvin Walton
ae943eaee7 data: Add configuration for SteelSeries Kinzu V2 Pro Edition
Appears to be basically the same as the V2 - the differences were
mostly in hardware (upgraded switches & image sensor). I've verified
that the list of DPI settings is correct and matches the Windows
software. Adjusting DPI config in both profiles works correctly.
2020-10-15 01:50:44 +01:00
Calvin Walton
4a9503f2da data: add device IDs for Logitech MX Anywhere 3 2020-10-14 21:57:19 +01:00
Filipe Laíns
e268100d31 libratbag-data: log message if the device is a Logitech receiver
We have been receiving countless issues and PRs reporting or "fixing"
the device IDs because they think it's wrong. Hopefully this will give
them an hint that is intended behavior. If they look closely at the log,
on a recent enough kernel, they should see their device show up with the
internal ID.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-10-09 17:37:44 +01:00
Filipe Laíns
8ec0e8bbc5 Revert "meson: bump required meson version"
This reverts commit e753db72f9.

The new version is too recent for lgtm.com.
See https://lgtm.com/projects/g/libratbag/libratbag/logs/rev/pr-c8dd47f8b4d0c40fc0a27b13e031bbb8e6c76987/lang:cpp/stage:Build%20merge_7b2f50275451a899db1bf70b6eaae9d88ecc56d0

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-10-08 01:46:03 +01:00
bluemner
e6a9fba498 Update add support for G-Shift keys on g600 2020-10-05 00:44:27 +01:00
Thomas H.P. Andersen
e753db72f9 meson: bump required meson version
Bump the required meson version to match the features that we make
use of.

We now also make use of the 'copy:' keyword in configure_file that
is available in version 0.47.
2020-10-05 00:39:43 +01:00
Thomas H.P. Andersen
e1f4fac9a2 ratbagd-json: fix compilation with clang
Compilation on clang failed as we would try to jump to
the 'out' label and then jump over the initialization
of a variable with __attribute__((cleanup)).

We move the initaliztion up to make sure it happens before
the goto.
2020-09-29 02:11:09 +01:00
Thomas H.P. Andersen
8f981c8b87 circleci: bump to fedora 32
Bump to fedora 32 to updated meson version
2020-09-29 02:08:17 +01:00
Thomas H.P. Andersen
01d2cf8477 sinowealth: silence warning 2020-09-29 01:07:12 +02:00
Filipe Laíns
f7c22ed88c libratbag 0.15
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-09-25 21:38:01 +01:00
Thomas H.P. Andersen
aeda65cbfa sinowealth: remove per-resolution led
The glorious mice uses a single profile. To differentiate between
resolutions each one has customizable color. A led on the bottom
of the mouse shows the active resolution color.

Libratbag does not support a per-resolution color.

To allow adjusting these colors the sinowealth driver defines a led
for each resolution. This is a misuse of the model and will cause
problems when the mouse is added to Piper.

This patch removes the per-resolution leds and hardcodes the led
count to one.
2020-09-25 20:51:45 +01:00
Pipat Saengow
ed2439e5e2 sinowealthnubwo: more reasonable default and refactor 2020-09-21 17:39:28 +02:00
Pipat Saengow
f407521e8f Add driver for Nubwo X7 Spectrum
Nubwo X7 Spectrum is a sinowealth-based gaming mouse.
The sinowealth-nubwo driver included in this commit provides

- LED support (except color mode that are not available in libratbag)
- DPI and reporting support
- NO button mapping/macros support
2020-09-21 17:39:28 +02:00
heimer16
3c4fe23f70 data: update Logitech g9x (#913)
* add LED for Logitech g9x
* update min dpi range and step for Logitech g9x

Co-authored-by: Erin Heimer <heimer16@gmail.com>
2020-09-11 22:28:57 +02:00
Mike Crowe
9e2ac55dbc libratbag-private.h: Ensure that _GNU_SOURCE is defined early enough
When compiling on Ubuntu 20.04 with GCC 9.3.0 and glibc 2.31, I get:

In file included from ../src/libratbag-private.h:32,
                 from ../src/driver-sinowealth.c:24:
../src/libratbag-util.h: In function ‘asprintf_safe’:
../src/libratbag-util.h:154:7: warning: implicit declaration of function ‘vasprintf’; did you mean ‘vsprintf’? [-Wimplicit-function-declaration]
  154 |  rc = vasprintf(&result, fmt, args);
      |       ^~~~~~~~~
      |       vsprintf

This appears to be because <features.h> is being included by another
header before config.h has been included. If _GNU_SOURCE has not been
defined at that point, then the other macros that control whether
vasprintf is declared are not set correctly.

Include config.h right at the top of libratbag-private.h to ensure
that _GNU_SOURCE is defined before any system headers are included to
avoid this problem.
2020-08-30 19:16:51 +02:00
Nguyễn Chính Hữu
1e72ebaa7b data: add the G203 name to the .device file 2020-08-29 22:23:35 +01:00
peelz
920bc2b993 driver-hidpp10: fix segfault when committing unnamed profiles 2020-08-23 16:21:05 +01:00
TurkeyTheGobbler
20b573668e g300: use the correct step size 2020-07-25 17:26:37 +01:00
Daniel Lehmann
49acc11db3 Fix enumeration of Logitech G5 (2007)
Before this patch, ratbagd would abort initialization of the device because
no profiles are returned.

Once that was handled more gracefully, ratbagd would fail because it doesn't
read the DpiList from its own config file, as no ProfileType is specified.
Specifying G500 as the closest match.
2020-07-23 01:04:14 +01:00
Stephan Lachnit
364e3fd965 data: add additional USB-ID for the M720 Thriatlon
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-07-23 01:00:33 +01:00
Marian Beermann
bb230d390d sinowealth: fix reading RGB brightness from device 2020-07-23 00:45:29 +01:00
Marian Beermann
93a076bed9 sinowealth: code style changes 2020-07-23 00:45:29 +01:00
Marian Beermann
e7b50c9061 sinowealth: rewrite RGB LED mode conversions 2020-07-23 00:45:29 +01:00
Marian Beermann
9d533bdc3e sinowealth: fix dpi_count not being updated
The firmware of these mice only considers the first dpi_count zero bits
in dpi_enabled.
2020-07-23 00:45:29 +01:00
Marian Beermann
d7906b54b4 sinowealth: code cleanup and style changes 2020-07-23 00:45:29 +01:00
Marian Beermann
f1eba370ed sinowealth: do not typedef structs 2020-07-23 00:45:29 +01:00
Marian Beermann
7b5ab2ed99 sinowealth: separate capability setting logic from read_profile 2020-07-23 00:45:29 +01:00
Marian Beermann
d2d5471836 sinowealth: implement brightness and speed controls 2020-07-23 00:45:29 +01:00
Marian Beermann
9cfc1e98e3 sinowealth: fixed rgb
Turns out it was caused by two mistakes:
1.) While writing the struct I overlooked a changed offset in my notes,
    so a bunch of padding was missing in the middle of the struct (unk4[33]);
    that padding is probably the set of colors (11) used by tail mode
2.) The LED bodies actually use RBG ordering instead of RGB
2020-07-23 00:45:29 +01:00
Marian Beermann
691661276f pad struct sinowealth_config_report to full size of report 2020-07-23 00:45:29 +01:00
Marian Beermann
25ed99db84 Add sinowealth driver 2020-07-23 00:45:29 +01:00
Dejan
02226d0428 data: add another device ID for G203 mouse 2020-07-09 21:54:56 +01:00
Stephan Lachnit
f822fb0fa7 remove unused string format to fix flake8 (#1024)
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-07-06 11:48:47 +02:00
Stephan Lachnit
b88be0add0 ci: bump Ubuntu to 20.04
This also removes the manual addition of the universe repository, since it's already enabled in the circleci image.
Because of this, software-properties-common doesn't need to be installed anymore, and libnss-systemd isn't going to be installed (see c425780220).
However, DEBIAN_FRONTEND=noninteractive needs to be set, else the image will loop while trying to configure tzdata (aka the timezome).

Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-06-09 10:55:31 +10:00
Stephan Lachnit
9fc6d12486 data: add additional USB-ID for Roccat Kone Pure
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-06-07 20:58:41 +02:00
Stephan Lachnit
0c64dad9e1 fix wrong driver id for Roccat Kone Pure
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-06-07 20:58:41 +02:00
Farid Gh
f61485c603 data: add bluetooth ID to the MX Vertical 2020-05-29 13:57:21 +01:00
Filipe Laíns
8c295479d8 hidpp20: keep unsupported button mappings
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-05-25 18:08:40 +01:00
Dylan Baker
e55b04ec7d meson: Fix python3 version detection with python3 module
I misread the documentation about the python3 module. The newer python
module puts the language_version in the object returned by
`pymod.find_installation()`, while the python3 module has the same
method in the *module*.

Fixes #985
2020-05-19 19:47:24 +01:00
Filipe Laíns
1231415470 libratbag 0.14
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-05-17 21:23:57 +01:00
Filipe Laíns
660da27021 data: add Logitech G935
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-05-17 21:19:32 +01:00
Dylan Baker
481b6f029a meson: make finding python more robust
This code assumes that there is a python3 or python3-embed pkg-config
file on the system, which may or may not be true. On Gentoo for example,
only python-X.Y pkg-config files are available and this will fail to
build.

This makes use of the new py_installation.dependency(embed : true) if
possible, and falls back to trying to find a python that matches the
version of python found by the python3 or python module.
2020-05-17 19:19:42 +01:00
Filipe Laíns
768d93a45a github: add device info to bug report template
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-29 14:23:47 +01:00
ksv1986
1c6e039d01 hidpp10: fix handling of hidpp10_device_new() failures
Signed-off-by: ksv1986 <ksv0x07c2@gmail.com>
2020-04-26 15:07:23 +01:00
ksv1986
d16df8d100 hidpp10: fix crash if device failed to initialize properly
Signed-off-by: ksv1986 <ksv0x07c2@gmail.com>
2020-04-26 15:07:23 +01:00
Filipe Laíns
4b1e49d522 hidpp20: fix report type in ColorLedEffects (0x8070) set_zone_effect
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-26 15:07:06 +01:00
Filipe Laíns
786cebcb0b hidpp20: cleanup, use short reports when possible
libratbag has a quite communication-intensive setup routine. This patch
uses short reports when possible. Using short reports will speed up the
setup process and have a lower power consumption, which is relevant for
wireless devices.

We now check the report descriptor for the supported report IDs and
adjust the report type used based on the device capabilities. Because of
that, this patch should work without any issues as the report type will
get overwritten if it not supported.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-26 15:07:06 +01:00
Filipe Laíns
d53454bcb3 hidpp10: fix circular loop on hidpp10_onboard_profiles_read_macro
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-26 15:06:25 +01:00
Filipe Laíns
a0def65b64 hidpp10: add debug log on hidpp10_onboard_profiles_parse_macro fail
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-26 15:06:25 +01:00
Stephan Lachnit
2a40279903 doc: replace some tabs with spaces
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-04-26 15:06:08 +01:00
Filipe Laíns
02c95422f0 hidpp20: fix mapping button to consumer usages
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-18 02:31:17 +01:00
Filipe Laíns
4ce1cf2807 hidpp10: convert key actions to macro
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-18 02:31:17 +01:00
Filipe Laíns
89168f2187 hidpp10: add support from writting simple macro actions
Fixes #900

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-18 02:31:17 +01:00
Filipe Laíns
bb92337268 ci: remove dbus policy dir hack in arch
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-18 02:29:05 +01:00
Filipe Laíns
a8316c07f3 ratbagd: create path if not present before installing dbus policy dir
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-18 02:29:05 +01:00
Filipe Laíns
39769c57dd ci: save cache between jobs for fedora and arch
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-17 05:57:38 +01:00
Filipe Laíns
200a8af7a7 ci: cache packages in arch
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-17 05:57:38 +01:00
FFY00
fcf9f7745d ci: add arch
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-17 05:57:38 +01:00
Filipe Laíns
633c9fc55d libratbag-data: add missing header entry (#958)
Dicovered in #957

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-16 15:59:50 +02:00
Peter Hutterer
ee73434ead circleci: bump to use ubuntu 19.10
The 19.04 repos give us 404s, so let's update to the next version.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-04-16 08:01:53 +10:00
Filipe Laíns
d60b1c9d71 data: overwrite led count in G305
Fixes #949

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-14 19:00:12 +01:00
Filipe Laíns
88a60f55b4 hidpp20: allow overwritting the led count
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-14 19:00:12 +01:00
D33M0N
dba202ae8b data: added bluetooth ID to the MX Anywhere 2 2020-04-03 19:27:02 +01:00
Filipe Laíns
6cdcce9de4 hidpp20: log error number when commiting
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-03 17:02:44 +02:00
Filipe Laíns
e2c3373145 hidpp10: log errors when comitting
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-04-03 17:02:44 +02:00
Filipe Laíns
02575a9008 hidpp20: add button/macro opcodes
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-03-22 19:17:47 +00:00
Filipe Laíns
1097b1ba68 meson: silence swig warnings
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-03-22 19:13:58 +00:00
Filipe Laíns
77b67775da ratbagctl: don't print empty properties
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-03-22 19:08:58 +00:00
Filipe Laíns
5b23c9ebae data: add Logitech M720
Fixes #939

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-03-22 18:58:07 +00:00
Stephan Lachnit
6d0974be25 circleci: add diffutils dependency for fedora
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-02-21 15:21:42 +01:00
simrat39
ea9111a2a6 devices: Set g402 LedTypes
Signed-off-by: simrat39 <simrats169169@gmail.com>
2020-02-10 15:49:45 +00:00
Filipe Laíns
42787ee422 meson: libratbag 0.13
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-02-09 23:32:55 +00:00
Filipe Laíns
611dd9be0d hidpp20: keep unsupported effects
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-02-09 23:31:42 +00:00
Filipe Laíns
fd20f9e642 hidpp20: simplify hidpp20_onboard_profiles_write_led
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-02-09 23:31:42 +00:00
Filipe Laíns
9be5576967 hidpp20: add some missing led effects
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-02-09 23:31:42 +00:00
Filipe Laíns
9fe511fcc5 hidpp20: add profile field to special bindings in onboard profiles
New devices define a profile field in the button configuration. This
allows us to map a button to set the target profile as active. Even
though we don't support configuring this right now, some devices, such
as the G915/G815, come pre-configured with this action on th M-Keys.
This patch makes us able to read and write those settings, this way they
don't get lost when we write a profile to the device.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-02-09 23:31:42 +00:00
Filipe Laíns
f0b69aab19 hidpp20: only set active resolution if there are resolutions on 0x8100
This prevents us from trying to set a resolution on keyboards.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-02-09 23:31:42 +00:00
Filipe Laíns
7610b80ced hidpp20: log errors when failed to write sector
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-02-09 23:31:42 +00:00
Filipe Laíns
f0a05bb522 data: add the Logitech G Powerplay
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-02-10 08:24:10 +10:00
Torbjørn Fylling
2669cc28b2 data: add support for Logitech G815 keyboard 2020-01-31 10:13:37 +00:00
Peter Hutterer
302702d94a Declare a bunch of structs as extern
gcc 10 complains about multiple definitions of these when linking.

/usr/bin/ld: libhidpp.a(src_hidpp-generic.c.o):/builddir/build/BUILD/libratbag-0.12/x86_64-redhat-linux-gnu/../src/libratbag-private.h:588:
multiple definition of `etekcity_driver';
libutil.a(src_libratbag-util.c.o):/builddir/build/BUILD/libratbag-0.12/x86_64-redhat-linux-gnu/../src/libratbag-private.h:588:
first defined here

Special case here is the test_driver struct, without the extern gcc seems to
think it's a new struct with all zeros, causing a segfault when we then try to
strcmp the test driver name.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-29 02:12:28 +00:00
Filipe Laíns
e1136c4d30 hidpp20: add debug log when failed to read led (8070, getZoneEffects)
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-01-28 21:41:45 +01:00
Filipe Laíns
0012853a1d hidpp20: make sure getZoneEffect (8070) is supported
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-01-28 21:41:45 +01:00
Filipe Laíns
afb85f868c hidpp20: change unsupported effect log msg to debug verbosity
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-01-28 21:41:45 +01:00
Filipe Laíns
b76fcdadde hidpp20: enable 0x8070 (ColorLedEffects) standalone use
0x8071 is still missing but as of now we don't have any device that
needs it.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-01-28 21:41:45 +01:00
Stephan Lachnit
ba7c092ee2 driver-hidpp20: replace goto with return
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-01-08 07:36:52 +10:00
Stephan Lachnit
3483bd8c14 driver-hidpp20: minor cleanup
Removes useless setting of the dpi index when updating resolutions.
Removes weird empty line.

Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-01-08 07:36:52 +10:00
Filipe Laíns
0fb0eb3d42 hidpp20: log errors in hidpp20drv_commit
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-01-06 19:22:57 +00:00
Filipe Laíns
5fb1f4429d ratbagd: log error if failed to commit
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-01-06 19:22:57 +00:00
Filipe Laíns
5f5e294598 hidpp20: add support for reading/writing the report rate via 0x8060
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-01-06 19:18:06 +00:00
Filipe Laíns
b4218737cd hidpp20: fix bug that was unsetting some capabilities
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-01-06 19:18:06 +00:00
Filipe Laíns
3875bb70fd hidpp20: implement dirty flag for report rate
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-01-06 19:13:01 +00:00
Filipe Laíns
e9d67b7235 ratbag: add dirty flag for report rate
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-01-06 19:13:01 +00:00
Filipe Laíns
8a476a8724 hidpp: fix supported_report_types data type
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-01-03 22:40:03 +00:00
Sadika Sumanapala
d67cbec5f8 Add M590 bluetooth ID 2020-01-03 08:17:43 +10:00
Stephan Lachnit
f82c6f72b6 Use EditorConfig instead of vim comments
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2019-12-24 08:04:11 +10:00
Stephan Lachnit
af30fc28cd CircleCI: use variables for dependencies
Use separate variable lists for dependencies.
Uninstall check merged in upstream meson, so it can be simplified.
`libsolv` doesn't need to be updated any more with Fedora 31.

Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2019-12-24 07:34:18 +10:00
Filipe Laíns
3fb8a51456 docs: adjust description to say we support other devices than mice
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-12-23 06:26:55 +10:00
Matthias Bach
ceaa3c3ad5 Reorder the initialisation of the ratbagd client
When the API version mismatches we want to fail early before performing
any more complex initialisation. We do however have to check for
devices first so that we can distinguish cases where we cannot access
the daemon from those where it is too old to provide an API version.
2019-12-22 16:58:20 +00:00
Matthias Bach
551b918ba8 Give a more specific error message if user cannot reach ratbagd via D-BUS
If access failed, e.g. due to insufficient permissions, don't confuse
the user by reporting an API mismatch.

This is a minimal improvement to target issue #802. As, if access is
restricted to a group, that group is known in Meson, it would even be
possible to report that group in the error message. But, that would
require converting ratbagd.py to a template or finding some other way to
inject that information at build time.
2019-12-22 16:58:20 +00:00
Filipe Laíns
3105428ba1 tests: fix data parse for hidpp index
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-12-20 10:30:10 +01:00
Benjamin Tissoires
b3f2406180 data: add G910
Same situation than the G513, 0x8100 is not present.
But heh.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-12-20 09:15:24 +00:00
Benjamin Tissoires
902160f430 ratbag-command fixes
- File "./build/ratbag-command", line 2289, in open_ratbagd
    r = Ratbagd(1)
  TypeError: __init__() takes 1 positional argument but 2 were given
- AttributeError: module 'libratbag' has no attribute
  'ratbag_device_get_bus'
- File "./build/ratbag-command", line 267, in model
    return "{}:{04x}:{04x}:{d}".format(bus, vid, pid, version)
  KeyError: '04x'
- swig/python detected a memory leak of type 'uint32_t *', no destructor
  found.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-12-19 15:56:52 +01:00
Filipe Laíns
fd6d0b6198 data: add G513
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-12-19 13:58:02 +01:00
Filipe Laíns
5ed98fdb22 hidpp20: only enable 0x8070 or 0x8071 if 0x8100 is present
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-12-19 13:58:02 +01:00
Filipe Laíns
e0e73c2971 data: add G915
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-12-19 12:06:15 +00:00
Filipe Laíns
0d3b4f1b64 libratbag: add 'switches' led type
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-12-19 12:06:15 +00:00
Filipe Laíns
20b6e3deeb hidpp20: only populate resolutions if the device supports
This patch moves the 0x8100 initialization routine out of
hidpp20drv_init_feature because it needs the capabilities to be
processed first.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-12-19 12:05:54 +00:00
Filipe Laíns
ffcdee912d libratbag: allow no resolutions
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-12-19 12:05:54 +00:00
Filipe Laíns
5357d4cbc2 meson: libratbag 0.12
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-12-18 19:25:30 +00:00
Filipe Laíns
26c534cc74 hidpp20: check supported report types
Fixes #854

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-12-18 19:23:31 +00:00
Stephan Lachnit
904c7988bb hidpp20: set dictionary output to raw
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2019-12-17 15:54:42 +00:00
Stephan Lachnit
7d255a2f93 Fix missing capability in ratbagctl.test
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2019-12-17 15:54:42 +00:00
Stephan Lachnit
d0a5cb1f0e Minor ratbagd/ratbagc adjustments
Bumped copyright to 2019.
Fixed typo in profile.capabilities description.
only ratbagd.py: Removed vim helper line since the file has a proper file extension.

Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2019-12-17 15:54:42 +00:00
Qiu Wenbo
71b1d66287 hidpp20: fix a double free error of hidpp20
These are two fields of a union and should have the same value. What the
code doing here is trying to free a pointer twice.

Signed-off-by: Qiu Wenbo <qiuwenbo@phytium.com.cn>
2019-12-14 14:25:44 +00:00
Qiu Wenbo
32ebbca42f hidpp20: fix G305 quirk detection
Signed-off-by: Qiu Wenbo <qiuwenbo@phytium.com.cn>
2019-12-14 14:25:44 +00:00
Stephan Lachnit
a0afbfeb3f Update CircleCI config
Rename fedora_latest to fedora_31 which is more representative.
Drop the Fedora Rawhide workflow which was always disabled anyway.

Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2019-12-13 09:34:26 +10:00
Stephan Lachnit
9dfd4fd03a remove .gitignore
Use a personal .gitignore for your build directory instead.

Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2019-12-12 20:06:16 +00:00
Peter Hutterer
b0ea75979a data: add a test for unifying receiver IDs
We don't want any device files that use the receiver itself as a match so
let's test for that. In virtually all cases this means the user must update
the kernel and hope support for that receiver is already present in that
version.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-11 00:27:35 +00:00
Stephan Lachnit
a5c1ca202e drivers: add Roccat Kone Pure driver
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2019-12-11 00:20:02 +00:00
Peter Hutterer
8d40ad6c0c libratbag: only log to stderr for error messages
This was copied from libinput and made sense while libratbag was a library -
we want "unhandled" messages to end up somewhere and stderr is the most likely
candidate here.

Now that we always run within ratbagd and it's all effectively inseperable,
just log to stdout for anything below error.

The switch statement was reformatted for consistency, only the ERROR case has
changed code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-11 09:07:10 +10:00
Peter Hutterer
72d11de597 ratbagd: print two verbose messages at startup
When no device is present, starting ratbagd even with --verbose prints exactly
nothing. Let's be more verbose here to give the user an indication that
something's happening. The user wants everything, is probably willing to
accept anything but in the end all we can say is that we have nothing.

Related to #862

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-10 22:48:53 +00:00
Filipe Laíns
47cc5fce92 github: add issue templates
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-12-05 10:01:59 +00:00
Filipe Laíns
5da791b268 ratbagd: support the old --verbose=raw syntax
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-12-05 09:44:35 +00:00
Filipe Laíns
e63802b01a ratbagd: make raw the default verbosity level (#857)
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-12-05 08:07:46 +10:00
Jeff Huang
cd89b123ce Add Logitech M585/M590 support. (#845) 2019-11-27 15:52:18 +10:00
Peter Hutterer
f6546b3222 circle CI: add diff as fedora package
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-18 08:50:36 +10:00
Peter Hutterer
cd8ddc8444 circle CI: switch to Fedora 31
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-18 07:16:22 +10:00
Luke
cdb3226ef1 meson: don't use brackets, parenthesis and braces in filenames
Renamed filenames to avoid brackets, and added a check to data-parse-test.py to
check for brackets, parentheses, and braces so they aren't shipped in filenames
in the future.
2019-11-17 00:11:42 +00:00
Peter Hutterer
ce377fc36c meson.build: libratbag 0.11
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-05 11:06:27 +10:00
Mateusz Mojsiejuk
fe1308fe38 data: add Steelseries Kinzu V3 2019-11-02 21:21:41 +00:00
FFY00
983d3e2a88 data: fix G502 Hero Wireless .device file
Signed-off-by: FFY00 <lains@archlinux.org>
2019-10-23 18:47:17 +01:00
Filipe Laíns
3a3d9e1148 devices: add Logitech G604
Fixes #827

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-10-23 18:46:44 +01:00
Pieter
afbba26feb data: add wireded ID to G502 Hero Wireless 2019-10-23 18:45:14 +01:00
Peter Hutterer
8cc37047fb tools: fix typo in ratbagd.py
Reported in https://github.com/libratbag/piper/issues/406

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-16 10:50:58 +10:00
Benjamin Tissoires
c8f56cc535 swig: generate python helpers to use hidpp C library
```
$> sudo python3
Python 3.7.1 (default, Nov 23 2018, 10:01:49)
[GCC 8.2.1 20181105 (Red Hat 8.2.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hidpp
>>> f = open('/dev/hidraw1', 'r+b')
>>> base = hidpp.hidpp_device()
>>> hidpp.hidpp_device_init(base, f.fileno())
>>> dev = hidpp.hidpp20_device_new(base, 0xff)
>>> hidpp.hidpp20_feature_get_name(0x8100)
'HIDPP_PAGE_ONBOARD_PROFILES'
>>> hidpp.new_uint8_tp()
<Swig Object of type 'uint8_t *' at 0x7f865198fb70>
>>> feature_index = hidpp.new_uint8_tp()
>>> feature_type = hidpp.new_uint8_tp()
>>> feature_version = hidpp.new_uint8_tp()
>>> hidpp.hidpp_root_get_feature(dev, 0x8100, feature_index, feature_type, feature_version)
0
>>> hidpp.uint8_tp_value(feature_index)
14
```

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-09-26 09:12:42 +01:00
Dustin Falgout
b6936ddd3b Add Support For Logitech MX Master 3 (#819) 2019-09-20 15:32:43 +10:00
Filipe Laíns
d4d9712316 hidpp20: add suport for the G602
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-09-11 09:43:41 +01:00
Filipe Laíns
2353af214b hidpp20: fallback to 1st profile when no 8100 profile is active
When the windows driver puts a device in host mode it will mark all 8100
profiles as disabled. If no 8100 profile is enabled no libratbag profile
will get enabled. This patch prevents this by marking the first profile
as enabled if no profile is already enabled.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-09-11 09:33:45 +01:00
Filipe Laíns
a4d19efb93 hidpp20: fix reading cluster info in the 8071 feature
TBH I don't know why I wrote the original code in the first place, it
clearly doesn't follow the spec.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-09-11 15:09:43 +10:00
Filipe Laíns
cb0b458824 hidpp20: make cluster_info a single variable in hidpp20drv_read_led_8071
This was probably leftover code.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-09-11 15:09:43 +10:00
Adrian Pascu
48c476b28c Add missing MX master PID
As seen here: https://github.com/torvalds/linux/blob/master/drivers/hid/hid-logitech-hidpp.c#L3717
This mouse is a warranty replacement, shows up as MX Master in Logitech Options but has MX Master 2S Hardware.
2019-09-02 13:24:18 +10:00
Filipe Laíns
d6c3bf881d hidp20: rename profile mapping 0x04
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-08-30 11:11:23 +01:00
rHermes
1b000e627a Add G502 Hero Wireless to meson.build 2019-08-20 11:03:54 +02:00
rHermes
75bcf39114 Add Logitech G502 Hero Wireless device 2019-08-20 11:03:54 +02:00
Peter Hutterer
33ced3dfb7 hidpp10: if we can't fetch the current profile, error out
Right now we initialize any hidpp10 device with one profile and then go and
fetch the data. But we never check for return codes, so it always succeeds
even when we can't get anything out of the device at all. Eventually we fail
the sanity checks with "invalid dpi list" which is confusing at best.

Let's avoid this by requiring at least the current profile to work. This will
break devices that have a single emulated profile, i.e. those that don't have
profiles but rely on libratbag to emulate one based on the
current-resolution/current-... calls. Not sure we actually support any of
those, so let's see.

Closes #738 though it doesn't fix it, it just bails out better.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-19 15:49:24 +02:00
Peter Hutterer
906f17add2 Rename ratbag_test_driver to ratbag_try_driver
This is confusing because we do have a test driver and we have an optional
test_device argument here too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-19 15:49:24 +02:00
Filipe Laíns
016de548fc hidpp20: fix setting default resolution
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-08-17 10:02:28 +02:00
banditopazzo
665c022382 added bluetooth device ID in profiles for Logitech MX Master AMZ (amazon) 2019-08-15 08:37:58 +10:00
Filipe Laíns
81c7b42bec hidpp20/data: add the G305
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-08-13 08:52:06 +01:00
Filipe Laíns
edb054c6f8 hidpp20: add quirk system
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-08-13 08:52:06 +01:00
Peter Hutterer
8ae995b72d hidpp10: try switching to profile 0 where the device is in factory profiles
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-04 17:17:56 +02:00
Peter Hutterer
a941b75ef2 hidpp10: if the current profile is the factory profile, pretend it's 0
Rather than bail out completely, let's pretend the factory profile is profile
0 and keep going. This gives us a pretend-function mouse, though whether this
actually works is questionable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-04 17:17:56 +02:00
Peter Hutterer
8cb85da6be release.sh: make this script usable for piper
Remove some hardcoded names and fix the version number extraction.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-04 17:17:45 +02:00
Peter Hutterer
7ff59a636f release.sh: drop the module file and section handling
leftover from when this was the xorg release script, we need neither here

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-04 17:17:45 +02:00
Peter Hutterer
6cd050f541 release.sh: fix version number replacement
sed treats . as "any character", so this breaks if we have a 0.10 version
number.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-04 17:17:45 +02:00
Peter Hutterer
ab3f1df06e meson.build: libratbag 0.10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-02 11:19:16 +10:00
Peter Hutterer
caa31e17cf circle CI: add meson plain and release build types
Second time lucky.

Fixes #770

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-01 20:02:28 +10:00
Peter Hutterer
b7e6103496 circleci: move existing config to the new location
CircleCI 2.0 requires a new config file location, otherwise it won't run. And
since 1.0 is sunset now, this means our CI wasn't getting executed.

The actual format of the config is the same, we were already using 2.0
features.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-01 10:24:09 +10:00
Peter Hutterer
b1b6a2761e Revert "circle CI: add meson plain and release build types"
This broke CircleCI but since it didn't run for that build, no-one noticed.

This reverts commit 3bc31edd72.
2019-08-01 10:24:09 +10:00
Peter Hutterer
11f4f32947 Revert "hidpp20: add quirk system"
This reverts commit 196d53e65f.
2019-08-01 09:47:00 +10:00
Peter Hutterer
4f5d0dffec Revert "hidpp20/data: add the G305"
This reverts commit cad05ffced.
2019-08-01 09:47:00 +10:00
Peter Hutterer
d213bdb86e data: add a test for duplicate DeviceMatch lines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-01 09:22:03 +10:00
Peter Hutterer
e69e1de17b devices: drop the G700s wireless entry
The G700 and G700s both use the receiver's product id, so they both end up
having the same DeviceMatch. One of those two never gets loaded but which one
is implementation-defined and may change accidentally.

Let's drop the G700s entry because the G700 is closer to a lowest comon
denominator. Once we have kernel support for the actual product id, we can
re-instante them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-01 09:22:03 +10:00
Filipe Laíns
cad05ffced hidpp20/data: add the G305
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-08-01 09:20:47 +10:00
Filipe Laíns
196d53e65f hidpp20: add quirk system
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-08-01 09:20:47 +10:00
Peter Hutterer
c606b1abe3 tools: flake8 fixes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-31 09:08:06 +10:00
Peter Hutterer
b4009669b9 ratbagd: Add an APIVersion property to make version checks easier
While the DBus API is still in flux, things can break at any time.

Keeping piper and libratbag in version-step works terribly, doubly so where
piper is flatpaked but ratbagd comes from some repo somewhere. We can't check
at build-time, we can't run ratbagd --version at runtime.

so let's add a version field for now and drop it if we ever get to stable.
Meanwhile, ratbagd.py will throw an exception if the expected version doesn't
match exactly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-31 09:08:06 +10:00
Peter Hutterer
d458305f93 tools: ratbagdctl.test: if an exception occurs during startup, terminate
Don't leave a ratbagd.devel process hanging if something goes wrong.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-31 09:08:06 +10:00
Peter Hutterer
9c11960665 ratbagd: document the various commandline options in the man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-31 08:46:19 +10:00
Peter Hutterer
e8fc8b45d1 ratbagd: drop the hardcoded test device
Force the tests to load a test device with JSON that matches their
expectations instead of having a magic device pre-setup where the tests have
to know what the values are.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-31 08:36:16 +10:00
Peter Hutterer
e64a121572 tools: switch the button tests over to json 2019-07-31 08:36:16 +10:00
Peter Hutterer
607e47953c tools: switch led tests to use the json parsing 2019-07-31 08:36:16 +10:00
Peter Hutterer
a5816055dc tools: switch the report rate to json 2019-07-31 08:36:16 +10:00
Peter Hutterer
62ac0772f5 tools: switch the dpi test to json 2019-07-31 08:36:16 +10:00
Peter Hutterer
fc9e63a5aa tools: switch the resolution tests to use the json loading 2019-07-31 08:36:16 +10:00
Peter Hutterer
936a8f7a92 tools: switch the ratbagctl.test to use the new json loading 2019-07-31 08:36:16 +10:00
Peter Hutterer
818e665853 ratbagd: add ability to load json for test devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-31 08:36:16 +10:00
Peter Hutterer
3a3b11ade4 ratbagctl: autogenerate the choices list for the specials and led modes
Let's not maintain that list manually if we can fetch it from the enums.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-30 12:39:11 +02:00
Peter Hutterer
3bc31edd72 circle CI: add meson plain and release build types
Fixes #770

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-30 12:31:01 +02:00
Peter Hutterer
485df20a83 tools: fix typo in ratbagd.py
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-30 19:30:11 +10:00
Peter Hutterer
49291c4b45 ratbagd: encode the test device path without underscores
sd-bus encodes underscores as _5f which looks like memory corruption. Let's
skip them, they don't add value anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-30 19:28:07 +10:00
Filipe Laíns
02ec2442d3 hidpp20: add support for RGB Effects feature (0x8071)
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-30 15:12:10 +10:00
Filipe Laíns
a8b4d9c6f3 hidpp20: add new profile layout (0x04)
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-30 15:11:54 +10:00
Peter Hutterer
22a6ac1c7e hidpp10: make raw debugging messages a bit easier to read
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-30 12:01:42 +10:00
Peter Hutterer
42c302c860 tools: fix a few comments referring to old names
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-29 09:53:36 +10:00
Peter Hutterer
e2b1581aef tools: ratbagctl.test: set the data dir correctly
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-29 09:35:56 +10:00
Peter Hutterer
10a3e87980 meson.build: remove unused fallback SVG name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-29 06:55:30 +10:00
Peter Hutterer
2d465a63e1 meson: drop the unused libratbag version define
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-29 06:52:14 +10:00
Eric Culp
c2315323f4 meson.build: fix builds with --buildtype=plain
When building with --buildtype=plain, the build fails with the following
error:

    cc1: error: ‘-Wformat-security’ ignored without ‘-Wformat’ [-Werror=format-security]

-Werror=format-security was recently added in 43def1b3a5 by #745
2019-07-27 09:43:49 +10:00
Peter Hutterer
05d7e9b324 ratbagd: poke DBus to reload its config after installing the devel policy
Fixes #753
2019-07-26 16:42:01 +10:00
Peter Hutterer
71a399f20f ratbagd: encode the test device iteration in the test device name
The sequence triggered by the ratbagctl.test suite is:
- DBus call Commit()
- ratbagd schedules the callback as idle func
- DBus call ResetTestDevice()
- ratbagd cleans up the test device
- callback is called on next idle
  - boom! the device is already freed

To avoid this, we need to take a ref of the device while it's being scheduled
for the commit handling. But that blocks the object paths for new test devices
because the test device name is encoded in those paths (like "hidraw" for real
devices) and it doesn't change. So let's add a count to the test device name
to make sure the new device doesn't re-use the old device's paths.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-26 16:41:04 +10:00
Peter Hutterer
8259c2e706 ratbagd: introduce ref/unref for ratbagd_device pointers
We'll need to keep references around to devices even when caller is done with
them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-26 16:41:04 +10:00
Peter Hutterer
89980a4a72 meson: add the prefix to the dbus dir
Otherwise where the directory is used within meson.build, the prefix would be
missing. No real effect since we don't use it anywhere but let's be safe.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-26 09:34:31 +10:00
Peter Hutterer
79e94b4a7e ratbagd: install the devel dbus policy file on startup
Don't rely on some other tool to install the policy file, let's just do this
in ratbagd.devel directly so it's immediately executable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-26 09:34:31 +10:00
Peter Hutterer
122f05c272 tools: drop the RATBAGCTL_DEVEL environ, just use RATBAG_TEST instead
Which is the same env that ratbagd uses as well. And we don't have variable
values in RATBAGCTL_DEVEL anymore, so no point in having two different
variables here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-26 09:34:31 +10:00
Peter Hutterer
b06ac1035e tools: add --use-existing-ratbagd to the ratbagctl.test script as well
This makes it possible to run the script against a manually started
ratbagd.devel - with a lot less effort.

And since we're don't need to be root to do this, let's move that check too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-26 09:34:31 +10:00
Peter Hutterer
647fe432b2 tools: add argument to ratbagctl.devel to connect to running ratbagd
This makes it a lot easier to start ratbagd.devel in gdb, then run
ratbagctl.devel against it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-26 09:34:31 +10:00
Peter Hutterer
4e2e9f037b Drop the ratbagctl.devel sha bus name
We already have a separate name for the devel bus anyway, the git sha doesn't
give us a huge amount of benefits but makes manual debugging a major PITA.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-26 09:34:31 +10:00
Peter Hutterer
f92fee0b15 meson: document the various built bits a bit better
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-26 09:34:31 +10:00
Peter Hutterer
d7c394f379 tools: ratbactl.test: if RATBAGCTL_DEVEL is set, use the existing server
When there's a bug that's triggered by the test suite it's hard to figure out
what exactly crashes. So allow starting ratbagd.devel manually and run the
test suite against that process so we can gdb it.

The steps required for this are a bit insane, so the instructions are listed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-25 21:38:12 +10:00
Peter Hutterer
7fec19f8f2 test: switch the resolution capabilities to an array
Just like the profile ones

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-25 09:08:55 +02:00
Peter Hutterer
11c1e2d71a Fix setting the capability flags on the resolutions
2 hours of debugging... ffs

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-25 09:08:55 +02:00
Peter Hutterer
e2cbaf9dea tools: print the Model in ratbagctl info
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-25 07:26:27 +02:00
Peter Hutterer
bf9d86e228 hidpp10: if the profile name is the empty string, make it NULL
Because our profile struct can never have an NULL name, let's assume the
empty string equals NULL.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-25 13:02:18 +10:00
Filipe Laíns
f24a3bd441 hidpp20: fix 0x1001 comments, add missing ASE and use get_unaligned_be_u16
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-24 19:17:31 +10:00
Filipe Laíns
df5742ebfe libratbag-util: move data manipulation functions out of hidpp-generic
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-24 19:17:21 +10:00
Peter Hutterer
0c569e0bf7 tools: use super() in the ratbagctl test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-24 09:16:24 +02:00
Peter Hutterer
5ea1731f38 tools: use super() without arguments in ratbagctl
I *think* this is a Python2 leftover or something. Either way, let's remove
it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-24 09:16:24 +02:00
Peter Hutterer
572064aba8 tools: use super() instead of the named parent class in ratbagd.py
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-24 09:16:24 +02:00
Peter Hutterer
da2764e78d Append the created profiles/leds/buttons/resolutions, don't insert
We're initializing them with incrementing indices, let's make sure the list is
initialized that way too. Makes things more obvious in the log when the first
profile to be queried from the device isn't profile 4.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-23 13:47:11 +02:00
Peter Hutterer
4e56afae22 roccat: use the new get/set feature helpers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-23 13:46:23 +02:00
Peter Hutterer
d46251900c hidraw: add a feature report get/set helper functions
No real functional changes since they just forward to the existing function.
But it reduces the cognitive load a bit when reading the code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-23 13:46:23 +02:00
Peter Hutterer
43def1b3a5 meson.build: enable -Werror=format-security
We don't want to accidentally ignore those.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-19 07:17:45 +02:00
Filipe Laíns
247ff7695d data: add MX Vertical
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-19 07:57:53 +10:00
Filipe Laíns
7a14026f2d hidpp20: fix warnings
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 15:13:51 +01:00
Filipe Laíns
55925db29e meson: bump project version to 0.9.906
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 13:29:12 +02:00
Peter Hutterer
87d4aed3ad Drop the cpp requirement and linker tests
This is a leftover from libratbag-as-a-library and obsolete now that ratbagd
is our only product. Our buildtest now is simply: "does ratbagd build?" and we
certainly shouldn't require a C++ compiler.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-17 07:20:36 +02:00
Peter Hutterer
7de944aaa0 Use python3-embed as dependency on Python 3.8
Python 3.8 no longer links to libpython, resulting in undefined references to
Python API.

But it provides a python3-embed.pc now, so let's try using that first and only
fall back on the normal case if that fails.

See https://github.com/mesonbuild/meson/issues/5629
2019-07-17 06:05:36 +02:00
Filipe Laíns
488774d3ba data: add logitech-g403-hero.device
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 09:49:01 +10:00
Filipe Laíns
0673af2991 data: add logitech-g403-wireless.device
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 09:49:01 +10:00
Filipe Laíns
0e84b63921 data: remove -over-USB from .device name and follow the layout of other .device files
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 09:49:01 +10:00
Filipe Laíns
6e34f314f8 data: add logitech-g903-hero.device
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 09:49:01 +10:00
Filipe Laíns
e3268f2ce6 data: add device PID to logitech-g903.device
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 09:49:01 +10:00
Filipe Laíns
47623654d0 data: add logitech-g703-hero.device
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 09:49:01 +10:00
Filipe Laíns
94423769b9 data: add device PID to logitech-g703.device
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 09:49:01 +10:00
Filipe Laíns
4efe8f4830 data: add device PID to logitech-g603.device
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 09:49:01 +10:00
Filipe Laíns
ac06e7d0c8 data: start using the device PID in logitech-g602.device
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 09:49:01 +10:00
Filipe Laíns
f534cb55b0 data: remove logitech-gpowerplay-wireless.device
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 09:49:01 +10:00
aTosser
bb3f386cca data: remove logitech-lightspeed.device
No longer required as G900 WPID already included in logitech-g900.device

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 09:49:01 +10:00
aTosser
6393338d0f data: start using the device PID in logitech-g-pro-wireless.device
Changed PID for wireless PID. Necessary post Linux 5.2

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 09:49:01 +10:00
Filipe Laíns
b225e4bd80 hidpp20: simplify hidpp20_onboard_profiles_initialize
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-17 09:47:00 +10:00
Filipe Laíns
635257d6b8 hidpp20: improve debug messages
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-10 16:39:44 +02:00
Filipe Laíns
b31a8c5355 hidpp20: fall back to firmware profiles on a profile by profile basis
currently if any use profile is not valid we fallback to the firmware
profiles. this is quite annoying because the user might have only one
valid profile. this patch will keep valid profiles and only fallback to
firmware profiles on a profile by profile basis.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-10 16:39:44 +02:00
Ian Santopietro
412f3fef87 data: fix incorrect PID in MX Anywhere 2 2019-07-08 17:56:06 +02:00
Filipe Laíns
8f88573a08 hidpp20: fix reading onboard profiles (8100)
when we read the memory from the device we already align the offset so
that it matches the end of the sector. for ex, for a 255 sector size the
offset will be set to 255-16.
when we copy the memory (using memcpy) we just copy the bytes that will
finish filling the buffer, ignoring that the offset was aligned. we need
to copy the full 16 bytes, otherwise it will fail when sector_size does
not align with 16.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-08 10:33:53 +02:00
Filipe Laíns
c1265bc98a hidpp10: fix segfault for the c531 (and possibly other 27MHz receivers)
hidpp10_read_memory will return the HID++ error if the request fails.
right now, the error code from hidpp10_read_memory is transparently
passed through hidpp10_onboard_profiles_read_macro. This is problematic
because hidpp10_onboard_profiles_parse_macro only aborts on rc < 0 and
HID++ error are > 0.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-05 07:54:09 +10:00
Filipe Laíns
723d394c02 data: add Logitech Marathon M705
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-03 08:51:29 +10:00
Filipe Laíns
808f423600 data: add ID to MX Ergo
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-02 14:14:50 +02:00
Filipe Laíns
ae9c639a74 data: add Logitech MX518
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-02 14:14:28 +02:00
Filipe Laíns
932cbf0a5c logitech: don't show hidden features
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-07-02 09:55:11 +02:00
Yigit Guneli
486842b6cb data: add Logitech MX Ergo
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-06-28 18:47:08 +01:00
Ian Santopietro
2ae8233eeb data: add other Bluetooth PID to MX Anywhere 2
My MX Anywhere 2 has a different PID from the one supplied in the default .device file. This adds the PID to the device file to ensure mice with this PID get detected too.
2019-06-28 18:46:00 +01:00
Peter Hutterer
cdd70105b5 data: add a README for devices, remove the svg one
We don't ship SVGs here anymore, so let's remove that README. And instead add
one to the devices directory.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-17 09:44:41 +10:00
FFY00
6babb7b307 data: add other ID to MX Master 2019-05-31 18:24:25 +10:00
Pedro Vanzella
26843861c0 Add battery voltage reporting for newer mice 2019-05-29 13:50:41 +02:00
FFY00
2eed8dbb92 steelseries: only print firmware version on successful read 2019-05-28 07:57:22 +10:00
FFY00
a13ee32c61 steelseries: fix bug where we were wrongly dellocating dpi_{range,list}
_cleanup_ is deallocating the pointer returned by
ratbag_device_data_steelseries_get_dpi_{range,list}(). Deallocating
dpi_list results in a wrong step value, and a wrong step value then
results in a wrong step count when we try to set the dpi.

Fixes #436 and #702
2019-05-27 00:25:39 +01:00
Peter Hutterer
dbe98ed5b9 circleci: update to fedora 30
And install dbus-daemon manually, until we figure out how to correctly start
the new dbus-broker this will at least help us pass the tests.

And disable nss-systemd so we don't suffer from timeouts as dbus-daemon waits
for that to time out, see c425780220 for details.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-24 02:49:20 +01:00
Peter Hutterer
c425780220 circleci: drop libnss-systemd from Ubuntu
This is installed by software-properties-common, but since we don't
start our container with systemd, it effectively points to nowhere, adding
nothing but a delay of several minutes.

That delay affects dbus-daemon on startup and on configuration reload, it
takes several minutes to do either. ratbagctl.test installs a custom dbus
config file to be able to connect to ratbagd.devel, that config file triggers
a reload in the dbus-daemon. Since that reload takes longer than any of our
timeouts, the tests eventually fail.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-24 09:32:50 +10:00
Peter Hutterer
1e9839cb67 circle CI: switch to ubuntu 19.04
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-24 09:32:50 +10:00
FFY00
bbeaef749e meson: add 'sphinx-build' to sphinx executable name list 2019-05-24 07:16:19 +10:00
Peter Hutterer
240231b065 Error out if NDEBUG is defined
At some point meson #defined NDEBUG depending on the build type, thus
disabling asserts. libratbag relies on those, so let's error out if NDEBUG is
defined.

Related #685
2019-05-07 09:24:28 +02:00
Benjamin Tissoires
6f27053ab0 driver-hidpp20: re-enable changing the report rate
Fixes bf127d4c68

Related: #692

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-29 10:29:59 +10:00
Benjamin Tissoires
fc16a8dc7c ratabgc: handle the None value from the macro
Not sure why ratbagctl doesn't complain about it, but ratbag-command does

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-29 10:29:59 +10:00
Benjamin Tissoires
6256e9046f ratbagc: Fix a missing macro enum conversion
An overlook from 10305a123c

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-29 10:29:59 +10:00
Benjamin Tissoires
563550c473 driver-hidpp20: use the correct active dpi index
There is no guarantees the current value of dpi_index will be correct.
On my G502 the profiles are read in reverse order meaning that setting the
dpi_index can be applied to a wrong value.

Look for the correct libratbag dpi index before setting it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-29 10:29:59 +10:00
Benjamin Tissoires
a04f2d1c24 data: update G900 and G403 for kernel v5.2+
kernel v5.2 should solve #380, finally

Fixes #380


Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-24 14:46:07 +01:00
Daniel Caujolle-Bert
d86933d746 Add MX-Anywhere-2S bluetooth IDs. 2019-04-10 12:03:45 +01:00
FFY00
55f7d75567 steelseries: fix regression in v2 led
Fixes #683
2019-04-09 12:16:48 +01:00
Rene Kjellerup
6ee1c0a591 devices: add other ID for Logitech G Pro
Fixes #684
2019-04-05 22:39:33 +01:00
Peter Hutterer
94d32930e2 ratbagd: use libunistring to convert profile names to utf-8
Where a profile name is not UTF8 compatible, let's try to convert it from
latin-1. If that fails, we just escape anything that's not ascii and move on.

Fixes #617

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-15 08:25:00 +01:00
Peter Hutterer
2b2d8e8980 ratbagctl: get the special name list from the enum
For two dicts x and y the merged dict can be created as {**x, **y}. We use
that to take the enum names and covert them to lowercase with hyphens instead
of underscores.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-12 16:33:05 +01:00
Peter Hutterer
10305a123c tools: convert our enum equivalents to python enums
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-12 16:33:05 +01:00
Peter Hutterer
11db35edba Fix flake8 warnings (#678)
The only notable one here is the regex that had an escape sequence

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-12 06:49:54 +01:00
Peter Hutterer
836922b133 ratbagd: fix property update notifications
Don't send property updates for props that don't exist anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-08 08:39:11 +01:00
FFY00
4d00a815a4 revert "data: add Logitech G100s (#670)"
This reverts commit 0e28d82a16.
2019-03-05 22:15:42 +01:00
Filipe Laíns
0e28d82a16 data: add Logitech G100s (#670) 2019-03-05 16:57:39 +01:00
Peter Hutterer
336440cddb Install the device files in the top-level datadir
Now that the SVGs are gone, we don't need the subfolder anymore

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-05 09:06:05 +01:00
Peter Hutterer
b2a3d39122 libratbag: improve debugging to help with new devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-05 13:29:11 +10:00
Peter Hutterer
4b7b9d2e48 meson.build: rename the logind dep for consistency with the rest
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-04 20:17:06 +10:00
Andy Fitzsimon
57097ceddb updated logo look and feel
Rough update but headed in the right direction

* Simplified silhouette of bag
* Reduced number of rats inside the Rat Bag to two 
* Eyes are still small and potentially still not printable at small scale
* Introduced rough stylized logotype based on Google's Sedgwick Ave Display font
* Reduced total file size by a heap
2019-03-04 10:44:59 +10:00
FFY00
c7ce1a96a7 data: rename logitech-g900-wireless to logitech-lightspeed 2019-03-04 10:33:58 +10:00
167 changed files with 11083 additions and 2154 deletions

20
.editorconfig Normal file
View File

@@ -0,0 +1,20 @@
root = true
[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
[*.{c,h}]
indent_style = tab
tab_width = 8
trim_trailing_whitespace = true
[{*.{py,py.in},tools/ratbagctl.*.in}]
indent_style = space
indent_size = 4
[*.{yml,xsl}]
indent_style = space
indent_size = 2

42
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,42 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Information**
<!-- If your issue is related to a Logitech device please make sure you are running at least Linux 5.2 -->
- `ratbagd` version (`ratbagd --version`):
- Distribution:
- Kernel version (ex. `uname -srmo`): `KERNEL VERSION HERE`
Device info (if applicable):
```
$ ratbagctl <device> info
OUTPUT HERE
```
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Logs**
Please start the daemon with verbosity and reproduce the issue.
First make sure it isn't running already.
```
$ ratbagd --verbose=raw
OUTPUT HERE
```
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

39
.github/actions/meson/action.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
# A Github Action to build a repository with meson
name: "Setup and run meson"
description: "Setup and run meson"
inputs:
builddir:
description: "The build directory"
default: "builddir"
srcdir:
description: "The source directory"
default: "."
meson_args:
description: "Arguments passed to meson setup"
default: ""
meson_skip_test:
description: "Set to a nonempty string to skip meson test"
default: ""
meson_test_args:
description: "Arguments passed to meson test"
default: ""
meson_precmd:
description: "Set to 'sudo' to run with sudo"
default: ""
ninja_args:
description: "Arguments passed to ninja"
default: ""
ninja_precmd:
description: "Set to 'sudo' to run with sudo"
default: ""
runs:
using: "composite"
steps:
- run: |
${{inputs.meson_precmd}} meson setup ${{inputs.builddir}} ${{inputs.srcdir}} ${{inputs.meson_args}}
${{inputs.meson_precmd}} meson configure ${{inputs.builddir}}
${{inputs.ninja_precmd}} ninja -C ${{inputs.builddir}} ${{inputs.ninja_args}}
if [[ -z "${{inputs.meson_skip_test}}" ]]; then
${{inputs.meson_precmd}} meson test -C ${{inputs.builddir}} --print-errorlogs ${{inputs.meson_test_args}};
fi
shell: bash

17
.github/actions/pkginstall/action.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: "Install packages"
description: "Install a set of packages from sources"
inputs:
apt:
description: "The package list to install with apt"
pip:
description: "The package list to install with pip"
pip_precmd:
description: "Set to the string 'sudo' to run through sudo"
default: ""
runs:
using: "composite"
steps:
- run: sudo ${{ github.action_path }}/install-apt.sh ${{ inputs.apt }}
shell: bash
- run: ${{inputs.pip_precmd}} ${{ github.action_path }}/install-pip.sh ${{ inputs.pip }}
shell: bash

14
.github/actions/pkginstall/install-apt.sh vendored Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash -x
# If called without arguments, just skip the rest
if [[ -z "$@" ]]; then
exit
fi
# Don't care about these bits
echo 'path-exclude=/usr/share/doc/*' > /etc/dpkg/dpkg.cfg.d/99-exclude-cruft
echo 'path-exclude=/usr/share/locale/*' >> /etc/dpkg/dpkg.cfg.d/99-exclude-cruft
echo 'path-exclude=/usr/share/man/*' >> /etc/dpkg/dpkg.cfg.d/99-exclude-cruft
apt-get update
apt-get install -yq --no-install-suggests --no-install-recommends $@

9
.github/actions/pkginstall/install-pip.sh vendored Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash -x
# If called without arguments, just skip the rest
if [[ -z "$@" ]]; then
exit
fi
python -m pip install --upgrade pip
python -m pip install --upgrade "$@"

50
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: linux
on: [ push, pull_request ]
env:
UBUNTU_DEP_BUILD: |
gcc g++ pkg-config systemd libevdev-dev libglib2.0-dev
libjson-glib-dev libsystemd-dev libudev-dev libunistring-dev
python3-dev python3-evdev swig python3-sphinx
UBUNTU_DEP_TEST: check python3-gi python3-lxml valgrind
PIP_PACKAGES: meson ninja libevdev pyudev pytest sphinx_rtd_theme
jobs:
build-and-dist:
runs-on: ubuntu-20.04
strategy:
matrix:
meson_args:
- ''
- '-Dbuildtype=plain'
- '-Dbuildtype=release'
- '-Ddocumentation=true'
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pkginstall
with:
apt: $UBUNTU_DEP_BUILD $UBUNTU_DEP_TEST
pip: $PIP_PACKAGES
- name: meson test ${{matrix.meson_args}}
uses: ./.github/actions/meson
with:
meson_args: --prefix=$PWD/_instdir ${{matrix.meson_args}}
ninja_args: install
- name: check installation of data files
run: diff -u <(cd data/devices; ls *.device) <(cd _instdir/share/libratbag; ls *.device)
- name: ninja uninstall
uses: ./.github/actions/meson
with:
meson_args: --prefix=$PWD/_instdir
ninja_args: uninstall
- name: check if any files are left after uninstall
run: (test -d _instdir && tree _instdir && exit 1) || exit 0
# Capture all the meson logs, even if we failed
- uses: actions/upload-artifact@v3
if: ${{ always() }} # even if we fail
with:
name: meson test logs
path: |
builddir/meson-logs/testlog*.txt
builddir/meson-logs/meson-log.txt

31
.github/workflows/pages.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: pages
on:
push:
branches:
- master
env:
UBUNTU_DEP_BUILD: gcc g++ pkg-config systemd libevdev-dev libglib2.0-dev libjson-glib-dev libsystemd-dev libudev-dev libunistring-dev python3-dev python3-evdev python3-pip swig python3-sphinx python3-sphinx-rtd-theme
PIP_PACKAGES: meson ninja
jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pkginstall
with:
apt: $UBUNTU_DEP_BUILD
pip: $PIP_PACKAGES
- name: Build docs
uses: ./.github/actions/meson
with:
meson_args: -Ddocumentation=true -Dtests=false
meson_skip_test: yes
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./builddir/doc/html/
allow_empty_commit: true

11
.gitignore vendored
View File

@@ -1,11 +0,0 @@
*.o
*.pc
*.swp
*~
*.sig
*.tar.*
*.announce
*.patch
*.rej
*.trs
tags

View File

@@ -3,9 +3,10 @@ libratbag
<img src="https://libratbag.github.io/_images/logo.svg" alt="" width="30%" align="right">
libratbag provides **ratbagd**, a DBus daemon to configure gaming mice.
The daemon provides a generic way to access the various features exposed by
these mice and abstracts away hardware-specific and kernel-specific quirks.
libratbag provides **ratbagd**, a DBus daemon to configure input devices,
mainly gaming mice. The daemon provides a generic way to access the various
features exposed by these mice and abstracts away hardware-specific and
kernel-specific quirks.
libratbag currently supports devices from Logitech, Etekcity, GSkill,
Roccat, Steelseries. See [the device
@@ -44,6 +45,10 @@ And to build or re-build after code-changes, run:
ninja -C builddir
sudo ninja -C builddir install
To remove/uninstal simply run:
sudo ninja -C builddir uninstall
Note: `builddir` is the build output directory and can be changed to any
other directory name. To set configure-time options, use e.g.
@@ -168,5 +173,3 @@ libratbag is licensed under the MIT license.
> Software is furnished to do so, subject to the following conditions: [...]
See the COPYING file for the full license information.
[![Build Status](https://circleci.com/gh/libratbag/libratbag.svg?style=shield&circle-token=d7c782e10d2d934b176da754f11b5105ea074f4a)](https://circleci.com/gh/libratbag/libratbag)

View File

@@ -1,224 +0,0 @@
# vim: set expandtab shiftwidth=2 tabstop=8:
libratbag_references:
default_settings: &default_settings
working_directory: ~/libratbag
environment:
LANG: C.UTF-8
build_default: &build_default
name: Build
command: |
rm -rf build
meson build ${MESON_PARAMS}
meson configure build
ninja -v -C build ${NINJA_ARGS}
environment:
MESON_PARAMS: --prefix=/usr
build_and_test: &build_and_test
run:
<<: *build_default
name: Build and test
environment:
NINJA_ARGS: test
build_with_docs: &build_with_docs
run:
<<: *build_default
name: Build with documentation
environment:
MESON_PARAMS: -Ddocumentation=true
install: &install
run:
name: Installing
command: ninja -C build install
check_install: &check_install
run:
name: Checking installation
command: |
PREFIX=/usr/local/
diff -u <(cd data/devices; ls *.device) <(cd $PREFIX/share/libratbag/devices; ls *.device)
check_uninstall: &check_uninstall
run:
name: Checking if any files are left after uninstall
command: |
PREFIX=/root/test_install
# workaround until https://github.com/mesonbuild/meson/pull/2033 is merged
# and a new release appears
git clone https://github.com/whot/meson -b wip/remove-directories-on-uninstall
./meson/meson.py build_install --prefix=$PREFIX
ninja -C build_install install
ninja -C build_install uninstall
if [ -d $PREFIX ]
then
tree $PREFIX
exit 1
fi
export_logs: &export_logs
store_artifacts:
path: ~/libratbag/build/meson-logs
start_dbus: &start_dbus
run:
name: Start dbus daemon
command: |
mkdir /run/dbus
/usr/bin/dbus-daemon --system --fork
fedora_prep_cache: &fedora_prep_cache
<<: *default_settings
steps:
- run:
name: Initializing Fedora dnf cache
command: dnf install -y --downloadonly libsolv tree git gcc gcc-c++ meson check-devel libudev-devel libevdev-devel valgrind python3-gobject python3-evdev glib2-devel python3-lxml
- persist_to_workspace:
root: /var/cache/
paths:
- dnf/*
fedora_fetch_cache: &fedora_fetch_cache
attach_workspace:
at: /var/cache/
fedora_install: &fedora_install
run:
name: Install prerequisites
command: |
echo keepcache=1 >> /etc/dnf/dnf.conf
dnf upgrade -y libsolv
dnf install -y tree git gcc gcc-c++ meson check-devel libudev-devel libevdev-devel valgrind python3-gobject python3-evdev glib2-devel python3-lxml python3-devel swig
fedora_settings: &fedora_settings
<<: *default_settings
steps:
- *fedora_fetch_cache
- *fedora_install
- checkout
- *start_dbus
- *build_and_test
- *install
- *check_install
- *check_uninstall
- *export_logs
ubuntu_settings: &ubuntu_settings
<<: *default_settings
steps:
- run:
name: Install prerequisites
command: |
apt-get update
apt-get install -y software-properties-common
add-apt-repository universe
apt-get update
apt-get install -y tree git gcc g++ pkg-config meson check libudev-dev libevdev-dev libsystemd-dev valgrind python3-gi python3-evdev libglib2.0-dev python3-lxml python3-dev swig systemd
- checkout
- *start_dbus
- *build_and_test
- *install
- *check_install
- *check_uninstall
- *export_logs
doc_build: &doc_build
<<: *default_settings
steps:
- *fedora_fetch_cache
- *fedora_install
- run:
name: Install documentation build-deps
command: dnf install -y python3-sphinx python3-sphinx_rtd_theme
- checkout
- *build_with_docs
- *export_logs
- store_artifacts:
path: ~/libratbag/build/doc/html
- persist_to_workspace:
root: build
paths:
- doc/html/*
docs_deploy: &docs_deploy
<<: *default_settings
steps:
- *fedora_fetch_cache
- run:
name: Install prerequisites
command: dnf install -y git tree
- checkout
- attach_workspace:
at: build
- run:
name: Setup the deploy SSH key
command: |
ssh-add -L | tail -n1 > ~/.ssh/deploy.pub
cat <<EOF > ~/.ssh/config
Host github.com
IdentityFile /root/.ssh/deploy.pub
IdentitiesOnly yes
EOF
- run:
name: Clone doc repository
command: |
cd ~
git clone ssh://git@github.com/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_PROJECT_REPONAME}.github.io
- run:
name: Copy the doc, commit and push
command: |
set +e
cd ~/${CIRCLE_PROJECT_REPONAME}.github.io
\cp -r ~/${CIRCLE_PROJECT_REPONAME}/build/doc/html/* .
if ! git diff-index --quiet HEAD --; then
git config --global user.email "libratbag@librabtag.github.io"
git config --global user.name "The libratbag crew"
git add .
git commit -m "update docs from ${CIRCLE_SHA1}"
git push
fi
version: 2
jobs:
fedora_rawhide:
<<: *fedora_settings
docker:
- image: fedora:rawhide
fedora_cache:
<<: *fedora_prep_cache
docker:
- image: fedora:28
fedora_latest:
<<: *fedora_settings
docker:
- image: fedora:28
ubuntu_17_10:
<<: *ubuntu_settings
docker:
- image: ubuntu:artful
doc_build:
<<: *doc_build
docker:
- image: fedora:28
doc_deploy:
<<: *docs_deploy
docker:
- image: fedora:28
workflows:
version: 2
compile_and_test:
jobs:
# - fedora_rawhide
- fedora_cache
- ubuntu_17_10
- fedora_latest:
requires:
- fedora_cache
- doc_build:
requires:
- fedora_cache
- doc_deploy:
requires:
- fedora_cache
- doc_build
filters:
branches:
only: master

View File

@@ -1,17 +0,0 @@
libratbag data files
====================
This directory contains the SVG files for each theme. In general, device SVGs
should approximate the device to make it immediately recognizable. Detail work
not required, the graphic is an illustration only.
For theme-specific requirements, consult the README in the subdirectories.
Technique
---------
The simplest approach is to find a photo of the device and import it into
inkscape. Put it on the lowest layer, create a new layer "Device" above it
and start tracing the outlines and edges of the device. Fill in the shapes
and your device should resemble the underlying photo. Delete the photo
layer, add leaders and button labels and you're done.

11
data/devices/README.md Normal file
View File

@@ -0,0 +1,11 @@
libratbag data files
====================
This directory contains the data files for each supported device. libratbag
reads these files to identify the backend driver for any given device. If a
device is not listed, libratbag will not support it.
See the device.example file for instructions on the various options.
See the libratbag wiki for more information:
https://github.com/libratbag/libratbag/wiki/Adding-a-device/

View File

@@ -0,0 +1,11 @@
[Device]
Name=ASUS ROG GX860 Buzzard Mouse
DeviceMatch=usb:0b05:1816
Driver=asus
[Driver/asus]
Profiles=3
Buttons=10
Leds=0
Dpis=2
DpiRange=100:8200@100

View File

@@ -0,0 +1,13 @@
[Device]
Name=ASUS ROG Chakram
DeviceMatch=usb:0b05:18e3;usb:0b05:18e5
Driver=asus
[Driver/asus]
Profiles=3
Buttons=5
Leds=3
Dpis=4
Wireless=1
DpiRange=100:16000@100
Quirks=DOUBLE_DPI;STRIX_PROFILE

View File

@@ -0,0 +1,13 @@
[Device]
Name=ASUS ROG Gladius II Origin PNK LTD
DeviceMatch=usb:0b05:18cd
Driver=asus
[Driver/asus]
Profiles=3
Buttons=8
Leds=3
Dpis=2
DpiRange=100:12000@100
ButtonMapping=0;1;2;7;8;5;3;4
Quirks=DOUBLE_DPI

View File

@@ -0,0 +1,14 @@
# "ASUS ROG Gladius II" without "DPI target button"
[Device]
Name=ASUS ROG Gladius II Origin
DeviceMatch=usb:0b05:1877
Driver=asus
[Driver/asus]
Profiles=3
Buttons=8
Leds=3
Dpis=2
DpiRange=100:12000@100
ButtonMapping=0;1;2;7;8;5;3;4
Quirks=DOUBLE_DPI

View File

@@ -0,0 +1,12 @@
[Device]
Name=ASUS ROG Gladius II
DeviceMatch=usb:0b05:1845
Driver=asus
[Driver/asus]
Profiles=3
Buttons=8
Leds=3
Dpis=2
DpiRange=100:12000@100
ButtonMapping=0;1;2;7;8;5;3;4

View File

@@ -0,0 +1,13 @@
[Device]
Name=ASUS ROG Keris Wireless
DeviceMatch=usb:0b05:195e;usb:0b05:1960
Driver=asus
[Driver/asus]
Profiles=3
Buttons=8
Leds=2
Dpis=4
Wireless=1
DpiRange=100:16000@100
Quirks=DOUBLE_DPI

View File

@@ -0,0 +1,14 @@
[Device]
Name=ASUS ROG Pugio
DeviceMatch=usb:0b05:1846
Driver=asus
[Driver/asus]
Profiles=3
Buttons=10
Leds=3
Dpis=2
DpiRange=100:7200@100
# Mappings the same as the Gladius II but with an extra 2 buttons
ButtonMapping=0;1;2;7;8;5;3;4;9;10

View File

@@ -0,0 +1,13 @@
[Device]
Name=ASUS ROG Strix Carry
DeviceMatch=usb:0b05:18b4
Driver=asus
[Driver/asus]
Profiles=3
Buttons=8
Leds=0
Dpis=2
Wireless=1
DpiRange=100:7200@100
Quirks=STRIX_PROFILE

View File

@@ -0,0 +1,11 @@
[Device]
Name=ASUS ROG Strix Impact
DeviceMatch=usb:0b05:1847
Driver=asus
[Driver/asus]
Profiles=0
Buttons=6
Leds=1
Dpis=2
DpiRange=100:5000@100

View File

@@ -0,0 +1,12 @@
[Device]
Name=ASUS ROG Strix Impact II Wireless
DeviceMatch=usb:0b05:1947;usb:0b05:1949
Driver=asus
[Driver/asus]
Profiles=3
Buttons=8
Leds=3
Dpis=4
Wireless=1
DpiRange=100:16000@100

View File

@@ -52,3 +52,29 @@ Leds=1
# The HID++ 2.0 device index
# Should be unset unless required
# DeviceIndex=1
[Driver/asus]
# Number of profiles
Profiles=3
# Number of buttons
Buttons=8
# Number of LEDs
Leds=3
# Number of DPI presets
Dpis=2
# Set if device is wireless
# Wireless=1
# DPI range in format min:max@step
DpiRange=100:16000@100
# Button index mapping
# ButtonMapping=0;1;2;6;7;5;3;4
# Device quirks
# Quirk=DOUBLE_DPI;STRIX_PROFILE

View File

@@ -0,0 +1,11 @@
[Device]
Name=Glorious Model D
DeviceMatch=usb:258a:0033
Driver=sinowealth
[Driver/sinowealth/devices/GloriousModelD]
ButtonCount=6
DeviceName=Glorious Model D
FwVersion=V102
LedType=RBG
SensorType=PMW3360

View File

@@ -0,0 +1,11 @@
[Device]
Name=Glorious Model O/O-
DeviceMatch=usb:258a:0036
Driver=sinowealth
[Driver/sinowealth/devices/GloriousModelO]
ButtonCount=6
DeviceName=Glorious Model O/O- (updated firmware)
FwVersion=V103
LedType=RBG
SensorType=PMW3360

View File

@@ -0,0 +1,5 @@
# Logitech M500s
[Device]
Name=Logitech M500s
DeviceMatch=usb:046d:c093
Driver=hidpp20

View File

@@ -0,0 +1,5 @@
# Logitech M545
[Device]
Name=Logitech M545
DeviceMatch=usb:046d:4052
Driver=hidpp20

View File

@@ -0,0 +1,5 @@
# Logitech M585/M590
[Device]
Name=Logitech M585/M590
DeviceMatch=usb:046d:406b;bluetooth:046d:b01b
Driver=hidpp20

View File

@@ -0,0 +1,4 @@
[Device]
Name=Logitech M720
DeviceMatch=usb:046d:405e;bluetooth:046d:b015
Driver=hidpp20

View File

@@ -0,0 +1,5 @@
# Logitech MX Anywhere 3
[Device]
Name=Logitech MX Anywhere 3
DeviceMatch=bluetooth:046d:b025;usb:046d:4090
Driver=hidpp20

View File

@@ -1,4 +1,4 @@
[Device]
Name=Logitech MX Anywhere 2
DeviceMatch=usb:046d:404a;bluetooth:046d:b013
DeviceMatch=usb:046d:404a;usb:046d:4072;usb:046d:4063;bluetooth:046d:b013;bluetooth:046d:b018;bluetooth:046d:b01f
Driver=hidpp20

View File

@@ -1,4 +1,4 @@
[Device]
Name=Logitech MX Anywhere 2S
DeviceMatch=usb:046d:406a
DeviceMatch=bluetooth:046d:b01a;usb:046d:406a
Driver=hidpp20

View File

@@ -0,0 +1,4 @@
# Logitech MX Anywhere 3B
[Device]
Name=Logitech MX Anywhere 3B
DeviceMatch=bluetooth:046d:b02d

View File

@@ -0,0 +1,5 @@
# Logitech MX Ergo
[Device]
Name=Logitech MX Ergo
DeviceMatch=bluetooth:046d:b01d;usb:046d:406f
Driver=hidpp20

View File

@@ -0,0 +1,5 @@
# Logitech MX Master 3
[Device]
Name=Logitech MX Master 3
DeviceMatch=bluetooth:046d:b023;usb:046d:4082
Driver=hidpp20

View File

@@ -1,5 +1,5 @@
# Logitech MX Master
[Device]
Name=Logitech MX Master
DeviceMatch=usb:046d:4041;bluetooth:046d:b012;usb:046d:4060
DeviceMatch=usb:046d:4041;bluetooth:046d:b012;usb:046d:4060;bluetooth:046d:b017;bluetooth:046d:b01e;usb:046d:4071
Driver=hidpp20

View File

@@ -0,0 +1,4 @@
[Device]
Name=Logitech MX Vertical
DeviceMatch=bluetooth:046d:b020;usb:046d:407b;usb:046d:c08a
Driver=hidpp20

View File

@@ -0,0 +1,4 @@
[Device]
Name=MX518
DeviceMatch=usb:046d:c08e
Driver=hidpp20

View File

@@ -0,0 +1,4 @@
[Device]
Name=Logitech Marathon M705
DeviceMatch=usb:046d:406d
Driver=hidpp20

View File

@@ -0,0 +1,8 @@
[Device]
Name=Logitech G Powerplay
DeviceMatch=usb:046d:405f
LedTypes=logo
Driver=hidpp20
[Driver/hidpp20]
DeviceIndex=7

View File

@@ -1,6 +1,6 @@
[Device]
Name=Logitech G Pro Wireless
DeviceMatch=usb:046d:c539;usb:046d:c088
DeviceMatch=usb:046d:4079;usb:046d:c088
LedTypes=logo;battery;dpi;
Driver=hidpp20

View File

@@ -0,0 +1,5 @@
[Device]
Name=Logitech G Pro X Wireless Superlight
DeviceMatch=usb:046d:4093;usb:046d:c094
LedTypes=logo;battery;dpi;
Driver=hidpp20

View File

@@ -1,5 +1,5 @@
[Device]
Name=Logitech Gaming Mouse G Pro
DeviceMatch=usb:046d:c085
DeviceMatch=usb:046d:c085;usb:046d:c08c
Driver=hidpp20
LedTypes=logo;side

View File

@@ -1,6 +1,6 @@
# G102 and G203 (USB)
# G102, G103 and G203 (USB)
[Device]
Name=Logitech Gaming Mouse G102/G103
DeviceMatch=usb:046d:c084
Name=Logitech Gaming Mouse G102/G103/G203
DeviceMatch=usb:046d:c084;usb:046d:c092
Driver=hidpp20
LedTypes=logo;side;

View File

@@ -0,0 +1,8 @@
[Device]
Name=Logitech Gaming Mouse G305
DeviceMatch=usb:046d:4074
Driver=hidpp20
[Driver/hidpp20]
Leds=0
Quirk=G305

View File

@@ -2,4 +2,5 @@
[Device]
Name=Logitech G402 Gaming Mouse
DeviceMatch=usb:046d:c07e
LedTypes=logo
Driver=hidpp20

View File

@@ -0,0 +1,4 @@
[Device]
Name=Logitech G403 Hero
DeviceMatch=usb:046d:c08f
Driver=hidpp20

View File

@@ -0,0 +1,4 @@
[Device]
Name=Logitech G403 Wireless
DeviceMatch=usb:046d:405d;usb:046d:c082
Driver=hidpp20

View File

@@ -1,5 +1,4 @@
# Logitech G403
[Device]
Name=Logitech G403
DeviceMatch=usb:046d:c082;usb:046d:c083
DeviceMatch=usb:046d:c083
Driver=hidpp20

View File

@@ -7,3 +7,4 @@ Driver=hidpp10
[Driver/hidpp10]
DpiList=400;800;1600;2000
Profiles=1
ProfileType=G500

View File

@@ -1,5 +0,0 @@
# Logitech G502 HERO over USB
[Device]
Name=Logitech G502 HERO
DeviceMatch=usb:046d:c08b
Driver=hidpp20

View File

@@ -0,0 +1,4 @@
[Device]
Name=Logitech G502 Hero Wireless
DeviceMatch=usb:046d:407f;usb:046d:c08d
Driver=hidpp20

View File

@@ -0,0 +1,4 @@
[Device]
Name=Logitech G502 Hero
DeviceMatch=usb:046d:c08b
Driver=hidpp20

View File

@@ -1,4 +1,3 @@
# Logitech G502 Proteus Core over USB
[Device]
Name=Logitech G502 Proteus Core
DeviceMatch=usb:046d:c07d

View File

@@ -1,4 +1,3 @@
# Logitech G502 Proteus Spectrum over USB
[Device]
Name=Logitech G502 Proteus Spectrum
DeviceMatch=usb:046d:c332

View File

@@ -0,0 +1,4 @@
[Device]
Name=Logitech G502 X Wireless
DeviceMatch=usb:046d:c098
Driver=hidpp20

View File

@@ -0,0 +1,4 @@
[Device]
Name=Logitech G502 X
DeviceMatch=usb:046d:c099
Driver=hidpp20

View File

@@ -0,0 +1,5 @@
[Device]
Name=Logitech G513
DeviceMatch=usb:046d:c33c
LedTypes=switches
Driver=hidpp20

View File

@@ -1,8 +1,9 @@
# Logitech G602 over wireless USB
[Device]
Name=Logitech G602
DeviceMatch=usb:046d:c537
DeviceMatch=usb:046d:402c
Driver=hidpp20
[Driver/hidpp20]
DeviceIndex=1
Quirk=G602

View File

@@ -1,5 +1,5 @@
# Logitech G603
[Device]
Name=Logitech G603
DeviceMatch=bluetooth:046d:b01c
DeviceMatch=usb:046d:406c;bluetooth:046d:b01c
Driver=hidpp20

View File

@@ -0,0 +1,4 @@
[Device]
Name=Logitech G604
DeviceMatch=usb:046d:4085;bluetooth:046d:b024
Driver=hidpp20

View File

@@ -0,0 +1,8 @@
[Device]
Name=Logitech G635
DeviceMatch=usb:046d:0a89
LedTypes=logo;side
Driver=hidpp20
[Driver/hidpp20]
Buttons=0

View File

@@ -1,12 +0,0 @@
# Logitech G700s over wireless USB
# http://support.logitech.com/en_us/product/g700s-rechargable-wireless-gaming-mouse/specs
[Device]
Name=Logitech G700s
DeviceMatch=usb:046d:c531
Driver=hidpp10
[Driver/hidpp10]
DpiRange=0:8200@50
ProfileType=G700
DeviceIndex=1
Profiles=5

View File

@@ -0,0 +1,5 @@
[Device]
Name=Logitech G703 Hero
DeviceMatch=usb:046d:4086;usb:046d:c090
Driver=hidpp20

View File

@@ -1,5 +1,5 @@
[Device]
Name=Logitech G703
DeviceMatch=usb:046d:c087
DeviceMatch=usb:046d:c087;usb:046d:4070
Driver=hidpp20

View File

@@ -0,0 +1,7 @@
[Device]
Name=Logitech G733 Gaming Headset
DeviceMatch=usb:046d:0ab5
Driver=hidpp20
[Driver/hidpp20]
Buttons=0

View File

@@ -0,0 +1,5 @@
[Device]
Name=Logitech G815
DeviceMatch=usb:046d:c33f
LedTypes=logo;switches
Driver=hidpp20

View File

@@ -1,8 +0,0 @@
# Logitech G900, G903, G603 and G403 over wireless USB
[Device]
Name=Logitech G900, G903, G603, G403
DeviceMatch=usb:046d:c539
Driver=hidpp20
[Driver/hidpp20]
DeviceIndex=1

View File

@@ -1,5 +1,5 @@
# Logitech G900 over USB
# Logitech G900
[Device]
Name=Logitech G900
DeviceMatch=usb:046d:c081
DeviceMatch=usb:046d:c081;usb:046d:4053
Driver=hidpp20

View File

@@ -0,0 +1,4 @@
[Device]
Name=Logitech G903 Hero
DeviceMatch=usb:046d:c091;usb:046d:4087
Driver=hidpp20

View File

@@ -1,5 +1,4 @@
# Logitech G903 over USB
[Device]
Name=Logitech G903
DeviceMatch=usb:046d:c086
DeviceMatch=usb:046d:c086;usb:046d:4067
Driver=hidpp20

View File

@@ -0,0 +1,8 @@
[Device]
Name=Logitech G910
DeviceMatch=usb:046d:c335
LedTypes=logo;switches
Driver=hidpp20
[Driver/hidpp20]
DeviceIndex=ff

View File

@@ -0,0 +1,8 @@
[Device]
Name=Logitech G915 TKL
DeviceMatch=usb:046d:c343;bluetooth:046d:b35f
LedTypes=logo;switches
Driver=hidpp20
[Driver/hidpp20]
DeviceIndex=1

View File

@@ -0,0 +1,8 @@
[Device]
Name=Logitech G915
DeviceMatch=usb:046d:c33e
LedTypes=logo;switches
Driver=hidpp20
[Driver/hidpp20]
DeviceIndex=1

View File

@@ -0,0 +1,5 @@
[Device]
Name=Logitech G935
DeviceMatch=usb:046d:0a87
LedTypes=logo;side
Driver=hidpp20

View File

@@ -4,8 +4,10 @@
Name=G9x [Original]
DeviceMatch=usb:046d:c066
Driver=hidpp10
LedTypes=dpi
[Driver/hidpp10]
DpiRange=0:5700@23.53
DpiRange=200:5700@50
ProfileType=G500
Profiles=5
Leds=1

View File

@@ -1,8 +0,0 @@
# Logitech G PowerPlay mouse pad + wireless USB receiver.
[Device]
Name=Logitech G PowerPlay mouse pad.
DeviceMatch=usb:046d:c53a
Driver=hidpp20
[Driver/hidpp20]
DeviceIndex=1

View File

@@ -0,0 +1,5 @@
[Device]
Name=Nubwo x7 spectrum
DeviceMatch=usb:258a:0012
Driver=sinowealth_nubwo

View File

@@ -0,0 +1,4 @@
[Device]
Name=openinput
DeviceMatch=usb:1d50:616a
Driver=openinput

View File

@@ -0,0 +1,4 @@
[Device]
Name=Roccat Kone EMP
DeviceMatch=usb:1e7d:2e24
Driver=roccat-kone-emp

View File

@@ -0,0 +1,4 @@
[Device]
Name=Roccat Kone Pure
DeviceMatch=usb:1e7d:2dc2;usb:1e7d:2dbe;usb:1e7d:2dcb
Driver=roccat-kone-pure

View File

@@ -0,0 +1,38 @@
[Device]
DeviceMatch=usb:258a:0027
Driver=sinowealth
Name=SinoWealth Generic Mouse (0027)
[Driver/sinowealth/devices/DreamMachinesDM5Blink]
ButtonCount=8
DeviceName=DreamMachines DM5 Blink
FwVersion=3106
LedType=RGB
SensorType=PMW3389
[Driver/sinowealth/devices/GWolvesHatiHTM]
ButtonCount=6
# Can be both `Ace` and `Classic` version.
DeviceName=G-Wolves Hati HT-M Wired
FwVersion=V161
LedType=None
# Can also be PMW3389
SensorType=PMW3360
[Driver/sinowealth/devices/GenesysXenon770]
# There are 5 main buttons.
# Side buttons are detachable.
# There can be either 3 or 9 buttons on the side.
# Going for the maximum count: 5 + 9 = 14.
ButtonCount=14
DeviceName=Genesys Xenon 770
FwVersion=3110
LedType=RGB
SensorType=PMW3327
[Driver/sinowealth/devices/GloriousModelOOld]
ButtonCount=6
DeviceName=Glorious Model O (old firmware)
FwVersion=V102
LedType=RBG
SensorType=PMW3360

View File

@@ -0,0 +1,12 @@
[Device]
DeviceMatch=usb:258a:0029
Driver=sinowealth
Name=SinoWealth Generic Mouse (0029)
# Configuration data size is 131 bytes.
[Driver/sinowealth/devices/MachenikeM620]
ButtonCount=6
DeviceName=Machenike M620
FwVersion=V127
LedType=RGB
SensorType=PMW3389

View File

@@ -0,0 +1,20 @@
[Device]
DeviceMatch=usb:258a:1007
Driver=sinowealth
Name=SinoWealth Generic Mouse (1007)
# This does NOT work. See libratbag/libratbag#1296.
# For future: ID of A3050 sensor is 0x2, and maximum DPI is 4000.
#[Driver/sinowealth/devices/AntEsportsGM500]
#ButtonCount=7
#DeviceName=Ant Esports GM500
#FwVersion=0910
#LedType=RBG
#SensorType=A3050
[Driver/sinowealth/devices/MarvoScorpionG961]
ButtonCount=6
DeviceName=Marvo Scorpion G961
FwVersion=9677
LedType=RGB
SensorType=PMW3327

View File

@@ -0,0 +1,11 @@
[Device]
Name=SteelSeries Kinzu V2 Pro Edition
DeviceMatch=usb:1038:1366
Driver=steelseries
[Driver/steelseries]
DeviceVersion=1
Buttons=3
Leds=0
DpiList=400;800;1600;3200
MacroLength=0

View File

@@ -0,0 +1,11 @@
[Device]
Name=SteelSeries Kinzu V3
DeviceMatch=usb:1038:1388
Driver=steelseries
[Driver/steelseries]
DeviceVersion=1
Buttons=3
Leds=0
DpiList=400;800;1600;2000
MacroLength=0

View File

@@ -0,0 +1,13 @@
[Device]
# 100; 100 (Dell China); 100 Dota 2 Edition (retail); 100 Dota 2 Edition (Lenovo); 105.
DeviceMatch=usb:1038:1702;usb:1038:170a;usb:1038:170b;usb:1038:170c;usb:1038:1814
Driver=steelseries
Name=SteelSeries Rival 100/105
[Driver/steelseries]
# Actually 6.
Buttons=0
DeviceVersion=1
DpiList=250;500;1000;1250;1500;1750;2000;4000
Leds=1
Quirk=Rival100

View File

@@ -1,6 +1,6 @@
[Device]
Name=SteelSeries Rival
DeviceMatch=usb:1038:1384
DeviceMatch=usb:1038:1384;usb:1038:1392;usb:1038:1710;usb:1038:1712;usb:1038:171c;usb:1038:1394;usb:1038:171a;usb:1038:1716;usb:1038:1714;usb:1038:1718
Driver=steelseries
[Driver/steelseries]

View File

@@ -10,5 +10,4 @@ Buttons=8
Leds=1
DpiRange=90:5670@90
MacroLength=1
MonoLed=1
ShortButton=1
Quirk=SenseiRAW

View File

@@ -1,182 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg class="ratbag-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<path class="ratbag-bag" d="M38.8 22.1a48.4 48.4 0 0 1 22.7 0s9-8.9 5-11.2c-6-3.2-3.9.8-16.3 3.5 15.5-7.5 5.4-5.7-16.3-3.5-5.3.5 5 11.2 5 11.2zm20.7 2.8c5.7 17.1-.8 4.7-2-.1-4 22.1-3.7 7.7-3-.6-5-.5-10.7-.4-15.7 1.3a47 47 0 0 0-17 32.7c0 13.3 5 7.9 28.4 7.9 28.8 0 28.4 5.4 28.4-7.9 0-9.8-9-25.9-19-33.3z" />
<path class="ratbag-rats" fill="#fff" d="M35.8 62.3c3.3 3.4-1 2.4-1.9.1-5.6 1.9-16.9.7-3.8-16.3.5-.4.6.5.4 1-4 6.8-7.5 15.5.3 13.2-1-8.2 3.2-14.1 6.8-19.7 1.1-1.4 2.3-4.3 2.8-5.5-3-2.1-.8-2 1.2-1.5 1.7-1.6 3.5-2.5 6.6-3 1.7 2.5-2.7 8.2-2.7 8.2 0 2.3.1 3.7.4 4.9 3 6.5 1.2 7.3-1.4 2.9-.3.1.3 2.6-1.4 7.9.5 5.9-2.5 7-2.5 7 7.3 2.2 1 3-1 .5-.8-.5-2.9-.1-3.8.3zm15-9c.1-1.7 1.4-4 1.8-.4 2 2.1 7.5-3.4 13.3-2.2 3.7.8 5 3.3 4.5 7.4 11.7 3.8 4.3 7.9-4.6 6.9 11.8-2.5 9.3-4.1 3.5-5-.4.8-4.6 1.6-5.5 1.5-3.9 1.5-6.7 2.2-3.2-.2l-4.5-.4c-3.9 2.8-2.9 2.4-1.7-.3-2-1.4-6 1.9-6.3-.1 0-.6 1.6-5.9 2.6-7.2z"/>
<path class="ratbag-eyes" d="M51 56.9c.6.4-1 1.2-1 1.2s.1-1.6 1-1.2zm-7-22.6c-.8-.4 1-1.2 1-1.2s-.3 1.7-1 1.2z"/>
<path class="ratbag-logotype" d="M81.3 89.3c-.6.9-2.3 1.1-2.7 0 0-1.3.6-2.5.5-3.8-.5.5-1 1.6-1.6 2.3-1 1-1.8 2.4-3.4 2.3-1.3-.2-2.8-.7-3.3-2-1.3-1.8-.8-4-.5-6 .7-2.8 2.6-5.3 5.2-6.7 1.3-.4 3.2-.2 4 1.2 0 2.3-1.5 4.9-3.8 4.9-2.6-.7 1.4-3 .7-4.2-1.4-.3-1.8 1.8-2.4 2.8-.8 2-1.5 4.3-1 6.4 1.6 3.5 5-2.8 2.5-1.4-1 .7-2.9 0-1.5-1.2 1-1 2.4-1.3 3.6-2.1 5.6-2.2 3.5.3 3.7 7.5zm-18.3-6c-.1.6 2-.1 2.3.3.4.4-.4-2.2-.6-2.6zm3.6-8c1.2 4.7 2 9 3.4 13.2-.2 1-1.6 1.7-2.6 1.5-1.4-1.2-.2-2.8-1.6-4-.3-.4-3.7-.5-3.8.5l-1.4 3.2c-.6.6-2.9.9-2.5-.4.5-1.4 1-2.8 1.8-4l3.4-9.6c.5-1.3 2.3-1.2 3.3-.4zm-10.5 9.5c-.4-.8-1.3-1.5-2.3-1.4-.8-.3-.6.5-.7 1 0 1.1-.2 2.2-.4 3.3 1-.3 1.9-1 2.7-1.7.4-.2.7-.7.7-1.2zm-6.3 5.8c-1.3 0-1.2-2 0-2 0-3.5.3-7 1-10.3.6-.7 1.6-1 2.4-1.2 1 .4 1 1.4.6 2.2-.4.9 0 1.4.8.7.8-.6 1-1.6 1-2.5-.8-1.9-4.3-.3-4.8-.4-1.2-.6.3-1.5 1-1.7.8-.4 1.7-.9 2.7-.7 1.2 0 2.7-.1 3.6 1 .8 1.2.1 2.8-.6 4-.3.7-1.6 1.3-1.7 1.8 6.4 1.1.8 9.4-6 9zm-1.6-13.4c-2.1.6-.9 3.4-1.4 5-.4 2.7-.9 5.5-.8 8.3-1.3 1.3-3.5-.3-2.9-2 0-2.8.1-5.7.6-8.5.4-1.2.6-2.9-1.1-2-2 .3-2.2-2.5 0-2.2 3 .2.7-3.6 2.5-4.8 1.8-1 3.6 1 2.5 2.7.1.5-.6 1.7.4 1.5 2-.8 2.4 3 .2 2zm-12.3 5.2c-1 .6.6 1.1 1 1.5 1 1 .2-.8 0-1.2-.9-1.7-.4-2-1-.3zm3-7.2l2 9.9c.3 1.5 1.6 3.7 0 4.7-1.4.8-2.4-.5-3.3-1.4-.9-.7-1.9-1.2-2.6-2.1-1-.3-1.9 2.8-2.9 3.8-.8 0-3 .2-1.8-1 .5-1.8 1.2-3.5 1.8-5.3-1.3-1 .3-2 1-2.6a52 52 0 0 0 2.4-5.6c.7-1 2.6-1.3 3.3-.4zm-16.4 2.9v2.4c1.6-.4 4-2.4 2.2-4-1.5-1.4-2.5 0-2.2 1.6zm6.7 3.3c2 1.2.6 3.8.5 5.6-.2 2-2.5 4.1-4.3 2.3-1.2-1.1-3.7-4.3-4.1-1-.5 2.5-3.3 1.7-2.8-.6.3-2.3 1-4.6 1.2-7-.3-2.4-1-4.8-.3-7.2 1-2.7 4.4-2.5 6.4-1.3 2.3.9 3.8 3.7 2.3 6-.5 2-3.1 3.1-3.7 4.6 1.2 2 3.6 2.9 3.4-.3.3-.5.8-1 1.4-1z" />
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="180.65305mm"
height="180.65305mm"
viewBox="0 0 180.65305 180.65305"
version="1.1"
id="svg8"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
sodipodi:docname="logo.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="-156.7648"
inkscape:cy="473.25323"
inkscape:document-units="mm"
inkscape:current-layer="layer2"
showgrid="false"
inkscape:measure-start="0,0"
inkscape:measure-end="0,0"
inkscape:window-width="2560"
inkscape:window-height="1376"
inkscape:window-x="2560"
inkscape:window-y="27"
inkscape:window-maximized="1"
showguides="true"
inkscape:guide-bbox="true"
inkscape:snap-to-guides="true">
<inkscape:grid
type="xygrid"
id="grid1058"
originx="-15.590431"
originy="-49.255695" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer4"
inkscape:label="rat right"
style="display:inline;opacity:1"
transform="translate(-15.59043,-80.129979)">
<path
sodipodi:nodetypes="sssssssssssssssccssscss"
inkscape:connector-curvature="0"
id="path1039"
d="m 181.70318,102.59719 c -3.2499,1.24415 -5.70487,5.21773 -6.1731,8.64054 -0.46127,3.37194 1.06674,8.17528 5.17162,8.92716 1.88245,0.3448 5.75552,3.71382 1.56778,2.91866 -4.41092,-0.83753 -9.60561,-1.81767 -12.03434,-5.88833 -2.51189,-4.21004 -6.0824,-2.70094 -9.60946,-1.97697 -3.61649,0.74233 -3.34262,3.70961 -0.59483,4.79149 1.76651,0.69552 -4.7698,1.02182 -6.46586,-0.31589 -0.99074,-0.7814 -4.3093,0.86964 -6.03067,0.70651 -4.14705,-0.39301 -8.0988,0.0723 -12.42874,-0.59505 -2.75134,-0.42408 -6.23873,1.52773 -5.40472,-2.94355 0.41316,-2.21506 -1.53788,-7.95327 -0.25583,-12.08908 1.43935,-4.64326 2.78762,-6.554728 6.29989,-9.291599 2.96282,-2.308725 9.62529,-5.456849 13.27656,-6.171955 5.94327,-1.163997 13.69394,2.401773 15.47361,3.054918 2.51726,0.923848 7.67473,-3.278929 11.1961,-3.200515 2.07518,-1.437388 4.50939,-5.479552 6.03783,0.452639 3.26133,0.136438 5.00967,-0.06864 9.09359,2.312711 2.76398,1.611684 4.87236,1.538272 5.34391,2.873448 0.62005,1.755647 -2.69292,5.296383 -3.28547,5.288623 -0.8492,-0.0111 -0.81394,0.0819 -2.0197,0.17649 -0.32445,1.41613 -2.05245,1.97075 -5.1013,1.61048 -1.43172,-0.16918 -2.7495,0.21878 -4.05687,0.71927 z"
style="display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path1045"
d="m 119.43296,119.1374 c -3.19754,-3.4816 -3.91548,-3.31073 -5.87228,-7.17694 -1.51881,-4.76902 -1.2579,-3.59102 -4.44899,-11.00554 2.31432,2.99141 3.84563,6.48437 5.56001,9.87162 2.19923,4.34517 4.03074,4.88595 7.22829,8.36756"
style="display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
sodipodi:nodetypes="cccsc" />
<path
transform="translate(-4.1666665e-8,1.0416667e-6)"
style="display:inline;fill:#ffffff;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
d="m 183.59605,92.870943 c 0.70159,-0.65481 2.47893,-0.65481 2.89988,-0.187088 0.42095,0.467721 -1.82412,1.028987 -2.89988,0.187088 z"
id="path833"
inkscape:connector-curvature="0">
<animate
values="orange;red;orange"
dur="7s"
repeatCount="indefinite"
attributeName="fill" />
</path>
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="rat left"
style="display:inline;opacity:1"
transform="translate(-15.59043,-80.129979)">
<path
sodipodi:nodetypes="ccsccccccc"
inkscape:connector-curvature="0"
id="path1298"
d="m 86.198873,115.45536 c -0.640498,-1.90396 -0.324058,-5.87792 -2.548937,-9.26118 1.761266,-3.58236 5.461967,-1.0306 3.345989,-4.71668 -1.27974,-2.229332 -5.394303,-0.5453 -6.437336,0.67341 -2.968786,0.40847 -6.280299,-3.592034 -8.586349,-4.613758 -3.902419,-1.141693 -9.722226,-2.223874 -12.939723,-3.303186 -2.646277,1.694635 -1.446947,6.207524 -1.598912,7.088294 1.30852,3.28167 1.243822,1.80143 2.493275,5.51481 2.008262,2.23089 4.855928,4.59155 5.686271,9.4289 7.349678,-0.38854 9.558907,-0.59389 20.585722,-0.81061 z"
style="display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccsc"
style="display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 108.49567,117.83325 c -0.24901,-4.72058 -0.43574,-9.98729 -1.82782,-14.09082 -4.0267,-10.295998 -4.72401,-12.496029 -0.0129,-13.556767 -2.07044,-0.256651 -5.41881,-0.421857 -5.48281,2.489527 0.517,3.746632 1.94024,7.284981 3.15986,10.88015 1.56453,4.61189 1.00424,9.35889 1.25325,14.07947"
id="path955"
inkscape:connector-curvature="0" />
<path
transform="translate(-4.1666665e-8,1.0416667e-6)"
style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 71.938542,102.84868 c -0.902446,-0.17526 -1.969377,-1.68007 -1.548427,-2.12186 0.867434,-0.27642 1.714682,0.92977 1.548427,2.12186 z"
id="path833-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc">
<animate
values="green;yellow;green"
dur="3s"
repeatCount="indefinite"
attributeName="fill" />
</path>
</g>
<g
inkscape:label="sack"
inkscape:groupmode="layer"
id="layer1"
style="display:inline"
transform="translate(-15.59043,-80.129979)">
<rect
ry="0.44884709"
y="172.18915"
x="1150"
height="4.8108511"
width="6.0803819"
id="rect1075"
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.16499996;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<g
style="display:inline;opacity:1"
id="g1316"
transform="translate(-11.599497,6.3500003)">
<path
sodipodi:nodetypes="cccccczzcczc"
inkscape:connector-curvature="0"
id="path815"
d="m 71.911001,151.04073 c -13.545552,17.75365 -48.518606,24.46129 -42.445015,52.8882 4.987974,25.22201 13.988429,29.44417 56.008367,27.90906 47.288497,0.24745 47.307997,0.7217 90.436597,0.28592 14.07598,2.60143 28.63685,-20.8018 23.94043,-35.61574 -4.77259,-20.1552 -28.81931,-24.18426 -36.25354,-41.43822 -7.52218,-23.58108 1.99039,-35.03297 22.19568,-25.38895 20.20529,9.64403 26.03755,-15.82001 -11.10418,-15.33498 -37.14173,0.48503 -66.18409,-5.57956 -84.958574,-4.07459 -15.461428,0.81842 -41.712504,-2.86861 -44.765236,21.70932 2.422297,6.71408 19.985082,-12.15526 27.605897,-5.44801 7.620815,6.70724 20.413185,4.32379 -0.660426,24.50799 z"
style="display:inline;fill:none;fill-opacity:1;stroke:#000000;stroke-width:3.16499996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccc"
style="display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.16499996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 79.716618,142.54753 c 0,0 63.912362,8.07113 81.488252,0.7006 0,0 -0.56974,-7.74657 1.60362,-10.91212 -17.57589,7.37053 -79.821755,-0.0115 -79.821755,-0.0115 3.474504,7.01583 -3.270117,10.22298 -3.270117,10.22298 z"
id="path842"
inkscape:connector-curvature="0" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer6"
inkscape:label="rat bottom"
style="display:inline;opacity:1"
transform="translate(-15.59043,-80.129979)">
<path
sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccsccccccccccccccc"
inkscape:connector-curvature="0"
id="path1212"
d="m 122.70428,243.35492 c 6.05524,1.14081 7.22067,1.31431 10.02264,2.72758 0,0.38071 -0.19945,0.89381 -1.01365,1.66697 -0.8142,0.77314 -2.6542,0.92241 -3.94953,1.25266 -0.67325,0.3643 -1.36184,1.00187 -1.50199,1.72727 3.97782,-1.45575 2.82486,-1.28103 2.75389,0.45072 0.20024,0.42037 1.54248,-1.05607 1.70256,-1.07661 1.00124,-0.41482 0.93822,0.001 1.55056,0.0319 0.20389,0.64546 -0.30382,1.34832 -0.26341,1.72391 0.84425,0.0769 1.57036,-1.33585 1.5884,-2.00591 0.34832,-0.5087 0.57096,-0.30966 1.0296,0 0.83149,0.862 0.93498,0.50569 1.95428,1.01599 2.24374,0.45044 -0.93235,-2.10713 -1.49797,-2.41992 -0.0737,-0.0369 1.39328,-2.39745 1.58909,-2.64425 2.32503,-0.403 4.75988,-1.00269 6.10414,-1.57594 v -1.2e-4 c 5.97825,1.84348 14.60207,1.47181 21.66926,1.7325 8.87347,0.60502 6.80866,4.81981 -11.94665,7.57383 29.43774,3.60709 24.29174,-11.42807 13.49975,-11.41332 -4.45874,0.0577 -12.7835,-0.12064 -21.26078,-1.9791 -1.35135,-2.33359 -1.8837,-5.9598 -1.12611,-9.63435 -2.49031,-11.667 -8.91489,-30.75707 -16.82134,-42.62455 -2.9074,-3.93147 -6.12061,-11.52979 -7.33913,-14.68828 7.81948,-5.62697 0.38705,-8.64346 -3.43515,-4.04735 -4.2835,-4.24158 -9.25924,-6.58986 -17.436457,-7.91069 -4.46939,6.75139 7.201157,21.8355 7.201157,21.8355 0.27261,11.69368 -1.47411,14.8979 -4.3435,23.39568 0.0471,0.3928 -0.49786,0.52092 -0.68357,0.83384 -0.19254,0.21312 -0.924097,1.82103 -1.179137,2.01487 -0.12771,0.23832 -0.38006,0.38366 -0.60384,0.59827 -0.23775,0.19619 -0.40433,0.49501 -0.42142,0.8292 -0.13385,0.31584 -0.17018,0.488 -0.19925,0.87639 -0.15645,0.29381 0.11002,0.40231 0.35386,0.34986 0.27783,-0.0135 0.56968,0.0505 0.82065,-0.10012 0.38688,-0.0135 0.824117,-0.32301 0.901337,-0.70099 0.0571,-0.34113 0.16568,-0.80155 0.62396,-0.6509 0.27636,0.006 0.58137,-0.16307 0.77806,0.15023 0.27193,0.12771 0.77421,0.23993 0.87876,-0.14883 0.16039,-0.42589 0.57357,-0.67322 0.67434,-1.12667 0.14254,-0.12321 0.37352,-0.19611 0.30974,-0.28545 0.26187,-0.26516 0.52474,-0.58479 0.89076,-0.74525 3.05534,-1.07719 3.51973,-4.67744 3.86462,-4.59812 0.67734,0.15577 -0.84342,6.82001 3.73079,20.85428 -1.4046,15.75023 6.7093,18.67126 6.7093,18.67126 0.17258,1.22487 -3.10226,1.32242 -3.80222,1.80721 -0.96512,0.31347 -2.42142,0.5571 -3.36241,0.16943 -0.41052,-0.20344 -1.14128,-0.10911 -0.6235,0.34889 -0.6851,0.62634 -1.75451,0.42589 -2.61368,0.63307 -0.84134,0.12395 -1.06409,1.07707 -0.0627,0.80147 -0.42125,1.18238 1.04775,0.72998 1.68923,0.70002 0.53648,-0.0399 0.30954,0.7577 0.96774,0.39958 0.92805,-0.19058 1.83353,-0.32154 2.75115,-0.51031 0.98245,-0.0454 1.60905,0.10657 2.586,0.18597 0.728,0.16342 2.43322,-0.53193 2.89833,-1.06277 0.62324,-0.55427 1.57699,-1.41676 2.07353,-2.11063 0.49656,-0.69386 0.66544,-0.53528 1.31986,-1.29795 z"
style="display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.39657527px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccc"
inkscape:connector-curvature="0"
id="path850"
d="m 109.46587,169.42014 c -0.90244,-0.17526 -1.96937,-1.68007 -1.54842,-2.12186 0.86743,-0.27642 1.71468,0.92977 1.54842,2.12186 z"
style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1">
<animate
values="red;blue;red"
dur="5s"
repeatCount="indefinite"
attributeName="fill" />
</path>
</g>
<!-- comment out style section to remove animated eyes-->
<style>
.ratbag-eyes{animation: color-cycle 5s linear infinite}
@keyframes color-cycle{
20%{fill: #27A269}
40%{fill: #E5A50B}
60%{fill: #EE323A}
80%{fill: #C061CA}}
</style>
</svg>

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -12,15 +12,15 @@
<busconfig>
<policy user="root">
<allow own="org.freedesktop.ratbag_devel1_@ratbagd_sha@"/>
<allow send_destination="org.freedesktop.ratbag_devel1_@ratbagd_sha@"/>
<allow receive_sender="org.freedesktop.ratbag_devel1_@ratbagd_sha@"/>
<allow own="org.freedesktop.ratbag_devel1"/>
<allow send_destination="org.freedesktop.ratbag_devel1"/>
<allow receive_sender="org.freedesktop.ratbag_devel1"/>
</policy>
<!-- allow everyone to talk to the daemon -->
<policy context="default">
<allow send_destination="org.freedesktop.ratbag_devel1_@ratbagd_sha@"/>
<allow receive_sender="org.freedesktop.ratbag_devel1_@ratbagd_sha@"/>
<allow send_destination="org.freedesktop.ratbag_devel1"/>
<allow receive_sender="org.freedesktop.ratbag_devel1"/>
</policy>
</busconfig>

View File

@@ -152,6 +152,3 @@ texinfo_documents = [
author, '@PACKAGE_NAME@', 'One line description of project.',
'Miscellaneous'),
]

View File

@@ -80,6 +80,19 @@ org.freedesktop.ratbag1.Manager
The **org.freedesktop.ratbag1.Manager** interface is the entry point to
interact with ratbagd.
.. attribute:: APIVersion
:type: i
:flags: read-only,constant
The DBus API version. This is a stopgap feature while the DBus API
is still in flux. The version has no backwards or
forward-compatibilty guarantees - your client must understand
**exactly** the same version, it is not enough to support an older
or a newer version.
This API will be removed once the DBus API is declared stable.
.. attribute:: Devices
:type: ao

View File

@@ -1,6 +1,6 @@
if get_option('documentation')
cmd_sphinx = find_program('sphinx-build-3', 'sphinx-build3')
cmd_sphinx = find_program('sphinx-build-3', 'sphinx-build3', 'sphinx-build')
doc_config = configuration_data()
doc_config.set('PACKAGE_NAME', meson.project_name())

View File

@@ -1,14 +1,14 @@
project('libratbag', 'c', 'cpp',
version : '0.9.905',
project('libratbag', 'c',
version : '0.17',
license : 'MIT/Expat',
default_options : [ 'c_std=gnu99', 'warning_level=2' ],
meson_version : '>= 0.40.0')
meson_version : '>= 0.50.0')
libratbag_version = meson.project_version().split('.')
git = find_program('git')
r = run_command('tools/ratbag-git-sha.sh')
ratbagd_sha = r.stdout().strip()
# The DBus API version. Increase this every time the DBus API changes.
# No backwards/forwards guarantee, clients are expected to understand
# whatever ratbagd speaks or bail out. This should be removed if we ever
# finish the API and declare it stable.
ratbagd_api_version = 1
# We use libtool-version numbers because it's easier to understand.
# Before making a release, the libratbag_so_* and liblur_so_*
@@ -28,22 +28,24 @@ liblur_so_version = '@0@.@1@.@2@'.format((liblur_so_c-liblur_so_a),
# Compiler setup
cc = meson.get_compiler('c')
cpp = meson.get_compiler('cpp')
cppflags = ['-Wno-unused-parameter', '-fvisibility=hidden']
cflags = cppflags + ['-Wmissing-prototypes', '-Wstrict-prototypes']
cflags = ['-Wno-unused-parameter',
'-fvisibility=hidden',
'-Wmissing-prototypes',
'-Wformat', # required by format-security
'-Werror=format-security',
'-Wstrict-prototypes']
add_project_arguments(cflags, language: 'c')
add_project_arguments(cppflags, language: 'cpp')
# Initialize config.h, to be added to in the various options below, config.h
# is generated at the end of this file
config_h = configuration_data()
config_h.set('_GNU_SOURCE', '1')
config_h.set_quoted('RATBAG_VERSION', meson.project_version())
config_h.set_quoted('FALLBACK_SVG_NAME', 'fallback.svg')
config_h.set('RATBAGD_API_VERSION', ratbagd_api_version)
libratbag_data_dir = join_paths(get_option('prefix'),
get_option('datadir'),
'libratbag')
libratbag_data_dir_devel = join_paths(meson.source_root(), 'data')
libratbag_data_dir_devel = join_paths(meson.source_root(), 'data', 'devices')
config_h.set_quoted('LIBRATBAG_DATA_DIR', libratbag_data_dir)
# Coverity breaks because it doesn't define _Float128 correctly, you'll end
@@ -70,12 +72,14 @@ pkgconfig = import('pkgconfig')
dep_udev = dependency('libudev')
dep_libevdev = dependency('libevdev')
dep_glib = dependency('glib-2.0')
dep_json_glib = dependency('json-glib-1.0')
dep_lm = cc.find_library('m')
dep_unistring = cc.find_library('unistring')
if get_option('logind-provider') == 'elogind'
logind_dep = dependency('libelogind', version : '>=227')
dep_logind = dependency('libelogind', version : '>=227')
else
logind_dep = dependency('libsystemd', version : '>=227')
dep_logind = dependency('libsystemd', version : '>=227')
endif
enable_systemd = get_option('systemd')
@@ -117,7 +121,22 @@ lib_libhidpp = static_library('hidpp',
dependencies : deps_libhidpp)
dep_libhidpp = declare_dependency(link_with: lib_libhidpp)
### liblur.a ####
### libasus.a ####
src_libasus = [
'src/asus.c',
]
deps_libasus = [ ]
lib_libasus = static_library('asus',
src_libasus,
dependencies : deps_libasus)
dep_libasus = declare_dependency(link_with: lib_libasus)
### liblur ####
#
# liblur is the library to handle logitech unifying receivers.
#
install_headers('src/liblur.h')
src_liblur = [
@@ -128,6 +147,7 @@ src_liblur = [
deps_liblur = [
dep_libutil,
dep_libhidpp,
dep_libasus,
]
lur_mapfile = 'src/liblur.sym'
@@ -153,17 +173,28 @@ pkgconfig.generate (
)
#### libratbag.so ####
#
# libratbag is an internal-only library and the bit that does the actual
# work talking to the mouse. it's used by ratbagd.
src_libratbag = [
'src/libratbag-enums.h',
'src/libratbag.h',
'src/driver-asus.c',
'src/driver-etekcity.c',
'src/driver-hidpp20.c',
'src/driver-hidpp10.c',
'src/driver-logitech-g300.c',
'src/driver-logitech-g600.c',
'src/driver-roccat.c',
'src/driver-roccat-kone-emp.c',
'src/driver-roccat-kone-pure.c',
'src/driver-gskill.c',
'src/driver-openinput.c',
'src/driver-steelseries.c',
'src/driver-steelseries.h',
'src/driver-sinowealth.c',
'src/driver-sinowealth.h',
'src/driver-sinowealth-nubwo.c',
'src/driver-test.c',
'src/libratbag.c',
'src/libratbag.h',
@@ -181,8 +212,10 @@ deps_libratbag = [
dep_udev,
dep_libevdev,
dep_glib,
dep_json_glib,
dep_libutil,
dep_libhidpp,
dep_libasus,
]
lib_libratbag = static_library('ratbag',
@@ -241,6 +274,8 @@ executable('hidpp20-reset',
)
#### lur-command ####
#
# A tool to access and manipulate logitech unifying receivers.
src_lur_command = [ 'tools/lur-command.c' ]
executable('lur-command',
src_lur_command,
@@ -262,64 +297,19 @@ man_lur_command = configure_file (
)
#### data files ####
# list ordered by git ls-files data/devices/*.device
data_files = files(
'data/devices/etekcity-scroll-alpha.device',
'data/devices/gskill-MX-780.device',
'data/devices/logitech-M325.device',
'data/devices/logitech-M570.device',
'data/devices/logitech-M705.device',
'data/devices/logitech-MX-Master.device',
'data/devices/logitech-MX-Master-2S.device',
'data/devices/logitech-T650.device',
'data/devices/logitech-Wireless-Touchpad.device',
'data/devices/logitech-g-pro-wireless.device',
'data/devices/logitech-g-pro.device',
'data/devices/logitech-g102-g203.device',
'data/devices/logitech-g300.device',
'data/devices/logitech-g302.device',
'data/devices/logitech-g303.device',
'data/devices/logitech-g402.device',
'data/devices/logitech-g403.device',
'data/devices/logitech-g5-2007.device',
'data/devices/logitech-g5.device',
'data/devices/logitech-g500.device',
'data/devices/logitech-g500s.device',
'data/devices/logitech-g502-HERO-over-USB.device',
'data/devices/logitech-g502-Proteus-Core-over-USB.device',
'data/devices/logitech-g502-Proteus-Spectrum-over-USB.device',
'data/devices/logitech-g600.device',
'data/devices/logitech-g602.device',
'data/devices/logitech-g603.device',
'data/devices/logitech-g7.device',
'data/devices/logitech-g700-wireless.device',
'data/devices/logitech-g700.device',
'data/devices/logitech-g700s-wireless.device',
'data/devices/logitech-g700s.device',
'data/devices/logitech-g703.device',
'data/devices/logitech-g9.device',
'data/devices/logitech-g900-wireless.device',
'data/devices/logitech-g900.device',
'data/devices/logitech-g903.device',
'data/devices/logitech-g9x-[Call-of-Duty-MW3-Edition].device',
'data/devices/logitech-g9x-[Original].device',
'data/devices/logitech-gpowerplay-wireless.device',
'data/devices/logitech-MX-Anywhere2.device',
'data/devices/logitech-MX-Anywhere2S.device',
'data/devices/roccat-kone-xtd.device',
'data/devices/steelseries-kinzu-v2.device',
'data/devices/steelseries-rival-310.device',
'data/devices/steelseries-rival-600.device',
'data/devices/steelseries-rival.device',
'data/devices/steelseries-sensei-310.device',
'data/devices/steelseries-sensei-raw.device',
)
install_subdir('data/devices',
strip_directory : true,
exclude_files : ['device.example', 'README.md'],
install_dir : join_paths(get_option('datadir'), 'libratbag'))
install_data(data_files,
install_dir : join_paths(get_option('datadir'), 'libratbag', 'devices'))
data_parse_test = find_program(join_paths(meson.source_root(), 'test/data-parse-test.py'))
test('data-parse-test', data_parse_test, args: 'data/devices')
data_parse_test = find_program(join_paths(meson.source_root(), 'data/devices/data-parse-test.py'))
test('data-parse-test', data_parse_test, args: data_files)
duplicate_test = find_program(join_paths(meson.source_root(), 'test/duplicate-check.py'))
test('duplicate-test', duplicate_test, args : 'data/devices')
receiver_id_test = find_program(join_paths(meson.source_root(), 'test/receiver-check.py'))
test('receiver-id-test', receiver_id_test, args : 'data/devices')
#### tests ####
enable_tests = get_option('tests')
@@ -355,43 +345,25 @@ if enable_tests
test('test-util', test_util)
test('test-iconv-helper', test_iconv_helper)
valgrind = find_program('valgrind')
valgrind_suppressions_file = join_paths(meson.source_root(), 'test', 'valgrind.suppressions')
add_test_setup('valgrind',
exe_wrapper : [
valgrind,
'--leak-check=full',
'--quiet',
'--error-exitcode=3',
'--suppressions=' + valgrind_suppressions_file ],
timeout_multiplier: 5)
executable('test-build-cxx',
['test/build-cxx.cc'],
dependencies : [ dep_libratbag ],
include_directories : include_directories('src'),
cpp_args : ['-Wall', '-Wextra', '-Wno-unused-parameter'],
install : false)
executable('test-build-linker',
['test/build-pedantic.c'],
dependencies : [ dep_libratbag ],
include_directories : include_directories('src'),
install : false)
executable('test-build-gnuc90',
['test/build-pedantic.c'],
dependencies : [ dep_libratbag ],
include_directories : include_directories('src'),
c_args : ['-std=gnu90', '-Werror'],
install : false)
executable('test-build-pedantic',
['test/build-pedantic.c'],
dependencies : [ dep_libratbag ],
include_directories : include_directories('src'),
c_args : ['-std=c99', '-pedantic', '-Werror'],
install : false)
valgrind = find_program('valgrind', required : false)
if valgrind.found()
valgrind_suppressions_file = join_paths(meson.source_root(), 'test', 'valgrind.suppressions')
add_test_setup('valgrind',
exe_wrapper : [
valgrind,
'--leak-check=full',
'--quiet',
'--error-exitcode=3',
'--suppressions=' + valgrind_suppressions_file ],
timeout_multiplier: 5)
endif
endif
#### ratbagd ####
#
# The main item of this repo, a DBus server that uses libratbag to talk to
# the mice. The DBus API is the public-facing API.
#
src_ratbagd = [
'src/shared-macro.h',
'src/shared-rbtree.h',
@@ -404,14 +376,17 @@ src_ratbagd = [
'ratbagd/ratbagd-profile.c',
'ratbagd/ratbagd-resolution.c',
'ratbagd/ratbagd-test.c',
'ratbagd/ratbagd-json.c',
'ratbagd/ratbagd-json.h',
'src/libratbag-util.h',
'src/libratbag-util.c',
]
deps_ratbagd = [
dep_udev,
logind_dep,
dep_logind,
dep_libratbag,
dep_unistring,
]
executable('ratbagd',
@@ -424,21 +399,33 @@ executable('ratbagd',
install_man('ratbagd/ratbagd.8')
#### ratbagd_devel ####
#
# A development ratbagd server that owns a different name on the bus
# (org.freedesktop.ratbag_devel1). This server is used by ratbagdctl.devel.
#
dbus_devel_policy = configure_file(input : 'dbus/org.freedesktop.ratbag_devel1.conf.in',
output : 'org.freedesktop.ratbag_devel1.conf',
copy: true)
# This is a hack. We always install the devel policy file into
# /etc/dbus-1/system.d, independent of any prefixes we use otherwise.
# This should never be used outside of developer machines anyway, but
# installations on those may use different prefixes for building.
# This is not set in stone, suggest something better if you can.
dbussystemdir = join_paths('/', get_option('sysconfdir'), 'dbus-1', 'system.d')
executable('ratbagd.devel',
src_ratbagd,
dependencies : deps_ratbagd,
include_directories : include_directories('src'),
install : false,
c_args : ['-DRATBAG_DBUS_INTERFACE="ratbag_devel1_@0@"'.format(ratbagd_sha),
c_args : ['-DRATBAG_DBUS_INTERFACE="ratbag_devel1"',
'-DDBUS_POLICY_SRC="@0@/@1@"'.format(meson.build_root(), dbus_devel_policy),
'-DDBUS_POLICY_DST="@0@/@1@"'.format(dbussystemdir, dbus_devel_policy),
'-DDISABLE_COREDUMP=1'],
)
config_ratbagd_devel = configuration_data()
config_ratbagd_devel.set('ratbagd_sha', ratbagd_sha)
configure_file(input : 'dbus/org.freedesktop.ratbag_devel1.conf.in',
output : 'org.freedesktop.ratbag_devel1.conf',
configuration : config_ratbagd_devel)
#### unit file ####
if enable_systemd
@@ -477,7 +464,7 @@ endif
dbusdir = get_option('dbus-root-dir')
if dbusdir == ''
dbusdir = join_paths(get_option('datadir'), 'dbus-1')
dbusdir = join_paths(get_option('prefix'), get_option('datadir'), 'dbus-1')
endif
configure_file(input : 'dbus/org.freedesktop.ratbag1.service.in',
@@ -504,23 +491,41 @@ configure_file(input : 'dbus/org.freedesktop.ratbag1.conf.in',
#### tools ####
if meson.version().version_compare('<0.48.0')
python = import('python3')
py3 = python.find_python()
else
pymod = import('python')
py3 = pymod.find_installation()
# This is a special idiomatic construct in meson to get a fast dependency that
# doesn't exist and isn't logged as "not found".
dep_python3 = dependency('', required : false)
pymod = import('python')
py3 = pymod.find_installation()
if meson.version().version_compare('>= 0.53.0')
dep_python3 = py3.dependency(embed : true)
endif
py_version = py3.language_version()
# From python 3.8 we neeed python3-embed
embed = py_version.version_compare('>= 3.8') ? '-embed' : ''
if not dep_python3.found()
dep_python3 = dependency('python-@0@@1@'.format(py_version, embed), required : false)
if not dep_python3.found()
dep_python3 = dependency('python3@0@'.format(embed))
endif
endif
# ratbagctl calls ratbagd over DBus
config_ratbagctl = configuration_data()
config_ratbagctl.set('RATBAGD_API_VERSION', ratbagd_api_version)
config_ratbagctl.set('version', meson.project_version())
ratbagctl_in = configure_file(input : 'tools/ratbagctl.in.in',
output : 'ratbagctl.in',
configuration: config_ratbagctl)
# ratbagctl is the commandline tool to interact with ratbagd over DBus.
custom_target('ratbagctl',
output : 'ratbagctl',
input : ['tools/ratbagctl.in', 'tools/ratbagd.py'],
input : [ratbagctl_in, 'tools/ratbagd.py'],
build_by_default : true,
command : [py3, join_paths(meson.source_root(), 'tools', 'merge_ratbagd.py'),
'@INPUT@',
'--output', '@OUTPUT@',
'--version', meson.project_version()],
'--output', '@OUTPUT@'],
install: true,
install_dir: get_option('bindir'))
@@ -533,9 +538,9 @@ man_ratbagctl = configure_file (
)
config_ratbagctl_devel = configuration_data()
config_ratbagctl_devel.set('ratbagd_sha', ratbagd_sha)
config_ratbagctl_devel.set('MESON_BUILD_ROOT', meson.build_root())
config_ratbagctl_devel.set('LIBRATBAG_DATA_DIR', libratbag_data_dir_devel)
config_ratbagctl_devel.set('RATBAGD_API_VERSION', ratbagd_api_version)
configure_file(input : 'tools/toolbox.py',
output : 'toolbox.py',
@@ -567,7 +572,7 @@ swig_gen = generator(
)
wrapper_deps = [
dependency('python3'),
dep_python3,
dep_libratbag,
dep_libshared,
]
@@ -578,7 +583,25 @@ shared_library(
'libratbag',
c_source,
name_prefix: '_',
c_args : ['-Wno-missing-prototypes', '-Wno-format-nonliteral'],
c_args : ['-Wno-missing-prototypes',
'-Wno-format-nonliteral',
'-Wno-missing-field-initializers'],
extra_files: [ i_source ] + src_libratbag ,
dependencies: deps_libratbag + wrapper_deps,
include_directories : include_directories('src', 'tools'),
install: false,
)
i_source = join_paths(meson.source_root(), 'src', 'hidpp.i')
c_source = swig_gen.process(i_source)
shared_library(
'hidpp',
c_source,
name_prefix: '_',
c_args : ['-Wno-missing-prototypes',
'-Wno-format-nonliteral',
'-Wno-missing-field-initializers',
'-Wno-strict-prototypes'],
extra_files: [ i_source ] + src_libratbag ,
dependencies: deps_libratbag + wrapper_deps,
include_directories : include_directories('src', 'tools'),
@@ -591,14 +614,17 @@ ratbagc_py_conf.set('LIBRATBAG_DATA_DIR', libratbag_data_dir_devel)
ratbagc_py = configure_file(input: 'tools/ratbagc.py.in',
output: 'ratbagc.py',
configuration: ratbagc_py_conf)
# ratbag-command is a commandline tool with the UI as ratbagctl but instead
# of connecting to ratbagd over DBus, it uses libratbag directly. This is a
# development tool for protocol debugging etc.
custom_target('ratbag-command',
output : 'ratbag-command',
input : ['tools/ratbagctl.in', ratbagc_py],
input : [ratbagctl_in, ratbagc_py],
build_by_default : true,
command : [py3, join_paths(meson.source_root(), 'tools', 'merge_ratbagd.py'),
'@INPUT@',
'--output', '@OUTPUT@',
'--version', meson.project_version()],
'--output', '@OUTPUT@'],
install: false)
#### output files ####

12
ratbagd/.gitignore vendored
View File

@@ -1,12 +0,0 @@
*.a
*.log
*.o
*.stamp
*.swp
*.trs
*~
.dirstamp
.libs/
/*.tar.xz
tags
__pycache__

View File

@@ -87,17 +87,10 @@ static int ratbagd_button_set_button(sd_bus *bus,
r = ratbag_button_set_button(button->lib_button, map);
if (r == 0) {
sd_bus *bus = sd_bus_message_get_bus(m);
sd_bus_emit_properties_changed(bus,
button->path,
RATBAGD_NAME_ROOT ".Button",
"ButtonMapping",
NULL);
sd_bus_emit_properties_changed(bus,
button->path,
RATBAGD_NAME_ROOT ".Button",
"ActionType",
"Mapping",
NULL);
}
@@ -146,17 +139,10 @@ static int ratbagd_button_set_special(sd_bus *bus,
r = ratbag_button_set_special(button->lib_button, special);
if (r == 0) {
sd_bus *bus = sd_bus_message_get_bus(m);
sd_bus_emit_properties_changed(bus,
button->path,
RATBAGD_NAME_ROOT ".Button",
"SpecialMapping",
NULL);
sd_bus_emit_properties_changed(bus,
button->path,
RATBAGD_NAME_ROOT ".Button",
"ActionType",
"Mapping",
NULL);
}
@@ -261,17 +247,10 @@ static int ratbagd_button_set_macro(sd_bus *bus,
}
if (r == 0) {
sd_bus *bus = sd_bus_message_get_bus(m);
sd_bus_emit_properties_changed(bus,
button->path,
RATBAGD_NAME_ROOT ".Button",
"Macro",
NULL);
sd_bus_emit_properties_changed(bus,
button->path,
RATBAGD_NAME_ROOT ".Button",
"ActionType",
"Mapping",
NULL);
}

Some files were not shown because too many files have changed in this diff Show More