From 9d6898e0d3a2d7452e405b88166ce8dd82d7a28b Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sat, 14 May 2022 20:29:03 -0400 Subject: [PATCH] fixing gtk back to normal --- flake.nix | 5 +---- modules/applications/firefox.nix | 10 ---------- modules/desktop/default.nix | 1 + modules/desktop/xorg.nix | 32 +++++++++++++++++++++++++++----- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/flake.nix b/flake.nix index 919e8de..83605a2 100644 --- a/flake.nix +++ b/flake.nix @@ -33,10 +33,7 @@ gui = { colorscheme = (import ./modules/colorscheme/gruvbox); wallpaper = ../../../downloads/nix.jpg; - gtk.theme = { - name = "Adwaita-dark"; - package = "gnome-themes-extra"; - }; + gtk.theme = { name = "Adwaita-dark"; }; }; }; diff --git a/modules/applications/firefox.nix b/modules/applications/firefox.nix index 810a437..14d4066 100644 --- a/modules/applications/firefox.nix +++ b/modules/applications/firefox.nix @@ -111,18 +111,8 @@ }; }; - - gtk = { - enable = true; - theme = - config.services.xserver.displayManager.lightdm.greeters.gtk.theme; - }; }; - # Required for setting GTK theme (for preferred-color-scheme in browser) - services.dbus.packages = [ pkgs.dconf ]; - programs.dconf.enable = true; - }; } diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index d3ec953..483393f 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -33,6 +33,7 @@ package = mkOption { type = types.str; description = "Theme package name for GTK applications"; + default = "gnome-themes-extra"; }; }; colorscheme = mkOption { diff --git a/modules/desktop/xorg.nix b/modules/desktop/xorg.nix index 817edb5..9ad9040 100644 --- a/modules/desktop/xorg.nix +++ b/modules/desktop/xorg.nix @@ -1,4 +1,13 @@ -{ config, pkgs, lib, ... }: { +{ config, pkgs, lib, ... }: + +let + + gtkTheme = { + name = config.gui.gtk.theme.name; + package = pkgs.${config.gui.gtk.theme.package}; + }; + +in { config = lib.mkIf config.gui.enable { @@ -15,10 +24,7 @@ enable = config.services.xserver.enable; # Make the login screen dark - greeters.gtk.theme = { - name = config.gui.gtk.theme.name; - package = pkgs."${config.gui.gtk.theme.package}"; - }; + greeters.gtk.theme = gtkTheme; }; }; @@ -30,11 +36,27 @@ xclip # Clipboard ]; + # Required for setting GTK theme (for preferred-color-scheme in browser) + services.dbus.packages = [ pkgs.dconf ]; + programs.dconf.enable = true; + + environment.sessionVariables = { GTK_THEME = config.gui.gtk.theme.name; }; + home-manager.users.${config.user} = { + programs.fish.shellAliases = { pbcopy = "xclip -selection clipboard -in"; pbpaste = "xclip -selection clipboard -out"; }; + + gtk = let gtkExtraConfig = { gtk-application-prefer-dark-theme = true; }; + in { + enable = true; + theme = gtkTheme; + gtk3.extraConfig = gtkExtraConfig; + gtk4.extraConfig = gtkExtraConfig; + }; + }; };