1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-24 11:45:18 +03:00
aports/community/solaar/solaar-gui.patch
2023-02-06 12:42:18 +00:00

18 lines
764 B
Diff

We split GUI into a subpackage solaar-gui. /usr/bin/solaar is used both for CLI
commands and starting GUI. This patch adds a helpful error message which is
printed when the user tries to start GUI and solaar-gui is not installed.
--- a/lib/solaar/gtk.py
+++ b/lib/solaar/gtk.py
@@ -149,6 +149,11 @@
# if any argument, run comandline and exit
return _cli.run(args.action, args.hidraw_path)
+ import importlib.util
+ if not importlib.util.find_spec('solaar.ui'):
+ import sys
+ sys.exit('%s: GUI is not installed; you can install it using: apk add solaar-gui' % NAME)
+
gi = _require('gi', 'python3-gi (in Ubuntu) or python3-gobject (in Fedora)')
_require('gi.repository.Gtk', 'gir1.2-gtk-3.0', gi, 'Gtk', '3.0')