From dc5c19eb128d85657975ee866d24270b0cc5ce57 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Mon, 22 Jul 2024 23:51:50 -0400 Subject: [PATCH] home/gnome: add cs adjuster --- homeManagerModules/desktop/gnome/default.nix | 17 +++++++++++++++++ nixosModules/desktop/gnome/default.nix | 19 +------------------ 2 files changed, 18 insertions(+), 18 deletions(-) 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: {