You are not logged in.
Hi there!
Does anyone know if there is a way to make single applications (like rhythmbox) use the dark variant of adwaita?
Thank you!
Last edited by Thorsten Reinbold (2014-03-03 17:48:39)
Offline
According to this thread on superuser.com, the answer is, "Kind of no but but a little bit yes". ![]()
Last edited by drcouzelis (2014-03-03 18:07:07)
Offline
Mh, that's a bit confusing to me. There are single apps (totem, eog) that obviously are using the dark variant. Shouldn't it be possible to use the mechanisms that they use for other apps?
Offline
What? That is strange.
What is your current GTK2 theme?
What is your current GTK3 theme?
All GTK3 applications should look the same...
Last edited by drcouzelis (2014-03-03 18:42:43)
Offline
^ No, some applications by default use the dark variant if it is availble. I know you can turn this on for all applications, but I'm not sure how to (or if it is possible at all) to do this for specific applications that don't do this by default.
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
I've took a look at /usr/share/themes/Adwaita/gtk-3.0. In the good old gtk2 times, I've written some themes on my own, so I'm not a complete noob with gtk.rc or other things. I thought I could make some changes here, but I found out: gtk.css is a nearly empty file. Nothing to edit here. Instead, there is a binary (wtf?) .gresource file. I tried to unpack it with the gresource command, but I have to admit that I don't completly understand the syntax. It seems to me that it is only useful for extracting single resources from that binary, but I want to extract everything from it. What a mess. Thanks, dear gnome-devs, for making things more and more complicated without any needs.
Offline
What? That is strange.
What is your current GTK2 theme?
What is your current GTK3 theme?All GTK3 applications should look the same...
What Unia says. ![]()
I'm using the standard theme for Gnome 3.10: Adwaita.
Offline
No, some applications by default use the dark variant if it is availble.
WHAT?? Who thought that was a good idea? ![]()
Holy crap, there it is:
http://unix.stackexchange.com/questions … -gnome-3-4
https://ask.fedoraproject.org/en/questi … ark-theme/
Apparently Totem and EoG are the most notable "dark" exceptions. I wonder where the "trigger" is that tells those applications to prefer the dark theme...
Last edited by drcouzelis (2014-03-03 20:44:43)
Offline
It's in the source. The application can request a dark variant. It's "useful" for terminals and video players for example.
I think there is an easier way but the first thing I found is this:
http://stackoverflow.com/questions/1599 … dark-theme
It's quite easy to "solve" though, have a look in /usr/share/themes/Adwaita/gtk-3.0/ or wherever you installed the theme. There are two main css files in there, gtk.css and gtk-dark.css. Simply renaming the gtk-dark.css to gtk.css makes the default light theme the dark variant, if that makes any sense. So if you set the content of gtk.css and gtk-dark.css to the contents of gtk-dark.css everything should have the appearance of the dark variant.
EDIT: Forgot what the initial question was, my bad. I don't know of any way to set this on a specific app except editing the source.
Last edited by Steef435 (2014-03-03 22:32:38)
Offline
Thanks for the info. Sadly, I'm not a programmer. I've downloaded the source from the official arch repo, but I've stuck in finding out where to place the "gtk-application-prefer-dark-theme" string.
Offline
I've never done any Gtk+ in C, but I'd put it directly after gtk_init().
gtk_init (&argc, &argv); /* This'll probably be somewhere in int main() */
g_object_set(gtk_settings_get_default(), "gtk-application-prefer-dark-theme", TRUE, NULL); /* <-- This line is what you should add */Note that it's possible to add more property/value pairs, so if there already is a line like this you could add this property and value behind it.
EDIT: I tried but rhytmbox can't survive without Gnome shell it seems, so I didn't test it.
This is what I did:
edit src/rhythmbox-3.0.1/shell/rb-application.c
There's a line in there like this:
g_object_get (gtk_settings_get_default (),
"gtk-shell-shows-app-menu", &shell_shows_app_menu,
NULL);Change the line like this:
g_object_get (gtk_settings_get_default (),
"gtk-shell-shows-app-menu", &shell_shows_app_menu,
"gtk-application-prefer-dark-theme", TRUE,
NULL);Last edited by Steef435 (2014-03-06 22:26:39)
Offline
Wow, you're right! Sorry for that, and thanks for pointing it out.
That's what happens when I don't test I suppose..
Offline