diff --git a/app/settings.py b/app/settings.py index 29e081ac..a1975e95 100644 --- a/app/settings.py +++ b/app/settings.py @@ -617,8 +617,13 @@ class Settings: self._settings["extra_color"] = value @property + @lru_cache(1) def dark_mode(self): - return self._settings.get("dark_mode", False) + import subprocess + + cmd = ["defaults", "read", "-g", "AppleInterfaceStyle"] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + return "Dark" in str(p[0]) @dark_mode.setter def dark_mode(self, value): diff --git a/app/ui/settings_dialog.glade b/app/ui/settings_dialog.glade index f7dccc4c..80dabc91 100644 --- a/app/ui/settings_dialog.glade +++ b/app/ui/settings_dialog.glade @@ -2686,7 +2686,7 @@ Author: Dmitriy Yefremov 5 - True + False False diff --git a/app/ui/settings_dialog.py b/app/ui/settings_dialog.py index 344c730c..ac50c804 100644 --- a/app/ui/settings_dialog.py +++ b/app/ui/settings_dialog.py @@ -356,7 +356,6 @@ class SettingsDialog: self._ext_settings.list_font = self._list_font_button.get_font() if self._ext_settings.is_darwin: - self._ext_settings.dark_mode = self._dark_mode_switch.get_active() self._ext_settings.alternate_layout = self._layout_switch.get_active() self._ext_settings.is_themes_support = self._themes_support_switch.get_active() self._ext_settings.theme = self._theme_combo_box.get_active_id() @@ -794,7 +793,6 @@ class SettingsDialog: @run_idle def init_themes(self): - self._dark_mode_switch.set_active(self._ext_settings.dark_mode) t_support = self._ext_settings.is_themes_support self._themes_support_switch.set_active(t_support) if t_support: