You are not logged in.

#1 2014-05-26 18:34:04

ArzhurB
Member
Registered: 2013-04-18
Posts: 6

XFCE/GTK-2: How to set a different theme for a specific app only?

Hi to all,

I have searched the web but I couldn’t find any satisfying answer to my question.

Here’s the issue: I use a fine-looking dark GTK-2 theme under XFCE that will lead to an awful results in very few applications only, making them unusable. (Actually, I have a real issue with one program only, namely Exelis’ proprietary IDL DE — yes, work sometime has you transgress your ideals a bit…)

The simplest solution would be to have the reluctant app only use a different GTK-2 theme.

The only way to do this I found was to set the $GTK2_RC_FILES environment variable to the location of the alternative gtkrc before launching the desired app. For instance:

GTK2_RC_FILES=/usr/share/themes/Greybird/gtk-2.0/gtkrc idlde

But I won’t have it work.

So either I am perfectly dumb and am unable to use nor understand a playground issue, either XFCE passes the GTK-2 theme to applications by a different means. Therefore, I investigated a bit, and it turns out that by default, the $GTK2_RC_FILES is not set. And yet, my programs are told what GTK-2 theme to use!

So here are my two questions:

  • How can I tell a specific application to use a GTK-2 theme / rc file different from the session-wide-used one?

  • How the heck are applications told what theme to use in XFCE?!


I might get irrelevant answers related to these three remarks, so please take them into consideration:

  • This question is by no means related to the issue experienced with GTK-3 applications and some themes under XFCE.

  • It is not an option for me to adapt the session-wide used GTK-2 theme and have it support the application, since this method would be too highly depending on the application itself and far too restrictive.

  • I can still session-widely change the theme settings to Greybird when using the application, but since it is at a great loss for my eyes and desktop’s style, I only consider it as a temporary solution.


Thanks for any answer! smile

Offline

#2 2014-05-28 01:18:31

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: XFCE/GTK-2: How to set a different theme for a specific app only?

Are you running that command from a terminal, a launcher, or some other way? Does it make a difference if you run it in bash like:

bash -c 'GTK2_RC_FILES=/path/to/second/gtkrc programname'

Also does it not work for any program or just idlde?

Offline

#3 2014-05-28 03:00:55

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,701

Re: XFCE/GTK-2: How to set a different theme for a specific app only?

anonymous_user wrote:

Are you running that command from a terminal, a launcher, or some other way? Does it make a difference if you run it in bash like:

bash -c 'GTK2_RC_FILES=/path/to/second/gtkrc programname'

I don't think you need to wrap that in bash -c. 

GTK2_RC_FILES=/path/to/second/gtkrc programname

should work, or am I going to have the opportunity to learn something today? tongue


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#4 2014-05-28 09:08:12

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,304

Re: XFCE/GTK-2: How to set a different theme for a specific app only?

It should work if the program is correctly written to use the GTK2_RC_FILES variable and give its value the highest priority to choose the gtk2 theme.
This is not done automatically, it needs to be written in the program.
But as the 'idlde' program is a proprietary closed source appli, only its developers can tell how they choose the gtk2 theme.

Last edited by berbae (2014-05-28 09:14:44)

Offline

#5 2020-05-22 20:49:58

rjunior8
Member
Registered: 2019-11-09
Posts: 1

Re: XFCE/GTK-2: How to set a different theme for a specific app only?

How to do it for window decorator in xfwm4?

Offline

#6 2020-05-22 22:34:23

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: XFCE/GTK-2: How to set a different theme for a specific app only?

rjunior8, this thread is six years old. Please do not necrobump.

Closing.

Offline

Board footer

Powered by FluxBB