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

nixos/theming: init #70276

Closed
wants to merge 1 commit into from
Closed

nixos/theming: init #70276

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 2, 2019

Motivation for this change

When I started to use NixOS at desktop I was wondered that there is no module to set Gtk and Qt widget and icon themes (in bare WM environment). Its no joy to use lxappearence, qt5ct and similar tools. This module fixes that issue by adding a way to configure themes declaratively.

For easy start I've added some predefined profiles that follow defaults of Plasma and Gnome environments.

#66392 That module only made Qt mimic default Gtk theme
#23333 That module only set qt5ct environment variable

Partly based on
https://github.com/rycee/home-manager/blob/master/modules/misc/gtk.nix

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @romildo @worldofpeace @infinisil @samueldr @ttuegel @jtojnar

};
};

qt5 = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a qt5.nix, perhaps the qt specific code should go there.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@worldofpeace I plan to add support for gtk2 and qt4 (e.g. GIMP still uses gtk2 and we still have qt4 packages), it will be probably simpler to keep it in one place then

@worldofpeace
Copy link
Contributor

I don't think it's a good idea to accept this with the dconf specific generation code in this module.

It would need to be abstracted to #54150.

@ghost
Copy link
Author

ghost commented Oct 3, 2019

@worldofpeace @jtojnar I've disabled dconf handling for now

@worldofpeace
Copy link
Contributor

@worldofpeace I plan to add support for gtk2 and qt4 (e.g. GIMP still uses gtk2 and we still have qt4 packages), it will be probably simpler to keep it in one place then

We could rename the qt5 module qt.

I think this module appears cluttered when we're handling different concepts of theming in two different toolkits.

@ghost
Copy link
Author

ghost commented Oct 3, 2019

@worldofpeace Ok, I will try to add qt4 and gtk2 support and then break this into qt5.nix and new gtk module

@ghost ghost changed the title nixos/theming: init [WIP] nixos/theming: init Oct 3, 2019
})
)

(mkIf (theme == "adwaita") {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@worldofpeace
If I split this module, where should I put these predefined theme profiles that create unified look?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if we could keep the PR smaller and not have any defaults like that yet.
Things like this aren't managed declaratively yet, so it might make the feature more difficult to land.

@ghost ghost changed the title [WIP] nixos/theming: init nixos/theming: init Oct 5, 2019
@worldofpeace
Copy link
Contributor

@jtojnar I think this module would solve the confusion about us directing people to "install an icon theme". Now there's a declarative way for this to happen. Us lacking an interface like this is why I think its been confusing. Having profiles (not sure if default ones are needed at all) would also make the base freedesktop config simple to expose.

@worldofpeace
Copy link
Contributor

@gnidorah I think it might be easier to extend the existing qt5 module to support those other settings, and then after this qt4. I'm pretty sure the gtk side of things would be completely blocked by #54150, but I think the changes for qt could be perfectly fine now.

@ghost
Copy link
Author

ghost commented Oct 6, 2019

@jtojnar @worldofpeace

install an icon theme

And widget style with color scheme what's more important.

I think it might be easier to extend the existing qt5 module to support those other settings, and then after this qt4

Why not hold both into qt.nix? There will be too few qt4 settings.

I'm pretty sure the gtk side of things would be completely blocked by #54150

No, not competely. They work fine with ini files until you use Wayland, only in that case you need dconf handling.

I'd prefer if we could keep the PR smaller and not have any defaults like that yet.
Things like this aren't managed declaratively yet, so it might make the feature more difficult to land.

I can do this through separate PR. Actually I think that what most need from this feature. Not to customize everything by own, but choose from default themes. Few people have pure Qt or pure Gtk stack, most have mixed stack of programs, in that case there is no unified look by default.
https://wiki.archlinux.org/index.php/Uniform_look_for_Qt_and_GTK_applications

@ghost
Copy link
Author

ghost commented Oct 6, 2019

BTW I will continue with in new PR

@ghost ghost closed this Oct 6, 2019
@ghost ghost deleted the theming branch October 6, 2019 06:45
@worldofpeace
Copy link
Contributor

install an icon theme

And widget style with color scheme what's more important.

That particular comment was gtk related since there's been a running discussion on how to handle this issue.

I'll try to link some of that discussion here for reference

And I guess the documentation that came out of those discussions, and any recent reports on issues with icon themes.

I think it might be easier to extend the existing qt5 module to support those other settings, and then after this qt4

Why not hold both into qt.nix? There will be too few qt4 settings.

Oops, sorry if that came off confusing.
I was thinking of it as a breakdown of changes for one PR.
So like

Extend qt5 theming support
Rename to qt
Support theming qt4

I can do this through separate PR. Actually I think that what most need from this feature. Not to customize everything by own, but choose from default themes. Few people have pure Qt or pure Gtk stack, most have mixed stack of programs, in that case there is no unified look by default.

Exactly it's preferential. Though I totally wouldn't be opposed to having nice unified defaults, it's just we really lack a way to determine if something is a "desktop" in nixos to make those kind of decisions.
Though if we provide all the "knobs" to turn to have that it shouldn't be a problem.

@ghost ghost mentioned this pull request Oct 13, 2019
10 tasks
@ghost
Copy link
Author

ghost commented Oct 13, 2019

@worldofpeace Continued in #71079

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants