aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-09-10 22:45:59 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-09-10 22:45:59 +0200
commit131021a5dcba1a5cd9f5f5a6d3869facd324929c (patch)
tree610c3740e954764c9eb1a74b0ee48e72da2f2f25
parent672eadef97de7c3356f862e42fb630c5b1b6b215 (diff)
parent7e8cbeeb715a5909cd13f0ce6bf9ba2378b17dec (diff)
downloadayatana-settings-131021a5dcba1a5cd9f5f5a6d3869facd324929c.tar.gz
ayatana-settings-131021a5dcba1a5cd9f5f5a6d3869facd324929c.tar.bz2
ayatana-settings-131021a5dcba1a5cd9f5f5a6d3869facd324929c.zip
Merge branch 'tari01-pr/color-scheme'
Attributes GH PR #21: https://github.com/AyatanaIndicators/ayatana-settings/pull/21
-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()