check if dasbus available

This commit is contained in:
piotr
2022-02-01 02:16:44 +01:00
parent 221342b252
commit 7e5532bdb4
2 changed files with 23 additions and 12 deletions

View File

@@ -503,7 +503,12 @@ class EditorWrapper(object):
btn.set_tooltip_text("The 'swaync' package required")
btn = builder.get_object("btn-tray")
btn.connect("clicked", self.edit_tray)
try:
import dasbus
btn.connect("clicked", self.edit_tray)
except ModuleNotFoundError:
btn.set_sensitive(False)
btn.set_tooltip_text("The 'python-dasbus' package required")
btn = builder.get_object("btn-executors")
btn.connect("clicked", self.select_executor)