diff options
author | Robert Tari <robert@tari.in> | 2023-11-11 12:33:20 +0100 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2023-11-12 18:56:51 +0100 |
commit | 23e2fd7da079ec72f40ac53ce6141a24f8a024d5 (patch) | |
tree | 03ec3939d62af05469ea731d495881cc6a4bf386 | |
parent | 7b6fe13c018a1cb42da88c0f7ee600c7303cf760 (diff) | |
download | ayatana-settings-23e2fd7da079ec72f40ac53ce6141a24f8a024d5.tar.gz ayatana-settings-23e2fd7da079ec72f40ac53ce6141a24f8a024d5.tar.bz2 ayatana-settings-23e2fd7da079ec72f40ac53ce6141a24f8a024d5.zip |
ayatana-settings: Handle missing org.gnome.desktop.interface::color-scheme
-rwxr-xr-x | ayatana-settings | 16 |
1 files 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: |