mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 07:53:55 -05:00
home/gnome: add cs adjuster
This commit is contained in:
parent
4171be27e7
commit
dc5c19eb12
|
@ -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;
|
||||
|
||||
|
|
|
@ -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: {
|
||||
|
|
Loading…
Reference in a new issue