diff --git a/meson.build b/meson.build index 7516e61f..1505aaf8 100644 --- a/meson.build +++ b/meson.build @@ -580,6 +580,7 @@ shared_library( ratbagc_py_conf = configuration_data() +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) diff --git a/tools/ratbagc.py.in b/tools/ratbagc.py.in index fb0581fb..893a45a2 100644 --- a/tools/ratbagc.py.in +++ b/tools/ratbagc.py.in @@ -27,6 +27,7 @@ import sys from evdev import ecodes +LIBRATBAG_DATA_DIR = "@LIBRATBAG_DATA_DIR@" # Deferred translations, see https://docs.python.org/3/library/gettext.html#deferred-translations def N_(x): @@ -281,7 +282,7 @@ class RatbagdDevice(metaclass=MetaRatbag): @param theme The theme from which to retrieve the SVG, as str """ - return os.path.join(theme, libratbag.ratbag_device_get_svg_name(self._device)) + return os.path.join(LIBRATBAG_DATA_DIR, theme, libratbag.ratbag_device_get_svg_name(self._device)) def commit(self, callback=None): """Commits all changes made to the device.