PDA

View Full Version : [xubuntu] [15.10] Launch firefox with specific gtk theme?



en.garbage
December 9th, 2015, 06:27 PM
I just installed xubuntu 15.10 along with the "arc dark" theme, and unfortunately firefox adopts this gtk theme and breaks a lot of controls on websites (dark backgrounds/bad text color that doesn't play nice with the website css). Setting the firefox theme does not cut it since the controls still use the gtk system styles. I need to launch firefox and specify the specific GTK theme I want it to use. The top google result, which has worked for me in the past, is the following:



GTK2_RC_FILES=/usr/share/themes/Raleigh/gtk-2.0/gtkrc firefox


Despite using this, firefox continues to ignore me and uses the system dark theme. Has something changed in a recent release that would cause this to fail? If not, could someone please advise or point me in the right direction?

Thanks.

EDIT: Solved! See page 2.

vasa1
December 10th, 2015, 05:15 AM
I just installed xubuntu 15.10 along with the "arc dark" theme, and unfortunately firefox adopts this gtk theme and breaks a lot of controls on websites (dark backgrounds/bad text color that doesn't play nice with the website css). Setting the firefox theme does not cut it since the controls still use the gtk system styles. I need to launch firefox and specify the specific GTK theme I want it to use. The top google result, which has worked for me in the past, is the following:



GTK2_RC_FILES=/usr/share/themes/Raleigh/gtk-2.0/gtkrc firefox


Despite using this, firefox continues to ignore me and uses the system dark theme. Has something changed in a recent release that would cause this to fail? If not, could someone please advise or point me in the right direction?

Thanks.

Could you please clarify what you mean by "Setting the firefox theme does not cut it since the controls still use the gtk system styles."?

Maybe a screenshot?

I don't see why your code shouldn't work! <<< Please see the edit


EDIT: on my system, the Raleigh gtkrc file has just this:

#
# This theme is the default theme if no other theme is selected.
#
So it seems to be a dummy and quite misleading? Please try some other theme which actually has a proper gtkrc. If you're using Xubuntu, you should have Greybird. Quite nice.

en.garbage
December 10th, 2015, 03:56 PM
Nice catch re: Raleigh, that's interesting. I'm able to set the system theme to Raleigh without issue, so it must reside elsewhere.

When I say controls, I'm referring to things like the address bar, its dropdown, textboxes, checkboxes, dropdowns, etc. Interface controls.

System Theme: Arc Dark
http://i.imgur.com/hTZySuu.png

System Theme: Raleigh

http://imgur.com/Zkt9fiY.png


Adwaita nor Greybird have any affect, and those look to be full themes on my system.

EDIT:

Looks like Firefox 42.0 has been released with GTK3 integration according to this post (http://fullcirclemagazine.org/2015/09/25/mozilla-firefox-42-0-to-bring-gtk3-integration-for-gnulinux-new-privacy-settings/).
That would suggest GTK_THEME should be used, as opposed to GTK2_RC_FILES.

Unfortunately, I've tried both the following to no avail:



env GTK_THEME=/usr/share/themes/Greybird/gtk-3.0/gtk.css firefox

env GTK_THEME=Greybird firefox

vasa1
December 10th, 2015, 05:35 PM
AFAIK, Firefox, as available from the standard repo, is still gtk2.

You can easily see what gtk your version uses by examining its dependencies.

Or try
ldd /usr/bin/firefox | grep gtkassuming of course that firefox is in /usr/bin.

vasa1
December 10th, 2015, 05:42 PM
I don't know what to say about the address bar. I used Greybird as a starting point and have modified it quite a bit to make it "dark". Here's my address bar dropdown:

en.garbage
December 10th, 2015, 06:06 PM
Hm, my firefox does not appear to be linked to a gtk lib directly?
/usr/bin/firefox links to a launcher script @ /usr/lib/firefox/firefox.sh. There is a binary beside it with the following ldd output:



# ldd ./firefox
linux-vdso.so.1 => (0x00007ffc9d9f8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa7b416e000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa7b3f6a000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa7b3be7000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa7b38df000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa7b36c8000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa7b32fd000)
/lib64/ld-linux-x86-64.so.2 (0x000055e472752000)


Don't see gtk here, is it possible it's statically compiled into the binary, and therefore not showing in this list?

vasa1
December 10th, 2015, 06:40 PM
Well, you can just look at its dependencies by running apt-cache show firefox and seeing what's in the "Depends" section.

en.garbage
December 10th, 2015, 06:46 PM
Thanks, I'm normally an arch user so I'm not as familiar with apt or dpkg. Looks like it's conclusively libgtk2.0, but the original problem remains...
Any ideas on additional avenues to investigate? I'm a bit at a loss. Also, thanks for your help.

vasa1
December 11th, 2015, 02:29 AM
I found this: https://github.com/horst3180/arc-firefox-theme

en.garbage
December 11th, 2015, 02:24 PM
Unfortunately firefox themes have no affect on the controls that I have a problem with (website textboxes, in particular). They are styled by the system's gtk theme.

en.garbage
December 11th, 2015, 03:53 PM
Finally solved after stumbling upon this gtk mailing list discussion (https://mail.gnome.org/archives/gtk-list/2015-September/msg00008.html).



env GTK2_RC_FILES=/usr/share/themes/Greybird/gtk-2.0/gtkrc GTK_DATA_PREFIX="" firefox


The key here was resetting GTK_DATA_PREFIX. The official documentation is quite bad regarding this variable, but I'm assuming it effectively clears any notion of the system theme so GTK2_RC_FILES is not overridden.
I'm not sure why I never had to do this with other distributions I've used, but I'm not going to worry about it! Again, thanks for your help vasa.

vasa1
December 11th, 2015, 03:57 PM
Finally solved after stumbling upon this gtk mailing list discussion (https://mail.gnome.org/archives/gtk-list/2015-September/msg00008.html).



env GTK2_RC_FILES=/usr/share/themes/Greybird/gtk-2.0/gtkrc GTK_DATA_PREFIX="" firefox


The key here was resetting GTK_DATA_PREFIX. The official documentation is quite bad regarding this variable, but I'm assuming it effectively clears any notion of the system theme so GTK2_RC_FILES is not overridden.
I'm not sure why I never had to do this with other distributions I've used, but I'm not going to worry about it! Again, thanks for your help vasa.
No thanks due to me !
I learned something new trying to help you even though you fixed the problem yourself :)