wish: use colors from dark version of system theme

Asked by Yann Simon on 2014-04-23

Hi,

a system theme has two variants: a bright and a "dark" one.
I'd like to configure terminator so that it uses the colors from the dark version of the system theme.

Is it already possible?
If not, it is a wish. ;)

Question information

Language:
English Edit question
Status:
Answered
For:
Terminator Edit question
Assignee:
No assignee Edit question
Last query:
2014-05-03
Last reply:
2014-05-05

It's a little unclear to me if you are talking about the gtk theme, or the terminal color scheme as defined in the Preferences -> Profiles -> Colors tab.

For changing the GTK theme see these two helpful links found with minimal google-fu:
http://ubuntuforums.org/showthread.php?t=1340828
http://urukrama.wordpress.com/2008/07/13/setting-a-custom-gtk-theme-for-specific-applications/

If you are talking about the terminal color scheme, I'd recommend you just create your own custom palette derived from the one you like.

Yann Simon (yann-simon-fr) said : #2

I think you misunderstood my question.

An example: the Gnome terminal use the dark version of the theme, when the option "Global Dark Theme" is activated:
https://wiki.gnome.org/action/show/Apps/GnomeTweakTool?action=show&redirect=GnomeTweakTool

In Terminator, if I choose the use the colors from the system theme, I get the bright ones, not the dark one.
-> either there should be another option in terminator to use the dark version of the system theme
-> or terminator should be able to use the dark version of the system theme by default.

Something you may not realise: Terminator is GTK 2.x, while (for me at least with Ubuntu 12.04 LTS) gnome-terminal is GTK 3.x. It looks like gnome tweak tool is also for GTK 3.x too. No amount of toggling that switch in GTT will have an effect. I currently can't figure out if gtk 2 has the same "global dark theme" feature, but so far I don't think so.

Yann Simon (yann-simon-fr) said : #4

No, I was not aware Terminator is in GTK 2.x.
I am "only" an user of Terminator and have not look into how it is technically implemented.

Thanks for the information.

As a user, I think this feature could be very valuable. It would allow Terminator to have consistent dark colors with other applications.

Is there a long-term wishlist for Terminator somewhere where I could add this wish?

Hi Yann, you create a bug report (there should be a link just below this text with a green plus symbol) that will create one linked back to the Question, and when it pops up I'll mark it as a wishlist item.

As I said, this may not even be possible with GTK2.0, and would have to wait till the mythical GTK3.0 version.

Leo Iannacone (l3on) said : #6

I have a workaround for this issue, just add these lines to bashrc:

# set dark theme for terminal emulators
if [ "$TERM" == "xterm" ] ; then
  xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT "dark" -id `xprop -root | awk '/^_NET_ACTIVE_WINDOW/ {print $5}'`
fi

Hope this help.

Robert Smith (robsmithy) said : #7

Leo's answer worked for me but needed a couple of tweaks (sleep to let the window register and a different terminal type):

# Force apps GTK dark theme
# set dark theme for xterm emulators
if [ "$TERM" == "xterm-256color" ] ; then
    sleep .5
    xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT "dark" -id `xprop -root | awk '/^_NET_ACTIVE_WINDOW/ {print $5}'`
fi

Kaushik Evani (kaushik-evani) said : #8

Hi, I was looking for this as well. I tried @l3on's and @robsmithy's solutions. It seems to have worked but only for the prompt. The background still remains the "light" version. Any solutions on how to set the background to "dark" theme as well? Cheers!

Can you help with this problem?

Provide an answer of your own, or ask Yann Simon for more information if necessary.

To post a message you must log in.