Skip to content

nixos.modules.config.qt5: provide the possibility of using QT_QPA_PLATFORMTHEME="kde" #180131

Description

@PedroHLC

The reason why I didn't open a PR, is described in Additional context.

Describe the bug

I'm aware of four platforms for Qt's themes right now:

  • Using GTK themes through qtstyleplugins + QT_STYLE_OVERRIDE;
  • Using GNOME themes through qgnomeplatform + QT_STYLE_OVERRIDE;
  • Using Qt themes, with the non-KDE solution qt5ct, which uses its own color schemes;
  • Using Plasma-targeted Qt themes, with kde as QT_QPA_PLATFORMTHEME, as done natively in a plasma session, using the theme's colorscheme.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Check qt5.platformTheme and it does not provide kde;
  2. No equivalent to programs.qt5ct.enable providing kde;
  3. Enable services.xserver.desktopManager.plasma5.enable = true;, then add some Pasma-target themes like [breeze-gtk breeze-icons breeze-qt5], then adjust envvars export QT_QPA_PLATFORMTHEME='kde' QT_PLATFORM_PLUGIN='kde' QT_PLATFORMTHEME='kde', set the theme in ~/.config/kdeglobals or with QT_STYLE_OVERRIDE, you'll get the right theme with the proper color scheme.

Expected behavior

qt5.platformTheme should provide kde (or plasma) as an option, it should add only the required packages to the system, and set the proper envvars. (or maybe rename it, since qt6 also uses the same variables and envvars)

Screenshots

  • qbittorrent + breeze + QT_QPA_PLATFORMTHEME=kde + dark:
    screenshot

  • qbittorrent + breeze + QT_QPA_PLATFORMTHEME=qt5ct + dark:
    screenshot

  • qbittorrent + QT_QPA_PLATFORMTHEME=gtk2 (ignored my theme):
    screenshot

  • qbittorrent + QT_QPA_PLATFORMTHEME=gnome (also ignored my theme):
    screenshot

Additional context

I tried to discover what package that is being added when evaluating services.xserver.desktopManager.plasma5 provides this platform-theme, but I failed miserably.

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

╭─pedrohlc at desktop in /home/pedrohlc
╰─λ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.51, NixOS, 22.11 (Raccoon), 22.11.20220702.660ac43`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.9.1`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken0.kind: enhancementAdd something new or improve an existing system.6.topic: qt/kdeObject-oriented framework for GUI creation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions