Author Topic: How do I change the menu bar font in GTK apps under KDE4? [Solved]  (Read 2685 times)

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6394
  • I'm going South
It's started to annoy me that the fonts on the menu bar and toolbars in Gnome/GTK programs look very different from the fonts on the toolbars in native KDE programs. The colours used to be different too, but that turned out to be easily fixable. The fonts aren't.

What irritates me most is that I've obviously been able to change the menu bar font when I first installed PCLinuxOS 2010: at least it is certainly larger than the default could possibly be. But today I can't change it.

I've looked through every conceivable option in systemsettings.

I've booted into Gnome for the first time in five years to see if I could change the fonts from there, but one look at one program, and it was immediately clear that the Gnome settings weren't the same as those used for Gnome apps in KDE.

So where are the GTK font settings hidden? I haven't found them in either ~/.kde4/share/config/gtkrc or ~/.kde4/share/config/gtkrc-2.0 -- nor in any Gnome config file.

I tried replacing gtk-oxygen-molecule with gtk-kde4, with the result that my GTK apps immediately picked up my KDE colours. But the fonts remained unchanged.

(I had hoped that the XSettings daemon for KDE would be able to handle the problem, but obviously it isn't.)
« Last Edit: January 25, 2011, 04:16:23 PM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Dulwithe

  • Hero Member
  • *****
  • Posts: 572
Re: How do I change the menu bar font in GTK apps under KDE4?
« Reply #1 on: January 18, 2011, 07:19:05 AM »
There used to be a "plug-in" module for kde4 systemsettings that would let you adjust gtk variables.

Since you installed gtk-kde4, why don't you try the search bar in system settings and see if it has loaded the control module...?

I used to have the control module installed, but it isn't there anymore and my gtk apps are looking tolerable, so I don't fuss with it anymore.

- D.

PS - When I try to install gtk-kde4, Synaptic prompts me (ie: says I must) uninstall the following:

    gtk-oxygen-molecule
    task-kde4
    task-kde4-extra
    task-kde4-minimal

Although I don't mind uninstalling the first package, I think it is best if I don't uninstall the task-kde~ packages.  This is strange.  Although I don't mean to hijack Bald Brick's thread, any comments would be appreciated.
« Last Edit: January 18, 2011, 07:28:05 AM by Dulwithe »
Dulwithe - The Dark Shadow


Keep the rubber side down!  Drive safe!

DOTW - Respect the road, and it will respect you.

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6394
  • I'm going South
Re: How do I change the menu bar font in GTK apps under KDE4?
« Reply #2 on: January 18, 2011, 08:26:14 AM »
There used to be a "plug-in" module for kde4 systemsettings that would let you adjust gtk variables.

Since you installed gtk-kde4, why don't you try the search bar in system settings and see if it has loaded the control module...?

I used to have the control module installed, but it isn't there anymore and my gtk apps are looking tolerable, so I don't fuss with it anymore.

- D.

Thanks for the reply. I can't find the plug-in module, but so many things have been moved around in System Settings -- and sometimes disappeared from it entirely -- that I don't trust the b****y thing anymore. The plug-in has probably been removed. That could be the reason why I once could change the font and can't anymore.

Knowing where the font settings for GTK programs are stored would still help.

Quote
PS - When I try to install gtk-kde4, Synaptic prompts me (ie: says I must) uninstall the following:

    gtk-oxygen-molecule
    task-kde4
    task-kde4-extra
    task-kde4-minimal

Although I don't mind uninstalling the first package, I think it is best if I don't uninstall the task-kde~ packages.  This is strange.  Although I don't mean to hijack Bald Brick's thread, any comments would be appreciated.

gtk-oxygen-molecule is one of the packages that task-kde4 and task-kde4-minimal install, so it is marked as a dependency of both. I don't think uninstalling the three task packages will uninstall any of their other dependencies, or in other words, any of the other packages they once marked for installation, but don't blame me if it does.
 
« Last Edit: January 20, 2011, 09:56:18 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Dulwithe

  • Hero Member
  • *****
  • Posts: 572
Re: How do I change the menu bar font in GTK apps under KDE4?
« Reply #3 on: January 18, 2011, 09:11:21 AM »
Thanks for the reply. I cant find the plug-in module, but so many things have been moved around in System Settings -- and sometimes disappeared from it entirely -- that I don't trust the b****y thing anymore.

I don't think uninstalling the three task packages will uninstall any of their other dependencies, or in other words, any of the other packages they once marked for installation, but don't blame me if it does.

I think you are allowed to say "bloody" on this forum.  ;-)

I like your disclaimer (above), but I get your point.  I was thinking the same, but don't want to be the guinea pig to try it.  ;-)
Dulwithe - The Dark Shadow


Keep the rubber side down!  Drive safe!

DOTW - Respect the road, and it will respect you.

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6394
  • I'm going South
Re: How do I change the menu bar font in GTK apps under KDE4?
« Reply #4 on: January 20, 2011, 09:53:45 AM »
Thanks for the reply. I cant find the plug-in module, but so many things have been moved around in System Settings -- and sometimes disappeared from it entirely -- that I don't trust the b****y thing anymore.

I don't think uninstalling the three task packages will uninstall any of their other dependencies, or in other words, any of the other packages they once marked for installation, but don't blame me if it does.

I think you are allowed to say "bloody" on this forum.  ;-)

I certainly hope so. I just used the asterisks to make it clear that my "bloody" shouldn't have the same overtones as Shakespeare's in "What bloody man is that?"

Quote
I like your disclaimer (above), but I get your point.  I was thinking the same, but don't want to be the guinea pig to try it.  ;-)

Somebody has to be the first one.

And reinstalling a task package isn't that hard.

(Actually uninstalling it shouldn't uninstall anything but the task package itself. It shouldn't uninstall the dependencies of the task package, as other packages may have the same dependencies. If it does, you will have found a bug.)
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6394
  • I'm going South
Re: How do I change the menu bar font in GTK apps under KDE4?
« Reply #5 on: January 20, 2011, 10:10:53 AM »
There used to be a "plug-in" module for kde4 systemsettings that would let you adjust gtk variables.

Since you installed gtk-kde4, why don't you try the search bar in system settings and see if it has loaded the control module...?

Actually it has. I couldn't find it earlier, but now I've found it, ironically under the heading "Lost and Found". Unfortunately choosing "Use current KDE font" under "Select font" doesn't change anything in how the GTK apps are displayed. It does add the line gtk-font-name="Times New Roman 13" to ~/.kde4/share/config/gtkrc-2.0, though. (This obviously when I for testing purposes had set up KDE to use Times New Roman. You can't mistake a sans-serif font for that.)
« Last Edit: January 20, 2011, 10:12:24 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6394
  • I'm going South
Re: How do I change the menu bar font in GTK apps under KDE4?
« Reply #6 on: January 22, 2011, 12:40:56 AM »
It seems I'm the only one having trouble setting up fonts for GTK under KDE4. Nevertheless I'll give a report of my progress so far.

It appears that if I specify the generic "Serif" or "Sans Serif" fonts in "System Settings"-->"Common Appearance and Behavior"-->"Application Appearance"-->"Fonts", the same fonts will be used by KDE and non-KDE programs (provided that "Use current KDE font" is chosen in "System Settings"-->"Lost and Found"-->"GTK style").

If I pick a real font name instead, that font will not be used in non-KDE apps.

This means that I have a choice of different sizes of one default serif font and one default sans serif font. All other fonts are unusable. On my system "Serif" seems to mean "DejaVu Serif" and "Sans Serif" is probably "DejaVu Sans Serif". I'd like to change those defaults, but where to do so is still a mystery.

(And now the colour settings have turned out to be even more mysterious.)
« Last Edit: January 22, 2011, 07:47:24 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Roc4fun

  • Hero Member
  • *****
  • Posts: 620
  • The life so short, the craft so long to learn
I've struggled with consistancy in my apps too.  I'm probably a little OCD ;-)

gtk-chtheme will allow you to change the gtk theme as well as the font.  I'm using oxygen molecule, but I can change the font and size to any in my install.

gtk-chtheme doesn't show up in kmenu, I always call it from krunner.

HTH,

Dave

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6394
  • I'm going South
I've struggled with consistancy in my apps too.  I'm probably a little OCD ;-)

Personally, I don't think I'm particularly obsessive. (I'm not at all tidy in real life.) I like to be in control though.

Quote
gtk-chtheme will allow you to change the gtk theme as well as the font.  I'm using oxygen molecule, but I can change the font and size to any in my install.

gtk-chtheme doesn't show up in kmenu, I always call it from krunner.

HTH,

Dave

Thank you for that, Dave.

This appears to be a very useful program. It doesn't seem to work with gtk-kde4 though, so I reinstalled gtk-oxygen-molecule, which of course uninstalled gtk-kde4. After that gtk-chtheme let me choose any font I wanted, when used with some themes. So at first this program seemed to be precisely what I had been looking for.

It doesn't pick up the KDE fonts automatically, but that is no great drawback. On the other hand it doesn't allow you to use different sizes of the font you've chosen either. (I like to use a smaller font for toolbars, and a slightly larger one for the menu bar.) Nor does gtk-chtheme allow you to change the colours, except by picking another theme.

For the moment I've reverted to gtk-kde4, but I'll continue experimenting with both ways of changing the GTK fonts.
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Dulwithe

  • Hero Member
  • *****
  • Posts: 572
I've struggled with consistancy in my apps too.  I'm probably a little OCD ;-)

Personally, I don't think I'm particularly obsessive. (I'm not at all tidy in real life.) I like to be in control though.

Quote
gtk-chtheme will allow you to change the gtk theme as well as the font.  I'm using oxygen molecule, but I can change the font and size to any in my install.

gtk-chtheme doesn't show up in kmenu, I always call it from krunner.

HTH,

Dave

Thank you for that, Dave.

This appears to be a very useful program. It doesn't seem to work with gtk-kde4 though, so I reinstalled gtk-oxygen-molecule, which of course uninstalled gtk-kde4. After that gtk-chtheme let me choose any font I wanted, when used with some themes. So at first this program seemed to be precisely what I had been looking for.

It doesn't pick up the KDE fonts automatically, but that is no great drawback. On the other hand it doesn't allow you to use different sizes of the font you've chosen either. (I like to use a smaller font for toolbars, and a slightly larger one for the menu bar.) Nor does gtk-chtheme allow you to change the colours, except by picking another theme.

For the moment I've reverted to gtk-kde4, but I'll continue experimenting with both ways of changing the GTK fonts.


Great stuff.  I'll play with this at work tomorrow.
Dulwithe - The Dark Shadow


Keep the rubber side down!  Drive safe!

DOTW - Respect the road, and it will respect you.

Offline krckor

  • Jr. Member
  • **
  • Posts: 35
Re: How do I change the menu bar font in GTK apps under KDE4? [Almost Solved]
« Reply #10 on: January 23, 2011, 09:19:09 PM »
Just to add a thought. If you are interested in super-duper integration of gtk-kde (including fonts) then your best bet probably is the qtcurve engine. Use that and gtk apps will respect color, theme, icons and fonts that you set up in systemsettings. Proof (just a shot of my current dolphin + gthumb)...



Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6394
  • I'm going South
Re: How do I change the menu bar font in GTK apps under KDE4? [Almost Solved]
« Reply #11 on: January 24, 2011, 03:31:28 AM »
Just to add a thought. If you are interested in super-duper integration of gtk-kde (including fonts) then your best bet probably is the qtcurve engine. Use that and gtk apps will respect color, theme, icons and fonts that you set up in systemsettings. Proof (just a shot of my current dolphin + gthumb)...




Interesting. I've done some experimenting with the qtcurve theme and my experience of it is not quite as positive as yours.

If I choose qtcurve for both GTK and KDE, GTK will indeed use the same font sizes as KDE even if the package gtk-kde4 isn't installed, but with or without gtk-kde4 I can't choose fonts freely. The problem I mentioned in post #6 remains. GTK programs will only pick up the KDE fonts if I use the generic font names "Serif", "Sans Serif" or "Monospace" in System Settings. I can't specify a particular serif or sans-serif font (or if I try to, the GTK applications will ignore the setting). If you are able to, I'd very much like to know what you've done that I haven't.

Qtcurve seems to be the default theme for GTK if one installs gtk-kde4. (And overall the integration is probably better if gtk-kde4 is installed.)
« Last Edit: January 24, 2011, 03:37:18 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline krckor

  • Jr. Member
  • **
  • Posts: 35
Re: How do I change the menu bar font in GTK apps under KDE4? [Almost Solved]
« Reply #12 on: January 24, 2011, 06:06:28 AM »
Hm... first of if you choose qtcurve, then you don't need gtk-kde4. Choose in systemsettings qtcurve theme, hit apply. With any of the gtk frontend for choosing themes (I recommend lxappearance), also choose the QtCurve and logout/login. Now go to the systemsettings and tweak it as you like (set the color, icons, fonts and the rest) and do the logout/login again. Everything should be in place now.

I find that sometimes I need to, in lxappearance, set besides theme, same icons like in the KDE control panel, just to make sure everything is correct.

Also, if you want to really really want to nitpick, open file manager, navigate to /usr/lib/qt4/bin , start qtconfig and select gui style qtcurve. Now literally every qt, Kde, gnome and gtk app should appear the same.

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6394
  • I'm going South
Re: How do I change the menu bar font in GTK apps under KDE4? [Almost Solved]
« Reply #13 on: January 24, 2011, 08:53:23 AM »
Thanks, bigmazy,

I've followed your instructions to the letter, and the look and feel of my GTK applications has improved. My primary problem remains though.

Hm... first of if you choose qtcurve, then you don't need gtk-kde4.

So first I uninstalled gtk-kde4 for the fifth time.

Quote
Choose in systemsettings qtcurve theme, hit apply.

Done. (Not for the first time.)

Quote
With any of the gtk frontend for choosing themes (I recommend lxappearance), also choose the QtCurve and logout/login.

This too I have done several times before. But now I used lxappearance, which was new to me. I set both the theme (to QtCurve) and the font.

Quote
Now go to the systemsettings and tweak it as you like (set the color, icons, fonts and the rest) and do the logout/login again.

I did it again, as tens of times before.

Quote
Everything should be in place now.

But it wasn't. The colour settings worked better than ever before. The font settings worked precisely as before. If I picked a generic font family in systemsettings, everything worked; if I picked the fonts I really wanted, they were ignored by GTK apps.

Quote
I find that sometimes I need to, in lxappearance, set besides theme, same icons like in the KDE control panel, just to make sure everything is correct.

Also, if you want to really really want to nitpick, open file manager, navigate to /usr/lib/qt4/bin , start qtconfig and select gui style qtcurve.

I did. (Once more.) I also selected the font I wanted as default. Then I logged out and in again.

Quote
Now literally every qt, Kde, gnome and gtk app should appear the same.

But they don't.

In most respects they look the same, but to make them use the same fonts I still have to choose various sizes of the generic "Serif", "Sans Serif" and "Monospace" fonts in systemsettings. All other fonts -- i.e. all the fonts that really are installed on my system -- work perfectly in KDE apps. But they are not picked up by Gnome or GTK apps. As before.
« Last Edit: January 24, 2011, 03:12:26 PM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline krckor

  • Jr. Member
  • **
  • Posts: 35
Re: How do I change the menu bar font in GTK apps under KDE4? [Almost Solved]
« Reply #14 on: January 24, 2011, 12:41:50 PM »
Hm... a stubborn computer you got there :)

Ok... some runaway config file is obviously bugging you. I'm sorry I can't help you more, but all that "... for the fifth time" and "... as tens of times before." is probably what caused it in the first place. Not saying it's your fault or anything, just been in similar situation few times, not good :) All these different programs you used to do the settings usually write their own configs... who knows in which the problem lies. This is the other face of the "desktop and tools" diversity we get in Linux. Everybody has their own idea of the right way to do it.

Your best bet this time is probably, if you wish to go that far, is to create fresh user, and try to do the settings with systemsettings+lxappearance only. If the problem occurs again, than blaaaaaaaaa :) If. not... well switch to that user. Copy applications settings, chown them so system is usable and be done with that.