You are not logged in.

#1 2015-10-09 04:31:29

JasonMehmel
Member
Registered: 2015-10-06
Posts: 186

[solved]keep apps from inheriting the GUI's colour scheme

I've been using Bunsen-Blackish as my widget style and Nightmare as my Openbox colour theme, and overall it's great. That said, a few programs, specifically Chrome and Firefox, are inheriting some of those theme elements in ways that are less than optimal.

(For example, Firefox, when giving me a text box, coloured it dark along with the theme, but the letters that I was typing were also black... less than optimal.)

This is less noticeable in Chrome. I think I've seen it in other programs but I can't think of any others at the moment.

Is there an option for some programs to retain their own colours, or at least ignore the system defined ones?

Last edited by JasonMehmel (2015-10-09 06:16:21)


Fortune favours the bold.
ThinkPad T15 Gen 2i

Offline

#2 2015-10-09 05:18:00

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,032
Website

Re: [solved]keep apps from inheriting the GUI's colour scheme

For Firefox/Iceweasel, open /usr/share/themes/Bunsen-Blackish/README and follow the instructions. 8o

For Chrome, set the theme style to GTK+ in Settings>Appearance.

For other programs like Meld, really it's just easiest to change to a light theme.


No, he can't sleep on the floor. What do you think I'm yelling for?!!!

Offline

#3 2015-10-09 05:37:02

JasonMehmel
Member
Registered: 2015-10-06
Posts: 186

Re: [solved]keep apps from inheriting the GUI's colour scheme

Brilliant. That worked for Iceweasel (which is what I meant to say when I said Firefox) so I guess it keeps those files in the same place!

For Chrome, I'm okay switching themes if need be.

So this fix would be on a program-by-program basis, based on the user?


Fortune favours the bold.
ThinkPad T15 Gen 2i

Offline

#4 2015-10-09 06:44:13

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,032
Website

Re: [solved]keep apps from inheriting the GUI's colour scheme

Some programs are less flexible with theming in that they expect dark text (print) on a light background (paper). That's why the default BunsenLabs GTK theme is Bunsen and not Bunsen-Dark.


No, he can't sleep on the floor. What do you think I'm yelling for?!!!

Offline

#5 2015-10-10 18:16:56

JasonMehmel
Member
Registered: 2015-10-06
Posts: 186

Re: [solved]keep apps from inheriting the GUI's colour scheme

Ah. Thanks for the info... I might poke around at the other GTK themes too...


Fortune favours the bold.
ThinkPad T15 Gen 2i

Offline

#6 2015-10-30 05:01:56

Temetka
Member
From: Sol System, Western Spiral Arm
Registered: 2015-10-14
Posts: 549

Re: [solved]keep apps from inheriting the GUI's colour scheme

Well, glad I stumbled across this. This is exactly what I was looking for to fix an IceWeasel issue.

Thanks!


The meaning of life is to just be alive. It is so plain and so obvious
    and so simple. And yet everybody rushes aroound in a great panic
             as if it were necessary to achieve something beyond themselves.
                                                                                                             - Alan Watts

Offline

#7 2015-10-30 05:36:59

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,550
Website

Re: [solved]keep apps from inheriting the GUI's colour scheme

JasonMehmel wrote:

That worked for Iceweasel (which is what I meant to say when I said Firefox) so I guess it keeps those files in the same place!

Iceweasel and Firefox are pretty much identical, except for some branding changes.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#8 2015-11-05 06:50:36

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: [solved]keep apps from inheriting the GUI's colour scheme

these days, i use bunsen-blackish for my ui, but i start iceweasel like this:

#!/bin/dash

GTK2_RC_FILES="$HOME/.mozilla/firefox/gtkrc" /usr/bin/iceweasel "$@" &
exit 0

(save to $HOME/bin, make executable)

~/.mozilla/firefox/gtkrc:

include "/home/username/.gtkrc-2.0.mine"
gtk-theme-name="Bunsen"
gtk-icon-theme-name="Emerald"
gtk-font-name="Open Sans 9"
gtk-cursor-theme-name="Polar-Blue"
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_ICONS
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=0
gtk-menu-images=1
gtk-enable-event-sounds=0
gtk-enable-input-feedback-sounds=0
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintfull"
gtk-xft-rgba="rgb"

(a clone of ~/.gtkrc-2.0, except for the gtk theme.)

Offline

#9 2015-11-11 12:38:19

vasa1
Member
Registered: 2015-09-29
Posts: 204

Re: [solved]keep apps from inheriting the GUI's colour scheme

ohnonot wrote:

these days, i use bunsen-blackish for my ui, but i start iceweasel like this:

#!/bin/dash

GTK2_RC_FILES="$HOME/.mozilla/firefox/gtkrc" /usr/bin/iceweasel "$@" &
exit 0

...

Could you please explain the purpose of

... "$@" &
exit 0

I too use a different gtk theme for Libreoffice Calc than my default. My code is this:

#!/usr/bin/env bash

# used by Openbox right-click menu

GTK2_RC_FILES=$HOME/.gtkrc-LibO libreoffice4.4 --calc

And in my ~/.local/share/applications/libreoffice-calc.desktop the Exec= line is this:

Exec=bash -c 'GTK2_RC_FILES=$HOME/.gtkrc-LibO libreoffice4.4 --calc %u'

Last edited by vasa1 (2015-11-12 12:37:11)


Using the Openbox (3.5.2) session of Lubuntu 14.04 LTS but very interested in BL :)

Offline

#10 2015-11-12 07:08:40

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: [solved]keep apps from inheriting the GUI's colour scheme

vasa1 wrote:
..."$@" &
exit 0

Could you please explain the purpose of the part I underlined?

that last bit ($@) ensures that all command line arguments passed to ~/bin/iceweasel are passed on to /usr/bin/iceweasel.
the "&" forks the iceweasel process away from the script, and the "exit 0" simply exits the script with no error.

Offline

#11 2015-11-12 10:44:47

Snap
Member
Registered: 2015-10-02
Posts: 465

Re: [solved]keep apps from inheriting the GUI's colour scheme

Something to explore. Thanks for the insight, folks.

Offline

#12 2015-11-12 12:41:53

vasa1
Member
Registered: 2015-09-29
Posts: 204

Re: [solved]keep apps from inheriting the GUI's colour scheme

ohnonot wrote:
vasa1 wrote:
..."$@" &
exit 0

Could you please explain the purpose of the part I underlined?

that last bit ($@) ensures that all command line arguments passed to ~/bin/iceweasel are passed on to /usr/bin/iceweasel.
the "&" forks the iceweasel process away from the script, and the "exit 0" simply exits the script with no error.

Thanks for explaining!

I guess you're launching the script from the terminal. I use my codes in menu.xml and in the .desktop file so I'm guessing the code you use would not be required in my context.


Using the Openbox (3.5.2) session of Lubuntu 14.04 LTS but very interested in BL :)

Offline

#13 2015-11-14 04:52:05

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,550
Website

Re: [solved]keep apps from inheriting the GUI's colour scheme

ohnonot wrote:
vasa1 wrote:
..."$@" &
exit 0

Could you please explain the purpose of the part I underlined?

that last bit ($@) ensures that all command line arguments passed to ~/bin/iceweasel are passed on to /usr/bin/iceweasel.
the "&" forks the iceweasel process away from the script, and the "exit 0" simply exits the script with no error.

Forking a process like this still leaves the script "running" till the child process closes. Try "exec", this makes the child process take over the shell so the process which launched it no longer exists:

exec GTK2_RC_FILES="$HOME/.mozilla/firefox/gtkrc" /usr/bin/iceweasel "$@"

The 'exit 0' also becomes unnecessary as that command will never be reached.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#14 2015-11-14 08:21:34

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: [solved]keep apps from inheriting the GUI's colour scheme

thanks johnraff!

Offline

#15 2015-11-14 10:57:31

Snap
Member
Registered: 2015-10-02
Posts: 465

Re: [solved]keep apps from inheriting the GUI's colour scheme

Indeed!

Offline

#16 2015-11-14 11:48:45

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: [solved]keep apps from inheriting the GUI's colour scheme

not quite!
it has to be like this:

#!/bin/dash

GTK2_RC_FILES="$HOME/.mozilla/firefox/gtkrc"
exec /usr/bin/iceweasel "$@"

(same with bash)

Offline

#17 2015-11-15 04:12:57

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,550
Website

Re: [solved]keep apps from inheriting the GUI's colour scheme

^that will teach me to post code without testing it! I was wondering how the variable assignment would work with exec...

Actually, with the variable on its own line, don't you have to export it before launching iceweasel?

export GTK2_RC_FILES="$HOME/.mozilla/firefox/gtkrc"
exec /usr/bin/iceweasel "$@"

Or perhaps this would work? (one line)

GTK2_RC_FILES="$HOME/.mozilla/firefox/gtkrc" exec /usr/bin/iceweasel "$@"

...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#18 2015-11-15 08:41:57

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: [solved]keep apps from inheriting the GUI's colour scheme

johnraff wrote:

Actually, with the variable on its own line, don't you have to export it before launching iceweasel?

i was thinking that myself, but lo and behold, my version does what it should (i.e. start iceweasel with a light theme regardless of the dark theme my ui uses).

Offline

#19 2015-11-15 15:41:31

pvsage
Internal Affairs
Registered: 2015-09-29
Posts: 1,433

Re: [solved]keep apps from inheriting the GUI's colour scheme

johnraff wrote:

Actually, with the variable on its own line, don't you have to export it before launching iceweasel?

Shouldn't have to, especially with the hashbang.  What happens in the script stays in the script; the child process inherits variables from the parent script.
I think?


Be excellent to each other, and...party on, dudes!
BunsenLabs Forum Rules
Tending and defending the Flame since 2009

Offline

#20 2015-11-21 08:23:15

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,550
Website

Re: [solved]keep apps from inheriting the GUI's colour scheme

Not quite sure what's happening here, to be honest. I've just tried 'exec urxvt' from a terminal to see what variables get passed over to the new terminal. Even with exec I had to use

export var=test
exec urxvt

or

var=test exec urxvt

to get 'echo $var' to work in the new terminal. question.gif


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

Board footer

Powered by FluxBB