From 2be4b97177004ef1c538f81b7ebdbb960472badb Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Fri, 9 Feb 2024 20:43:09 +0100 Subject: [PATCH] Fix GTK theme --- users/erwin/home.nix | 18 +++++++++++++----- users/erwin/work.nix | 39 +++++++++++++++++---------------------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/users/erwin/home.nix b/users/erwin/home.nix index b688fa2..e0d106a 100644 --- a/users/erwin/home.nix +++ b/users/erwin/home.nix @@ -11,6 +11,11 @@ let homeCfg = config.home-manager.users.erwin; bt = config.eboskma.bluetooth; + gtkTheme = { + name = "io.elementary.stylesheet.slate"; + package = pkgs.pantheon.elementary-gtk-theme; + }; + ewwDaemon = let path = lib.makeBinPath ( @@ -248,7 +253,7 @@ in pointerCursor = { name = "elementary"; - package = pkgs.pantheon.elementary-gtk-theme; + package = gtkTheme.package; gtk.enable = true; x11.enable = true; }; @@ -294,6 +299,12 @@ in enable = true; createDirectories = true; }; + + configFile."gtk-4.0/gtk.css" = lib.mkForce { + text = '' + @import url("file://${gtkTheme.package}/share/themes/${gtkTheme.name}/gtk-4.0/gtk-dark.css"); + ''; + }; }; i18n.inputMethod = { @@ -313,10 +324,7 @@ in gtk = { enable = true; - theme = { - name = "elementary"; - package = pkgs.pantheon.elementary-gtk-theme; - }; + theme = gtkTheme; iconTheme = { name = "elementary"; diff --git a/users/erwin/work.nix b/users/erwin/work.nix index 367a98e..1014458 100644 --- a/users/erwin/work.nix +++ b/users/erwin/work.nix @@ -9,20 +9,10 @@ with lib; let cfg = config.eboskma.users.erwin; - # remoteSessionScript = pkgs.writeShellScriptBin "remote-session" '' - # ${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --mode 2560x1440 - # ${pkgs.xorg.xrandr}/bin/xrandr --output DP-4 --mode 2560x1440 --right-of DP-0 - # ${pkgs.nitrogen}/bin/nitrogen --head=0 --set-auto ${toString ./wallpapers/jwst-carina-cosmic-cliffs-nircam-2560.png} - # ${pkgs.nitrogen}/bin/nitrogen --head=1 --set-auto ${toString ./wallpapers/jwst-southern-ring-nircam-miri-side-by-side-2560.png} - # systemctl --user restart polybar - # ''; - # localSessionScript = pkgs.writeShellScriptBin "local-session" '' - # ${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --mode 3840x2160 - # ${pkgs.xorg.xrandr}/bin/xrandr --output DP-4 --mode 3840x2160 --right-of DP-0 - # ${pkgs.nitrogen}/bin/nitrogen --head=0 --set-auto ${toString ./wallpapers/jwst-carina-cosmic-cliffs-nircam-3840.png} - # ${pkgs.nitrogen}/bin/nitrogen --head=1 --set-auto ${toString ./wallpapers/jwst-southern-ring-nircam-miri-side-by-side-3840.png} - # systemctl --user restart polybar - # ''; + gtkTheme = { + name = "io.elementary.stylesheet.slate"; + package = pkgs.pantheon.elementary-gtk-theme; + }; ewwDaemon = let @@ -310,7 +300,7 @@ in pointerCursor = { name = "elementary"; - package = pkgs.pantheon.elementary-gtk-theme; + package = gtkTheme.package; gtk.enable = true; x11.enable = true; }; @@ -351,6 +341,12 @@ in enable = true; createDirectories = true; }; + + configFile."gtk-4.0/gtk.css" = lib.mkForce { + text = '' + @import url("file://${gtkTheme.package}/share/themes/${gtkTheme.name}/gtk-4.0/gtk-dark.css"); + ''; + }; }; dconf.settings = { @@ -361,10 +357,7 @@ in gtk = { enable = true; - theme = { - name = "elementary"; - package = pkgs.pantheon.elementary-gtk-theme; - }; + theme = gtkTheme; iconTheme = { name = "elementary"; @@ -379,9 +372,11 @@ in }; }; - gtk4.extraConfig = { - gtk-application-prefer-dark-theme = 1; - # gtk-cursor-theme-name = "elementary"; + gtk4 = { + extraConfig = { + gtk-application-prefer-dark-theme = 1; + # gtk-cursor-theme-name = "elementary"; + }; }; };