hlissner / dotfiles

And I say hey, what's going on?
https://youtu.be/ZZ5LpwO-An4
MIT License
1.62k stars 98 forks source link

Suggestion: kvantum theme #14

Closed benneti closed 2 years ago

benneti commented 3 years ago

Hey,

I looked at your dotfiles for inspiration on how to get qt to respect the dracula theme and found this

# Try really hard to get QT to respect my GTK theme.
env.GTK_DATA_PREFIX = [ "${config.system.path}" ];
env.QT_QPA_PLATFORMTHEME = "gtk2";
qt5 = { style = "gtk2"; platformTheme = "gtk2"; };

as for me this worked not too well (i.e. some remaining white backgrounds and so on). I took a closer look at the dracula-theme package and found that it includes a kvantum theme which is supported by qtgnomeplatform. To use this I had to do the following: (I did not use the qt5 = ... as there the style gets set and for some reason overrides my personal session variables) Install qgnomeplatform, set QT_QPA_PLATFORMTHEME = "gnome" and QT_STYLE_OVERRIDE="kvantum" and configure kvantum to use dracula

  xdg.configFile = {
    "kvantum.kvconfig" = {
      text = "theme=Dracula";
      target = "Kvantum/kvantum.kvconfig";
    };
    "Dracula-kvantum" = {
      recursive = true;
      source = "${pkgs.dracula-theme}/share/themes/Dracula/kde/kvantum/Dracula";
      target = "Kvantum/Dracula";
    };
  };
totoroot commented 3 years ago

@benneti Thanks for this! This finally made theming for Qt apps work. I set up the environment variables like you suggested, but chose to create a separate module for kvantum. If someone wants to go this route, here is the configuration for all Kvantum Dracula themes in my dotfiles. I noticed that Dracula-purple-solid was actually the theme that fit the look of GTK apps best.

benneti commented 3 years ago

Ah yes, I actually use the solid variant, too.

hlissner commented 2 years ago

Sorry for the late response. I've incorporated this in d27f42b; though I'm not 100% sure it works (not using many QT apps these days). In any case, thanks for your help!