diff --git a/homeManagerModules/desktop/gnome/default.nix b/homeManagerModules/desktop/gnome/default.nix index cd9cf8a6..6766a687 100644 --- a/homeManagerModules/desktop/gnome/default.nix +++ b/homeManagerModules/desktop/gnome/default.nix @@ -52,6 +52,23 @@ }; }; + home.packages = [ + (pkgs.writeShellScriptBin "gcs-toggle" '' + # Get current color scheme + color_scheme=$(${lib.getExe' pkgs.glib "gsettings"} get org.gnome.desktop.interface color-scheme) + + # Toggle between light and dark color schemes + if [ "$color_scheme" == "'default'" ] || [ "$color_scheme" == "'prefer-light'" ]; then + color_scheme="'prefer-dark'" + else + color_scheme="'prefer-light'" + fi + + # Apply the updated color scheme + ${lib.getExe' pkgs.glib "gsettings"} set org.gnome.desktop.interface color-scheme $color_scheme + '') + ]; + programs.gnome-shell = { enable = true; diff --git a/nixosModules/desktop/gnome/default.nix b/nixosModules/desktop/gnome/default.nix index 0eecc652..f6284646 100644 --- a/nixosModules/desktop/gnome/default.nix +++ b/nixosModules/desktop/gnome/default.nix @@ -3,25 +3,8 @@ lib, config, ... -}: let - gnomeCsAdjuster = pkgs.writeShellScriptBin "gnome-cs-adjuster" '' - # Get current color scheme - color_scheme=$(${lib.getExe' pkgs.glib "gsettings"} get org.gnome.desktop.interface color-scheme) - - # Toggle between light and dark color schemes - if [ "$color_scheme" == "'default'" ] || [ "$color_scheme" == "'prefer-light'" ]; then - color_scheme="'prefer-dark'" - else - color_scheme="'prefer-light'" - fi - - # Apply the updated color scheme - ${lib.getExe' pkgs.glib "gsettings"} set org.gnome.desktop.interface color-scheme $color_scheme - ''; -in { +}: { config = lib.mkIf config.ar.desktop.gnome.enable { - environment.systemPackages = [gnomeCsAdjuster]; - nixpkgs.overlays = [ # GNOME 46: triple-buffering-v4-46 (final: prev: {