"sudo ./build/ratbagctl.devel profile 2 4" returns an exception with cmd
being unknown.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Keeps the ratbagd daemon running until a signal is received. This is helpful
for using an external client (like piper) to run against the ratbagd.devel
instance. And to make that even easier, print the RATBAGCTL_DEVEL environment
variable for use with ratbagd.py. In the future, this should probably be a
more generic name.
The integration is a bit odd because we need to add --keepalive to the actual
parser, but we recreate that on every parse() call. So we set a flag on the
parent object and check for that during parser creation.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Don't automatically handle the help output - call print_help() on the parser
manually.
It's unclear why this doesn't just get called correctly, but at least this
fixes the immediate issue. The subcommand help is still pretty terrible
though.
https://github.com/libratbag/libratbag/issues/288
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This allows clients to respond to changes in the default resolution. It's
not the cleanest approach, but it works. To clean it up, we could cache
the changed resolutions and make sure to only emit the signal on those,
just as the FIXME already notes.
References https://github.com/libratbag/piper/pull/36.
This allows clients to respond to changes in the active resolution. It's
not the cleanest approach, but it works. To clean it up, we could cache
the changed resolutions and make sure to only emit the signal on those,
just as the FIXME already notes.
References https://github.com/libratbag/piper/pull/132.
Our DBus interface is the only API now and libratbag is just the internal
library. Let's not build doxygen for it, there's no need.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We do not really care using the actual ratbagctl command, we just want
to run it. So we can simply call out the python functions directly
and live happily ever after.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
We want to share as much as possible between ratbagctl.devel and
ratbagctl.test, so better have a separate file that knows how to
properly spawn the dbus daemon and terminate it.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
On CircleCI, the builds fail one over four times because we are launching
the testsuite while ratbagd.devel is still not ready.
Do a basic polling after we launch the daemon so that we are aware when
the ratbagd daemon is ready.
A proper solution would be to use "new" for querying the proxy, not
"new_sync". However, this would require us to have a GTK mainloop
running, so it's a PITA.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Configuring with 'meson builddir' would fail with:
Program build/ratbagctl.test found: NO
Meson encountered an error in file meson.build, line 512, column 0:
Program "build/ratbagctl.test" not found or not executable
is it a hack or the correct way?
triggered by: sudo ./build/ratbagctl.devel led 0 set color ffffff
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This code isn't actually hit because we don't handle signals correctly, but
once we do, ratbagd_free() will assert because the devices never get removed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
No need to have two copies here, simply have the dict and then flip it so it
works with the strings as keys too.
The slightly odd list comprehension is because we can't add to a dictionary
while iterating through it, so we need to get everything out first.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
few minor issues which were unseen because driver-test was missing to set
the special key mappings
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Assigning an action on a button has some side effects, and this is why we
do not have writable properties on those.
Mark the _set_dbus_property() as read only so we do not get a bunch of
PropertyReadOnly exceptions.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>