Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-01-21 15:21:33

gnanini
Member
Registered: 2017-01-19
Posts: 16

Application Finder (xfce4-appfinder) tweak on .gtkrc-2.0

Hello!

I'm tweaking the Xfce Application Finder for it to become a kind of dash, but I don't know how to change its theme under .gtkrc-2.0. I have tree questions:

1) Is there a way or app to discover gtk properties and ids of other applications?

2) Someone knows how to tweak appfinder under gtkrc-2.0, how?

3) Is there a good documentation about gtkrc tweaks?


My appfinder is now like this:

screenshot2017-01-2113-14-46.php

I would like to play with colors or even turn only appfinder's background transparent, or even given it a image as bg. I saw that someone already did'it with whisker menu!

Offline

#2 2017-01-21 16:36:35

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 3,895

Re: Application Finder (xfce4-appfinder) tweak on .gtkrc-2.0

gnanini wrote:

1) Is there a way or app to discover gtk properties and ids of other applications?

For GTK2 apps, gtkparasite is a helpful tool. For GTK3 apps, looks at the Gtk Inspector tool. The GTK3 version is much better. So basically, install gtk-parasite and first kill any instance of xfce4-appfinder that might be running ("pkill xfce4-appfinder") then:

GTK_MODULES=gtkparasite xfce4-appfinder

...and you'll get something like:
gtkparasite.png
Unfortunately, all it will tell you is that the xfce4-appfinder's widget name is "XfceAppfinderWindow", but that's enough to get us started. You can enable edit mode in that program and change some of the properties on the right side to see some immediate changes. On the left side, you can see the Gtk components that are used in this app. Once you know this list, you can fiddle with gtk tweaking.

2) Someone knows how to tweak appfinder under gtkrc-2.0, how?

Based on the above, we can create a skeleton tweak section like this:

style "appfinder-tweaks" 
{

}
widget "XfceAppfinderWindow*" style "appfinder-tweaks"

...and add in our Gtk tweaks in between the {}s.

For Gtk2, this is the definitive guide of all widgets, properties, styles, etc. So, lets walk through a few basic tweaks. You can change the application background by using the "bg[NORMAL]" style. Doing so, you'll notice that it isn't applied to the whole window, because the GtkTreeView widget overlays itself. So we need to apply the same to the GtkTreeView widget. To get the info about the GtkTreeView widget, go to its page and see that we can adjust the "even-row-color" and "odd-row-color" properties. (We also have to set "allow-rules" to 1 to allow the changes to have an effect. We can also change the foreground colour to yellow using the "fg[NORMAL]" style and "text[NORMAL]" for the GtkTreeView widget. Here is our example now:

style "appfinder-tweaks" 
{
	bg[NORMAL]="#9ab5bf"
	fg[NORMAL]="#ffff00"
	text[NORMAL]="#ffff00"
	
	GtkTreeView::odd-row-color = "#9ab5bf"
	GtkTreeView::even-row-color = "#9ab5bf"	
	GtkTreeView::allow-rules = 1

}
widget "XfceAppfinderWindow*" style "appfinder-tweaks"

appfinder.png

And on and on we can go....

3) Is there a good documentation about gtkrc tweaks?

Not really. I haven't found a good comprehensive how-to guide. In addition to the links above, here are some links for GTK2 themeing that might be helpful and get you started:
- https://wiki.gnome.org/Attic/GnomeArt/T … /GtkThemes
- http://www.orford.org/gtk/
Looking at existing themes to see how they tweak xfce components, is also a good way to understand. For example, look at Greybird's gtk-2.0/* files.

I would like to play with colors or even turn only appfinder's background transparent, or even given it a image as bg. I saw that someone already did'it with whisker menu!

The transparency may be an issue. You may need to use a theme engine to accomplish this.

Also search this forum for "gtk theme" - there have been a number of theme-related questions that have been asked that you might find helpful.


How To Ask For Help           Xfce FAQ                            Xfce Release Information
The Xfce Community          Xfce Tips and Tricks

Offline

#3 2017-01-21 19:44:50

gnanini
Member
Registered: 2017-01-19
Posts: 16

Re: Application Finder (xfce4-appfinder) tweak on .gtkrc-2.0

Thanks, it was useful... but it is still difficult for me!!!

Offline

Board footer

Powered by FluxBB