mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
qt: add support for platformTheme lxqt
This commit is contained in:
parent
4ba652d8a8
commit
541d32d8b8
1 changed files with 22 additions and 14 deletions
|
@ -3,6 +3,14 @@
|
||||||
let
|
let
|
||||||
cfg = config.qt;
|
cfg = config.qt;
|
||||||
|
|
||||||
|
platformPackages = with pkgs; {
|
||||||
|
gnome = [ qgnomeplatform ];
|
||||||
|
gtk = [ libsForQt5.qtstyleplugins qt6Packages.qt6gtk2 ];
|
||||||
|
kde = [ libsForQt5.plasma-integration libsForQt5.systemsettings ];
|
||||||
|
lxqt = [ lxqt.lxqt-qtplugin lxqt.lxqt-config ];
|
||||||
|
qtct = [ libsForQt5.qt5ct qt6Packages.qt6ct ];
|
||||||
|
};
|
||||||
|
|
||||||
# Maps known lowercase style names to style packages. Non-exhaustive.
|
# Maps known lowercase style names to style packages. Non-exhaustive.
|
||||||
stylePackages = with pkgs; {
|
stylePackages = with pkgs; {
|
||||||
bb10bright = libsForQt5.qtstyleplugins;
|
bb10bright = libsForQt5.qtstyleplugins;
|
||||||
|
@ -41,16 +49,20 @@ in {
|
||||||
enable = lib.mkEnableOption "Qt 5 and 6 configuration";
|
enable = lib.mkEnableOption "Qt 5 and 6 configuration";
|
||||||
|
|
||||||
platformTheme = lib.mkOption {
|
platformTheme = lib.mkOption {
|
||||||
type = with lib.types; nullOr (enum [ "gtk" "gnome" "qtct" "kde" ]);
|
type = with lib.types;
|
||||||
|
nullOr (enum [ "gtk" "gnome" "lxqt" "qtct" "kde" ]);
|
||||||
default = null;
|
default = null;
|
||||||
example = "gnome";
|
example = "gnome";
|
||||||
relatedPackages = [
|
relatedPackages = [
|
||||||
"qgnomeplatform"
|
"qgnomeplatform"
|
||||||
[ "libsForQt5" "qtstyleplugins" ]
|
|
||||||
[ "libsForQt5" "qt5ct" ]
|
|
||||||
[ "qt6Packages" "qt6ct" ]
|
|
||||||
[ "libsForQt5" "plasma-integration" ]
|
[ "libsForQt5" "plasma-integration" ]
|
||||||
|
[ "libsForQt5" "qt5ct" ]
|
||||||
|
[ "libsForQt5" "qtstyleplugins" ]
|
||||||
[ "libsForQt5" "systemsettings" ]
|
[ "libsForQt5" "systemsettings" ]
|
||||||
|
[ "lxqt" "lxqt-config" ]
|
||||||
|
[ "lxqt" "lxqt-qtplugin" ]
|
||||||
|
[ "qt6Packages" "qt6ct" ]
|
||||||
|
[ "qt6Packages" "qt6gtk2" ]
|
||||||
];
|
];
|
||||||
description = ''
|
description = ''
|
||||||
Platform theme to use for Qt applications.
|
Platform theme to use for Qt applications.
|
||||||
|
@ -65,6 +77,11 @@ in {
|
||||||
: Use GNOME theme with
|
: Use GNOME theme with
|
||||||
[`qgnomeplatform`](https://github.com/FedoraQt/QGnomePlatform)
|
[`qgnomeplatform`](https://github.com/FedoraQt/QGnomePlatform)
|
||||||
|
|
||||||
|
`lxqt`
|
||||||
|
: Use LXQt theme style set using the
|
||||||
|
[`lxqt-config-appearance`](https://github.com/lxqt/lxqt-config)
|
||||||
|
application
|
||||||
|
|
||||||
`qtct`
|
`qtct`
|
||||||
: Use Qt style set using
|
: Use Qt style set using
|
||||||
[`qt5ct`](https://github.com/desktop-app/qt5ct)
|
[`qt5ct`](https://github.com/desktop-app/qt5ct)
|
||||||
|
@ -172,16 +189,7 @@ in {
|
||||||
# Apply theming also to apps started by systemd.
|
# Apply theming also to apps started by systemd.
|
||||||
systemd.user.sessionVariables = envVars;
|
systemd.user.sessionVariables = envVars;
|
||||||
|
|
||||||
home.packages = (if cfg.platformTheme == "gnome" then
|
home.packages = (platformPackages.${cfg.platformTheme} or [ ])
|
||||||
[ pkgs.qgnomeplatform ]
|
|
||||||
else if cfg.platformTheme == "qtct" then [
|
|
||||||
pkgs.libsForQt5.qt5ct
|
|
||||||
pkgs.qt6Packages.qt6ct
|
|
||||||
] else if cfg.platformTheme == "kde" then [
|
|
||||||
pkgs.libsForQt5.plasma-integration
|
|
||||||
pkgs.libsForQt5.systemsettings
|
|
||||||
] else
|
|
||||||
[ pkgs.libsForQt5.qtstyleplugins ])
|
|
||||||
++ lib.optionals (cfg.style.package != null)
|
++ lib.optionals (cfg.style.package != null)
|
||||||
(lib.toList cfg.style.package);
|
(lib.toList cfg.style.package);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue