mirror of
https://github.com/nix-community/home-manager
synced 2024-12-18 15:59:48 +01:00
qt: add "kde" to qt.platformTheme (#4085)
This allow you to configure Qt integration using KDE instead of qgnomeplatform or qtstyleplugins. Useful if your theme supports both GTK and KDE, for example Nordic. To use this properly you will need to do some manual configuration for now. You can set the theme settings using `~/.config/kdeglobals`. Example: ```nix { ... }: { qt = { enable = true; platformTheme = "kde"; }; xdg = { configFile.kdeglobals.text = lib.generators.toINI { } { General = { ColorScheme = "nordicbluish"; Name = "nordic-bluish"; shadeSortColumn = true; }; Icons = { Theme = "Nordic-bluish"; }; KDE = { LookAndFeelPackage = "Nordic-bluish"; contrast = 4; }; }; dataFile = { # For General.ColorScheme color-schemes = { source = "${pkgs.nordic}/share/color-schemes"; recursive = true; }; # For KDE.LookAndFeelPackage plasma = { source = "${pkgs.nordic}/share/plasma"; recursive = true; }; }; }; } ```
This commit is contained in:
parent
75b24cc557
commit
32376992f7
1 changed files with 10 additions and 3 deletions
|
@ -38,7 +38,7 @@ in {
|
||||||
enable = mkEnableOption "Qt 4 and 5 configuration";
|
enable = mkEnableOption "Qt 4 and 5 configuration";
|
||||||
|
|
||||||
platformTheme = mkOption {
|
platformTheme = mkOption {
|
||||||
type = types.nullOr (types.enum [ "gtk" "gnome" ]);
|
type = types.nullOr (types.enum [ "gtk" "gnome" "kde" ]);
|
||||||
default = null;
|
default = null;
|
||||||
example = "gnome";
|
example = "gnome";
|
||||||
relatedPackages =
|
relatedPackages =
|
||||||
|
@ -59,6 +59,10 @@ in {
|
||||||
<link xlink:href="https://github.com/FedoraQt/QGnomePlatform">qgnomeplatform</link>
|
<link xlink:href="https://github.com/FedoraQt/QGnomePlatform">qgnomeplatform</link>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>kde</literal></term>
|
||||||
|
<listitem><para>Use Qt settings from Plasma</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
@ -134,14 +138,17 @@ in {
|
||||||
# Necessary because home.sessionVariables doesn't support mkIf
|
# Necessary because home.sessionVariables doesn't support mkIf
|
||||||
home.sessionVariables = filterAttrs (n: v: v != null) {
|
home.sessionVariables = filterAttrs (n: v: v != null) {
|
||||||
QT_QPA_PLATFORMTHEME =
|
QT_QPA_PLATFORMTHEME =
|
||||||
if cfg.platformTheme == "gnome" then "gnome" else "gtk2";
|
if cfg.platformTheme == "gtk" then "gtk2" else cfg.platformTheme;
|
||||||
QT_STYLE_OVERRIDE = cfg.style.name;
|
QT_STYLE_OVERRIDE = cfg.style.name;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = if cfg.platformTheme == "gnome" then
|
home.packages = if cfg.platformTheme == "gnome" then
|
||||||
[ pkgs.qgnomeplatform ]
|
[ pkgs.qgnomeplatform ]
|
||||||
++ lib.optionals (cfg.style.package != null) [ cfg.style.package ]
|
++ lib.optionals (cfg.style.package != null) [ cfg.style.package ]
|
||||||
else
|
else if cfg.platformTheme == "kde" then [
|
||||||
|
pkgs.libsForQt5.plasma-integration
|
||||||
|
pkgs.libsForQt5.systemsettings
|
||||||
|
] else
|
||||||
[ pkgs.libsForQt5.qtstyleplugins ];
|
[ pkgs.libsForQt5.qtstyleplugins ];
|
||||||
|
|
||||||
xsession.importedVariables = [ "QT_QPA_PLATFORMTHEME" ]
|
xsession.importedVariables = [ "QT_QPA_PLATFORMTHEME" ]
|
||||||
|
|
Loading…
Reference in a new issue