home/gnome: add cs adjuster

This commit is contained in:
Aly Raffauf 2024-07-22 23:51:50 -04:00
parent 4171be27e7
commit dc5c19eb12
2 changed files with 18 additions and 18 deletions

View file

@ -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;

View file

@ -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: {