From 23e2fd7da079ec72f40ac53ce6141a24f8a024d5 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Sat, 11 Nov 2023 12:33:20 +0100 Subject: ayatana-settings: Handle missing org.gnome.desktop.interface::color-scheme --- ayatana-settings | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ayatana-settings b/ayatana-settings index ded25a9..3ee11a2 100755 --- a/ayatana-settings +++ b/ayatana-settings @@ -45,14 +45,22 @@ class AyatanaSettings: sys.exit(1) buildApp(self) + pSource = Gio.SettingsSchemaSource.get_default () + pSchema = pSource.lookup ('org.gnome.desktop.interface', False); - self.pGnomeSettings = Gio.Settings.new ('org.gnome.desktop.interface') - self.pGnomeSettings.connect ('changed::color-scheme', self.onColorSchemeChanged) - self.onColorSchemeChanged (self.pGnomeSettings, 'color-scheme') + if pSchema: + + bFound = pSchema.has_key ('color-scheme') + + if bFound: + + self.pGnomeSettings = Gio.Settings.new ('org.gnome.desktop.interface') + self.pGnomeSettings.connect ('changed::color-scheme', self.onColorSchemeChanged) + self.onColorSchemeChanged (self.pGnomeSettings, 'color-scheme') self.bSystemd = isSystemd() self.bInit = False - + try: self.sDesktop = os.environ['XDG_CURRENT_DESKTOP'] except KeyError: -- cgit v1.2.3