From 42529fe2a384c6522b3d7a016b7f1dad857a1629 Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Thu, 22 Aug 2024 01:15:24 +0000 Subject: [PATCH] Get QT theme somewhat working --- home/default.nix | 2 +- home/gtk.nix | 14 ------------ home/theme.nix | 51 ++++++++++++++++++++++++++++++++++++++++++++ sets/workstation.nix | 5 ----- 4 files changed, 52 insertions(+), 20 deletions(-) delete mode 100644 home/gtk.nix create mode 100644 home/theme.nix diff --git a/home/default.nix b/home/default.nix index 9e94d15..7f9ef56 100644 --- a/home/default.nix +++ b/home/default.nix @@ -11,10 +11,10 @@ ./fish.nix ./git.nix ./gpg.nix - ./gtk.nix ./mpv.nix ./ssh ./terminals.nix + ./theme.nix ./tmux.nix ./use-xdg.nix ]; diff --git a/home/gtk.nix b/home/gtk.nix deleted file mode 100644 index 0a5a1c6..0000000 --- a/home/gtk.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ ... }: -let - common-gtk = { - gtk-application-prefer-dark-theme = true; - }; -in -{ - home.sessionVariables.GTK_THEME = "Adwaita:dark"; - gtk = { - enable = true; - gtk3.extraConfig = common-gtk; - gtk4.extraConfig = common-gtk; - }; -} diff --git a/home/theme.nix b/home/theme.nix new file mode 100644 index 0000000..71ecf10 --- /dev/null +++ b/home/theme.nix @@ -0,0 +1,51 @@ +{ pkgs, lib, ... }: +let + ini = pkgs.formats.ini { }; + common-gtk = { + gtk-application-prefer-dark-theme = true; + }; + qtct-config = + pkg: name: + ini.generate "${name}.conf" { + Appearance = { + custom_palette = true; + color_scheme_path = "${pkg}/share/${name}/colors/darker.conf"; + + style = "Breeze"; + icon_theme = "breeze-dark"; + + standard_dialogs = "default"; + }; + }; +in +{ + home.sessionVariables.GTK_THEME = "Adwaita:dark"; + gtk = { + enable = true; + gtk3.extraConfig = common-gtk; + gtk4.extraConfig = common-gtk; + }; + + dconf.settings = { + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + }; + }; + + qt = { + enable = true; + platformTheme.name = "qtct"; + }; + + home.packages = with pkgs; [ + (lib.lowPrio libsForQt5.breeze-qt5.bin) + kdePackages.breeze + kdePackages.breeze-icons + qt6.qtwayland + ]; + + xdg.configFile = { + "qt5ct/qt5ct.conf".source = qtct-config pkgs.libsForQt5.qt5ct "qt5ct"; + "qt6ct/qt6ct.conf".source = qtct-config pkgs.kdePackages.qt6ct "qt6ct"; + }; +} diff --git a/sets/workstation.nix b/sets/workstation.nix index 0cf0cdf..ea24706 100644 --- a/sets/workstation.nix +++ b/sets/workstation.nix @@ -64,10 +64,5 @@ }; }; - qt = { - enable = true; - platformTheme = "qt5ct"; - }; - users.users.artemis.extraGroups = [ "scanner" ]; }