You are not logged in.

#1 2019-04-05 08:08:22

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,731
Website

Firefox gtkWidget pref to fix dark GTK themes

-edit by hhh-This issue was raised in another thread and I've split the posts to stop derailment...

https://forums.bunsenlabs.org/viewtopic.php?id=5710

Here's is where @ohnonot drops a tasty tidbit (a Revelation, really)...

https://forums.bunsenlabs.org/viewtopic … 950#p84950

The next few posts praise @ohnonot, then he praises @nore, and that's where I've split it, beginning with @johnraff posting the OP source...

Last edited by hhh (2019-04-06 08:54:37)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#2 2019-04-05 08:12:12

hhh
Meep!
Registered: 2015-09-17
Posts: 8,324
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

John, if we can include this key in our BL configs somehow, I would feel much better about releasing lithium with a default dark theme. If it has to be done on the users end, I'd be fine with that too, we can just add a bold note in the Release Notes.

Offline

#3 2019-04-05 08:32:51

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,731
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

^It would be great, but Firefox deliberately gives its profile folders arbitary names. This is to prevent exactly the sort of thing we would be attempting - ie messing with user settings from outside. It might be possible to make a Firefox extension which does that, but a user would still have to install it though. Maybe we could ship an extension package and install it via bl-welcome?

All that would take a lot of research though, so for now, considering what an easy change it is, maybe we should stick with a well-signposted HOWTO.

(I've put it on my TODO list though.)

Last edited by johnraff (2019-04-05 08:34:08)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#4 2019-04-05 09:05:57

damo
....moderator....
Registered: 2015-08-20
Posts: 5,059

Re: Firefox gtkWidget pref to fix dark GTK themes

johnraff wrote:

^It would be great, but Firefox deliberately gives its profile folders arbitary names...)

But isn't it the only one called .mozilla/firefox/*.default?

Or you can get the name from .mozilla/profiles.ini: "Path=....."

Then

echo 'user_pref("widget.content.gtk-theme-override", "Bunsen-He");' >> .mozilla/firefox/$PROFILE_DIR/prefs.js

Last edited by damo (2019-04-05 09:13:26)


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#5 2019-04-05 09:38:56

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,731
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

Oh, yes! Good thinking, that sounds as if it should work. Put it in bl-welcome? Maybe check what GTK theme has been set, first?


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#6 2019-04-05 14:23:54

hhh
Meep!
Registered: 2015-09-17
Posts: 8,324
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

@schwim, see what you've started, you naughty, naughty man?

Anyway, we're on it and we'll open a thread in Development if necessary. And on that rather optimistic news, back to the tent...

Offline

#7 2019-04-05 15:18:30

schwim
Member
From: Western NC, US
Registered: 2015-09-29
Posts: 229
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

Haha, very sorry but it worked to my benefit so how sorry can I really be?

big_smile


Schw.im! A social site with an identity crisis.

Online

#8 2019-04-06 04:54:53

ohnonot
...again
Registered: 2015-09-29
Posts: 3,911
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

johnraff wrote:

^It would be great, but Firefox deliberately gives its profile folders arbitary names. This is to prevent exactly the sort of thing we would be attempting - ie messing with user settings from outside.

i recently installed librefox-cfg on my archlinux system, and it puts some configuration right into an existing firefox install.
the interesting thing is that these files do not exist on a firefox install, so there's no package conflict.
it's worth looking at the PKGBUILD, doesn't look too complicated, should work on debian, too.

Offline

#9 2019-04-06 05:05:35

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,731
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

^Are those files inside $HOME? If so, Debian packages aren't allowed to install them.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#10 2019-04-06 05:16:38

ohnonot
...again
Registered: 2015-09-29
Posts: 3,911
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

no.
look at the PKGBUILD, it's easy to understand (a shell script basically).
it installs into /usr/lib/firefox subfolders.

Offline

#11 2019-04-06 05:17:36

damo
....moderator....
Registered: 2015-08-20
Posts: 5,059

Re: Firefox gtkWidget pref to fix dark GTK themes

johnraff wrote:

^Are those files inside $HOME? If so, Debian packages aren't allowed to install them.

Do you mean $HOME/.mozilla, or $HOME generally? Because lots of Debian packages create dotfiles in $HOME.


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#12 2019-04-06 05:28:50

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,731
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

damo wrote:

...lots of Debian packages create dotfiles in $HOME.

Not at installation time. Yes, a lot of apps do generate dotfiles when they're run - firefox too.

ohnonot wrote:

...it installs into /usr/lib/firefox subfolders.

So will only affect users who make their first run of firefox after installing the cfg package, I guess?


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#13 2019-04-06 07:28:05

ohnonot
...again
Registered: 2015-09-29
Posts: 3,911
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

johnraff wrote:

So will only affect users who make their first run of firefox after installing the cfg package, I guess?

i don't understand the question.
/usr/lib/firefox should be created when firefox is installed.
that's firefox-esr for you debianites.
firefox-esr is present on a default BL install, and so is /usr/lib/firefox-esr.
this does not require actually running ff. the config i was talking about is NOT installed into any user-created directory.
this SHOULD also work on debian-based distros.

Offline

#14 2019-04-07 03:37:17

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,731
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

ohnonot wrote:
johnraff wrote:

So will only affect users who make their first run of firefox after installing the cfg package, I guess?

i don't understand the question.

I was assuming that some of the files under /usr/lib/firefox would be copied into ~/.mozilla on Firefox's first run, but it's clearly nothing like as simple as that. But somehow-or-other it's still true that ~/.mozilla (including prefs.js) is generated on Fx's first run.

the config i was talking about is NOT installed into any user-created directory.
this SHOULD also work on debian-based distros.

Indeed. Looking at the Arch installer, these three files are installed:
/usr/lib/firefox/defaults/pref/local-settings.js
/usr/lib/firefox/distribution/policies.json
/usr/lib/firefox/mozilla.cfg
The files themselves aren't to be found anywhere on Arch, but come from the original github Librefox repo.

What we would like to do here is add a config to what is usually written in the user profile's prefs.js. If there's a way to add a file to /usr/lib/firefox-esr that achieves the same thing, then maybe the key is hidden in Librefox's files, but I'll have to read up on /usr/lib/firefox/defaults/pref/local-settings.js (and whether the other two files are needed to enable it) first...

Last edited by johnraff (2019-04-07 03:38:12)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#15 2019-04-07 12:13:10

ohnonot
...again
Registered: 2015-09-29
Posts: 3,911
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

^ maybe also look at the small customisations that most distros add to their firefox versions.
There must be a way to make this global (pre-installed) without breaking package management.
why the reluctance to make it global? seems way more elegant than waiting for ff to create its randomised profile folder.

Last edited by ohnonot (2019-04-07 12:13:57)

Offline

#16 2019-04-08 02:01:00

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,731
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

^No reluctance at all to make the setting global. I just want it to be transparent, and easily reversible by the sysadmin/user. And share your (assumed) aversion to vendors like BL changing the user's files any more than necessary. In fact from #! we've inherited the concept of a huge default skel set that gets imported into $HOME. In many cases, there's no alternative, though, if you want a customized desktop, and other distros do the same. User config files also have the advantage of being easily visible to, and  modified by, the user. The big disadvantage is that, once set, they cannot be modified by package upgrades which might bring improvements or bugfixes.

Now, for this issue, thinking about a separate package, rather than a modified Firefox, that would either use dpkg-displace on a config file, or just drop a file into a directory if that works. Bunsen-openbox and bunsen-thunar both modify the config of their respective packages, and the effect can be reversed by uninstalling. (Bunsen-openbox will not be needed on Buster though.) That Arch package has some hints, yes.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#17 2019-04-08 20:11:54

stevep
MX Linux Developer
Registered: 2016-08-08
Posts: 373

Re: Firefox gtkWidget pref to fix dark GTK themes

It's one of the tweaks in MX-Tweak, if you want to borrow that somehow.

https://github.com/MX-Linux/mx-tweak/bl … ak/firefox

Offline

#18 2019-04-26 07:52:44

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,731
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

^Thanks stevep, I'll have a look at that.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#19 2019-06-28 05:46:42

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,731
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

Looking into applying this fix for Firefox in Lithium, and there does indeed seem to be a mechanism for "vendors" to add some prefs for all users without having to overwrite any existing files.

BUT... I haven't yet been able to reproduce the issue! With "Bunsen-Blackish-Remix as GTK theme, set YouTube to dark theme, and the search box is fine - white text on black background. This forum too (though I'm using the Crunchbang theme).

Can someone tell me a combination of settings and website that will bring this issue up?


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#20 2019-06-29 01:40:54

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,731
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

...found one.
Even if websites have cleaned up their act, Firefox extensions can be relied on to be more flaky, and a "post to twitter" widget, sure enough with a dark theme the text is unreadable.

That will be enough to test with.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#21 2019-07-01 01:15:00

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,731
Website

Re: Firefox gtkWidget pref to fix dark GTK themes

The fix turned out to be ridiculously easy: just drop a something.js file in /etc/firefox-esr.
In this particular case, you just need the line:

// make text boxes usable with dark themes
pref("widget.content.gtk-theme-override", "Bunsen-He");

The preference you put there will appear set in about:config as a default setting (not bold) but users can change it as they wish. There is no locking of prefs here, which is fine for cases like this IMO.

The .js file could go in /usr/share/firefox-esr/browser/defaults/preferences/ instead, but I figured Debian will probably take care that the file under /etc will continue to work, even if Mozilla change their own install paths.

Anyway the fix has gone out in bunsen-configs 10.3.2-1


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

Board footer

Powered by FluxBB