Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kde: replace kdeglobals with Kvantum theme #142

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions modules/qt/hm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
pkgs,
config,
lib,
...
}: {
options.stylix.targets.qt = {
enable = config.lib.stylix.mkEnableTarget "QT" pkgs.stdenv.hostPlatform.isLinux;
iconThemeName = lib.mkOption {
description = "Default QT Icons";
type = lib.types.str;
default = "ePapirus-Dark";
};
};

config = lib.mkIf config.stylix.targets.qt.enable (let
cfg = config.stylix.targets.qt;
kvconfig = config.lib.stylix.colors {
template = ./kvconfig.mustache;
extension = ".kvconfig";
};
svg = config.lib.stylix.colors {
template = ./kvantum-svg.mustache;
extension = "svg";
};
kvantumPackage = pkgs.runCommandLocal "base16-kvantum" {} ''
directory="$out/share/Kvantum/Base16Kvantum"
mkdir --parents "$directory"
cat ${kvconfig} >>"$directory/Base16Kvantum.kvconfig"
cat ${svg} >>"$directory/Base16Kvantum.svg"
'';
in {
home.packages = with pkgs; [
qt5ct
bluskript marked this conversation as resolved.
Show resolved Hide resolved
libsForQt5.qtstyleplugin-kvantum
qt6Packages.qtstyleplugin-kvantum
kvantumPackage
papirus-icon-theme
];

qt = {
enable = true;
platformTheme = "qtct";
};

xdg.configFile."Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" {
General.theme = "Base16Kvantum";
};

xdg.configFile."Kvantum/Base16Kvantum".source = "${kvantumPackage}/share/Kvantum/Base16Kvantum";

xdg.configFile."qt5ct/qt5ct.conf".text = ''
[Appearance]
style=kvantum
icon_theme=${cfg.iconThemeName}
'';

xdg.configFile."qt6ct/qt6ct.conf".text = ''
[Appearance]
style=kvantum
icon_theme=${cfg.iconThemeName}
'';
});
}
Loading