Plan is to remove the key mapping altogether and make it transparent from the
Macro mappings (in libratbag/the drivers). Meanwhile, remove the DBus API so
nothing can actually start using it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Now that we use the .ini style device configuration and everything has been
migrated, we don't need the hwdb/rules files anymore
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If we leave ratbagctl.devel too soon, ratbagd gets killed before it even
receives the async call for commmit(), meaning everything we do on the
device is lost.
0.5 is empirical. It seems on my system 0.2 is enough (0.1 doesn't seem
to work). Hopefully this value is not device dependent.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
not sure why, but stat.S_IEXEC only sets exec permission for the user,
meaning that the installed file can't be run by anybody else than root.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
It always bothered me that it was in the middle of the normal ratbagd, which
made fiding it more effort than neccessary. Split it out into a separate file
so it's easily identifiable.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
A quick and easy way to sync anything coming from dbus (like property updates)
without needing to be hooked into a glib mainloop directly.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Not sure why it thinks we're potentially dereferencing a NULL-pointer here but
from the trace it looks like it thinks macro and a previously nullified
profile->macros are the same. They aren't, macro was just allocated here and
shouldn't be NULL if we get here.
Anyway, add an assert and move on.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Make sure that the index we pass into long_clear_bit is never higher than the
number of bits in the single long we use as array here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Simply abort if the macro value is bad, that's a libratbag bug and should
never happen.
Found in #312
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Checks for the three layers we need and that any buttons in the files are
consecutive and have the right layers
Fixes#196
Co-authored-by: Jente Hidskes <hjdskes@gmail.com>
We keep the hardcoded fallback.svg for the test device, otherwise we get an
error every time we start ratbagd.devel
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This SVG is generic enough to cover 7-button mice with up to 3 LEDs that are
supported but don't have an SVG. The SVG style is intentionally NOT a generic
mouse to make it obvious that something isn't right here. If we use a generic
mouse, people may not put the effort into a proper SVG style because the
generic mouse is good enough.
The fallback is currently only used for test devices
Some devices can have a custom name, so let's export that capability.
In ratbagd, libratbag/ratbag_profile_set_name() returns an error, we
put it under silence, the client has to check for the capabilities
before asking ratbagd to change the profile name.
Fixes: #266
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>