aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xayatana-settings11
1 files changed, 11 insertions, 0 deletions
diff --git a/ayatana-settings b/ayatana-settings
index 78db62a..ded25a9 100755
--- a/ayatana-settings
+++ b/ayatana-settings
@@ -46,8 +46,13 @@ class AyatanaSettings:
buildApp(self)
+ 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:
@@ -338,6 +343,12 @@ class AyatanaSettings:
self.pSettingsNotifications.set_strv('filter-list', lItems)
+ def onColorSchemeChanged (self, pSettings, sKey):
+
+ sColorScheme = pSettings.get_string (sKey)
+ bDark = (sColorScheme == 'prefer-dark')
+ Gtk.Settings.get_default().props.gtk_application_prefer_dark_theme = bDark
+
if __name__ == "__main__":
AyatanaSettings()