This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Can you use custom GNOME themes for GTK aps?

Tags: None
(comma "," separated)
User avatar
everest
Registered Member
Posts
90
Karma
0
OS
I was wondering if there was a way for all the GTK apps I use to have a custom gnome theme used with them instead of the normal theme.


LinuxDNA.com Project Architect
KDE 4.4 | nVidia drivers in twinview | X-Fi sound card
Moblin Linux / FC 11 / Gentoo / Ubuntu
User avatar
JontheEchinda
KDE Developer
Posts
309
Karma
4
OS
This should be possible. After you've installed your GTK theme you can install gtk-qt-engine. It has a System Settings module that will allow you to choose your GTK theme among the ones you have installed. (System Settings -> Appearance -> GTK Styles & Fonts) You can also set it to attempt to mimic your current Qt4/KDE4 theme, but that's really buggy.

Last edited by JontheEchinda on Mon Mar 16, 2009 1:32 am, edited 1 time in total.


JontheEchinda, proud to be a member of the Kubuntu team since July 2008.
Image
Image
User avatar
everest
Registered Member
Posts
90
Karma
0
OS
JontheEchinda wrote:This should be possible. After you've installed your GTK theme you can install gtk-qt-engine. It has a System Settings module that will allow you to choose your GTK theme among the ones you have installed. (System Settings -> Appearance -> GTK Styles & Fonts) You can also set it to attempt to mimic your current Qt4/KDE4 theme, but that's really buggy.


Well i installed in and I see my default gtk themes bu8t none of the new themes I install while in Gnome.

Do I need to run kbuildsycoca4 or something?


LinuxDNA.com Project Architect
KDE 4.4 | nVidia drivers in twinview | X-Fi sound card
Moblin Linux / FC 11 / Gentoo / Ubuntu
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
This could be because GNOME is installing them to a per user location, and KDE is only searching for system wide themes.
You can try running "kbuildsycoca4" ( with --noincremental" for good measure ) however if it doesn't work, please contact the developers of the Gtk KCM.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
zakonnik
Registered Member
Posts
37
Karma
0
OS
Thaidog wrote:I was wondering if there was a way for all the GTK apps I use to have a custom gnome theme used with them instead of the normal theme.

Just download gtk theme, unpack it where you want and:
1. for gtk 1.2 create file ~/.gtkrc-1.2
Code: Select all
include "/path/to/theme/theme_name/gtkrc"

style "user-font"
{
fontsel="-microsoft-verdana-medium-r-normal-*-12-*-*-*-p-*-iso8859-2"
}
widget_class "*" style "user-font"

2. for gtk 2.0 create file ~/.gtkrc-2.0
Code: Select all
include "/path/to/theme/theme_name/gtkrc"
gtk-font-name = "verdana 10"

Change the fonts for the ones you want.


HP Pavilion dv9680
Slackware64-current | kernel 2.6.32 | kde 4.4beta2 | QT 4.6 | opera 10.10
User avatar
everest
Registered Member
Posts
90
Karma
0
OS
bcooksley wrote:This could be because GNOME is installing them to a per user location, and KDE is only searching for system wide themes.
You can try running "kbuildsycoca4" ( with --noincremental" for good measure ) however if it doesn't work, please contact the developers of the Gtk KCM.


Well it did not seem to take... I will contact Gtk KCM devel - thx!


LinuxDNA.com Project Architect
KDE 4.4 | nVidia drivers in twinview | X-Fi sound card
Moblin Linux / FC 11 / Gentoo / Ubuntu
User avatar
everest
Registered Member
Posts
90
Karma
0
OS
zakonnik wrote:
Thaidog wrote:I was wondering if there was a way for all the GTK apps I use to have a custom gnome theme used with them instead of the normal theme.

Just download gtk theme, unpack it where you want and:
1. for gtk 1.2 create file ~/.gtkrc-1.2
Code: Select all
include "/path/to/theme/theme_name/gtkrc"

style "user-font"
{
fontsel="-microsoft-verdana-medium-r-normal-*-12-*-*-*-p-*-iso8859-2"
}
widget_class "*" style "user-font"

2. for gtk 2.0 create file ~/.gtkrc-2.0
Code: Select all
include "/path/to/theme/theme_name/gtkrc"
gtk-font-name = "verdana 10"

Change the fonts for the ones you want.


I created the .gtkrc-2.0 like you said but it did not take. I looked in my home directory and there is a similar file:

.gtkrc-2.0-kde4

I edited this one to look like this:

[tylerm@iccproject ~]$ cat .gtkrc-2.0-kde4
# This file was written by KDE
# You can edit it in the KDE control center, under "GTK Styles and Fonts"

include "/home/tylerm/.themes/Vista"
# include "/etc/gtk-2.0/gtkrc"

style "user-font"
{
font_name="Sans Serif"
}
widget_class "*" style "user-font"

gtk-theme-name="Vista"
gtk-font-name="Sans Serif 10"

I logged out and logged back in but the theme did not take but the theme did change to the gnome default theme. Any ideas?

Last edited by everest on Wed Mar 18, 2009 9:59 am, edited 1 time in total.


LinuxDNA.com Project Architect
KDE 4.4 | nVidia drivers in twinview | X-Fi sound card
Moblin Linux / FC 11 / Gentoo / Ubuntu
User avatar
zakonnik
Registered Member
Posts
37
Karma
0
OS
In "include" statement you have to provide path to gtkrc file inside the theme folder.
Should work when /home/tylerm/.themes/Vista/gtk-2.0/gtkrc = true.
Code: Select all
# This file was written by KDE
# You can edit it in the KDE control center, under "GTK Styles and Fonts"

include "/home/tylerm/.themes/Vista/[u]gtk-2.0/gtkrc[/u]"
# include "/etc/gtk-2.0/gtkrc"

style "user-font"
{
font_name="Sans Serif"
}
widget_class "*" style "user-font"

gtk-theme-name="Vista"
gtk-font-name="Sans Serif 10"

All you need to do after changes in ~/.gtkrc-2.0 file is restart gtk app. That should do the trick. It works for me.

Last edited by zakonnik on Wed Mar 18, 2009 11:46 am, edited 1 time in total.


HP Pavilion dv9680
Slackware64-current | kernel 2.6.32 | kde 4.4beta2 | QT 4.6 | opera 10.10
User avatar
everest
Registered Member
Posts
90
Karma
0
OS
zakonnik wrote:All you need to do after changes in ~/.gtkrc-2.0 file is restart gtk app. That should do the trick. It works for me.


I changed it to this after I copied vista to /usr/share/themes and chown -R to root:

Code: Select all
# This file was written by KDE
# You can edit it in the KDE control center, under "GTK Styles and Fonts"

include "/usr/share/themes/Vista/gtk-2.0/gtkrc"
# include "/etc/gtk-2.0/gtkrc"

style "user-font"
{
        font_name="Sans Serif"
}
widget_class "*" style "user-font"

gtk-theme-name="Vista"
gtk-font-name="Sans Serif 10"


It still does not want to work. What do you mean by "estart gtk app"? I logged off an back in and it did not seem to work.


LinuxDNA.com Project Architect
KDE 4.4 | nVidia drivers in twinview | X-Fi sound card
Moblin Linux / FC 11 / Gentoo / Ubuntu
User avatar
zakonnik
Registered Member
Posts
37
Karma
0
OS
I've tried to set gtk theme in ~/.gtkrc-2.0-kde4 file, that gives me no result.
What works is ~/.gtkrc-2.0 file:
Code: Select all
include "/home/zakonnik/themes/BlackGarden/gtk-2.0/gtkrc"
gtk-font-name = "verdana 10"


IMHO gtkrc-2.0-kde4 is used by kcontrol.

Thaidog wrote:What do you mean by "estart gtk app"?

Close it and open again :)

http://js1008.ovh.org/screen1.png
http://js1008.ovh.org/screen2.png

Last edited by zakonnik on Wed Mar 18, 2009 2:35 pm, edited 1 time in total.


HP Pavilion dv9680
Slackware64-current | kernel 2.6.32 | kde 4.4beta2 | QT 4.6 | opera 10.10
User avatar
everest
Registered Member
Posts
90
Karma
0
OS
zakonnik wrote:I've tried to set gtk theme in ~/.gtkrc-2.0-kde4 file, that gives me no result.
What works is ~/.gtkrc-2.0 file:
Code: Select all
include "/home/zakonnik/themes/BlackGarden/gtk-2.0/gtkrc"
gtk-font-name = "verdana 10"


IMHO gtkrc-2.0-kde4 is used by kcontrol.

Thaidog wrote:What do you mean by "estart gtk app"?

Close it and open again :)

http://js1008.ovh.org/screen1.png
http://js1008.ovh.org/screen2.png


Still no go... not sure if I'm missing something. I changed the .gtkrc-2.0 file (and erased the package gtk-qt-engine):

include "/usr/share/themes/Vista/gtk-2.0/gtkrc"

gtk-font-name="Sans Serif 10"

Closed and reopened Thunderbird... the default Fedora gtk theme is there - no vista theme still.

Last edited by everest on Wed Mar 18, 2009 3:27 pm, edited 1 time in total.


LinuxDNA.com Project Architect
KDE 4.4 | nVidia drivers in twinview | X-Fi sound card
Moblin Linux / FC 11 / Gentoo / Ubuntu
User avatar
zakonnik
Registered Member
Posts
37
Karma
0
OS
Thaidog wrote:Still no go... not sure if I'm missing something. I changed the .gtkrc-2.0 file (and erased the package gtk-qt-engine):

include "/usr/share/themes/Vista/gtk-2.0/gtkrc"

gtk-font-name="Sans Serif 10"

Closed and reopened Thunderbird... the default Fedora gtk theme is there - no vista theme still.

hmmmmm, now that's weird. Supposed to work in that way...
I've downloaded this theme http://www.gnome-look.org/content/show. ... ent=101019 and it doesn't work for me as well O.o
Sorry, but I can't think of anything to fix it. As on all pages from google that should work.


HP Pavilion dv9680
Slackware64-current | kernel 2.6.32 | kde 4.4beta2 | QT 4.6 | opera 10.10
User avatar
everest
Registered Member
Posts
90
Karma
0
OS
zakonnik wrote:
Thaidog wrote:Still no go... not sure if I'm missing something. I changed the .gtkrc-2.0 file (and erased the package gtk-qt-engine):

include "/usr/share/themes/Vista/gtk-2.0/gtkrc"

gtk-font-name="Sans Serif 10"

Closed and reopened Thunderbird... the default Fedora gtk theme is there - no vista theme still.

hmmmmm, now that's weird. Supposed to work in that way...
I've downloaded this theme http://www.gnome-look.org/content/show. ... ent=101019 and it doesn't work for me as well O.o
Sorry, but I can't think of anything to fix it. As on all pages from google that should work.


e-mailed the developer at: http://gtk-qt.ecs.soton.ac.uk/

Hopefully he will get back to me. It is strange that some themes work, ie the default themes, and that you can not just add the themes and edit the text file... you can just change the text file and it changes themes that were already in there though.

Just to make sure I was not missing something I did a fresh install of Kubuntu and it will not work with that disto either. (I'm on FC10)


LinuxDNA.com Project Architect
KDE 4.4 | nVidia drivers in twinview | X-Fi sound card
Moblin Linux / FC 11 / Gentoo / Ubuntu
User avatar
JontheEchinda
KDE Developer
Posts
309
Karma
4
OS
The GTK-Qt-Engine developer has disappeared as far as we can tell, so I wouldn't get your hopes up in getting a reply.


JontheEchinda, proud to be a member of the Kubuntu team since July 2008.
Image
Image
User avatar
everest
Registered Member
Posts
90
Karma
0
OS
JontheEchinda wrote:The GTK-Qt-Engine developer has disappeared as far as we can tell, so I wouldn't get your hopes up in getting a reply.


Disappeared???


LinuxDNA.com Project Architect
KDE 4.4 | nVidia drivers in twinview | X-Fi sound card
Moblin Linux / FC 11 / Gentoo / Ubuntu


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]