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

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
7 changes: 4 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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; [
libsForQt5.qt5ct
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" {

Check warning on line 46 in modules/qt/hm.nix

View workflow job for this annotation

GitHub Actions / Lint

The key `xdg` is first assigned here ...
General.theme = "Base16Kvantum";
};

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

Check warning on line 50 in modules/qt/hm.nix

View workflow job for this annotation

GitHub Actions / Lint

... repeated here ...

xdg.configFile."qt5ct/qt5ct.conf".text = ''

Check warning on line 52 in modules/qt/hm.nix

View workflow job for this annotation

GitHub Actions / Lint

... and here (`1` occurrence omitted). Try `xdg = { configFile."Kvantum/kvantum.kvconfig".source=...; configFile."Kvantum/Base16Kvantum".source=...; configFile."qt5ct/qt5ct.conf".text=...; }` instead.
[Appearance]
style=kvantum
icon_theme=${cfg.iconThemeName}
'';

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