From 7078443eff782e7c8d49bb07dac0af19d745b931 Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Thu, 19 Jan 2023 18:17:15 +0000 Subject: [PATCH] Hide quick settings tile for dark mode :children_crossing: --- modules/gnome/default.nix | 8 +++++- .../gnome/{shell.patch => shell_colors.patch} | 0 modules/gnome/shell_remove_dark_mode.patch | 28 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) rename modules/gnome/{shell.patch => shell_colors.patch} (100%) create mode 100644 modules/gnome/shell_remove_dark_mode.patch diff --git a/modules/gnome/default.nix b/modules/gnome/default.nix index 2ab75a2b..c0db7438 100644 --- a/modules/gnome/default.nix +++ b/modules/gnome/default.nix @@ -16,6 +16,9 @@ with lib; picture-uri-dark = "file://${config.stylix.image}"; }; + # We show the same colours regardless of this setting, and the quick + # settings tile is removed. The value is still used by Epiphany to + # request dark mode for websites which support it. "org/gnome/desktop/interface".color-scheme = if config.stylix.polarity == "dark" then "prefer-dark" @@ -42,7 +45,10 @@ with lib; rm data/theme/gnome-shell-sass/{_colors.scss,_palette.scss} cp ${colors} data/theme/gnome-shell-sass/_colors.scss ''; - patches = (oldAttrs.patches or []) ++ [ ./shell.patch ]; + patches = (oldAttrs.patches or []) ++ [ + ./shell_colors.patch + ./shell_remove_dark_mode.patch + ]; }); }); })]; diff --git a/modules/gnome/shell.patch b/modules/gnome/shell_colors.patch similarity index 100% rename from modules/gnome/shell.patch rename to modules/gnome/shell_colors.patch diff --git a/modules/gnome/shell_remove_dark_mode.patch b/modules/gnome/shell_remove_dark_mode.patch new file mode 100644 index 00000000..3d491c03 --- /dev/null +++ b/modules/gnome/shell_remove_dark_mode.patch @@ -0,0 +1,28 @@ +diff --git a/js/ui/panel.js b/js/ui/panel.js +index 94dffda73..8decf5629 100644 +--- a/js/ui/panel.js ++++ b/js/ui/panel.js +@@ -361,7 +361,6 @@ class QuickSettings extends PanelMenu.Button { + this._location = new imports.ui.status.location.Indicator(); + this._thunderbolt = new imports.ui.status.thunderbolt.Indicator(); + this._nightLight = new imports.ui.status.nightLight.Indicator(); +- this._darkMode = new imports.ui.status.darkMode.Indicator(); + this._powerProfiles = new imports.ui.status.powerProfiles.Indicator(); + this._rfkill = new imports.ui.status.rfkill.Indicator(); + this._autoRotate = new imports.ui.status.autoRotate.Indicator(); +@@ -374,7 +373,6 @@ class QuickSettings extends PanelMenu.Button { + this._indicators.add_child(this._nightLight); + if (this._network) + this._indicators.add_child(this._network); +- this._indicators.add_child(this._darkMode); + this._indicators.add_child(this._powerProfiles); + if (this._bluetooth) + this._indicators.add_child(this._bluetooth); +@@ -397,7 +395,6 @@ class QuickSettings extends PanelMenu.Button { + this._addItems(this._bluetooth.quickSettingsItems); + this._addItems(this._powerProfiles.quickSettingsItems); + this._addItems(this._nightLight.quickSettingsItems); +- this._addItems(this._darkMode.quickSettingsItems); + this._addItems(this._rfkill.quickSettingsItems); + this._addItems(this._autoRotate.quickSettingsItems); + this._addItems(this._unsafeMode.quickSettingsItems);