Firefox Snap doesn't respect or use the SNAP Theming API
Categories
(Firefox :: Theme, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox72 | --- | verified |
People
(Reporter: koolkrish007+github, Assigned: koolkrish007+github)
References
(Depends on 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Steps to reproduce
sudo snap install firefox
My environment variable in my bashrc defines the following
GTK_THEME=Breeze-Dark
export GTK_THEME
I then launch firefox with the default theme set.
Expected Results
It should have used the dark theme provided by the gtk-common-themes plug.
Actual Results
The result is a bright white theme.
How to fix
I have an example of how to do this for my own Thunderbird snap which works really well for Thunderbird and I think would work the same here. This is based on Ken Vandine's thunderbird snap from launchpad.
https://github.com/Kedstar99/ThunderbirdSnap/blob/master/snapcraft.yaml
The main things that need to be added I think are the desktop-gnome-platform parts and the use of the gtk-3-themes, icon-themes, sound-themes. It also requires the gnome plug but I think that depends on the infrastructure used to build the snap. For my thunderbird snap, I build it easily in a docker of ubuntu 18.04 so I specify the base as core18 and I also use the gnome-3-28-1804 plug. This I think needs a little bit of clarification of how the firefox snap is built and distributed.
The advantage I think of doing this is that theming support is consistent across snaps and I benefit from speed and caching improvements offered by the gnome plug.
https://forum.snapcraft.io/t/desktop-app-support-gtk/6834
https://forum.snapcraft.io/t/how-to-use-the-system-gtk-theme-via-the-gtk-common-themes-snap/6235
Assignee | ||
Comment 1•5 years ago
|
||
In this patch I have adapted the Docker file to make use of core18 and snapcraft3.
This is the recommended approach as stated here.
https://snapcraft.io/docks/t/creating-docker-images-for-snapcraft/11739
Specifically the part talking about replacing likes FROM ubuntu:xenial with FROM ubuntu:bionic.
In snapcraft.yaml.in, I adjusted the snap by using the gnome-3-28 extensions as described in
https://forum.snapcraft.io/t/the-gnome-3-28-extension/13485.
In addition, I followed the instructions presented by removing the unnecessary plugs relating
to the desktop extension and adding the relevant dbus slot.
As part of the build process, it required a bunch of extra staged packages which I have documented.
I also used the magic part from Ken Vandine's thunderbird snapcraft for updating mime info.
https://bazaar.launchpad.net/~ubuntu-desktop/thunderbird/snap/view/head:/snapcraft.yaml
I also removed the xdg-open as that seemed to not be enabling the building of the snap.
I wanted to test the latest revision of the patch in [1], but bug 1596135 made me unable to.
Comment 4•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Hi Bogdan!
This patch represents a risk for 72.0bX on Ubuntu Snap only. Can someone from QA run some smoketests on the next beta? It will come next week.
Assignee | ||
Comment 6•5 years ago
|
||
Hi Johan,
Thanks for merging my patch. I am currently running the snap that was produced by the treeherder and from what I can tell things are working ok.
For QA or if someone wants to test the snap under strict confinement simply run the following command.
sudo snap install --dangerous --jailmode <target.snap>
The dangerous flag just tells snapcraft to ignore the fact that the snap wasn't signed and jailmode tells it to run under strict confinement.
Kind regards,
Krish
Assignee | ||
Comment 7•5 years ago
|
||
For reference here is the snap running on default Ubuntu 18.04 in strict confinement mode. The theme in Firefox is set specifically to default rather than dark mode.
https://i.imgur.com/4KNYUMt.png
I specifically set the snap theme to use Breeze-dark theme by exporting the variable in my bashrc.
I also ran YouTube for an hour no problem, saved and opened a file.
I loaded my firefox profile, everything seemed fine.
I opened a html file from my home directory and it seemed to open just fine.
I did this on Ubuntu 19.10, 18.04 and everything seems fine.
You guys will probably run a whole additional test-suite on top of this but from my limited perspective things seem faster, snappier and better integrated. Certainly it fixed the issues which I specified in this bug.
It even detected the dark theme in the addons without any additional configuration.
Hey Krish!
Thank you very much for your testing and your detailed messages. π
@QE: Per bug 1600787, the b1 snap hasn't made the official channels yet. Although, it's ready for testing at [1]. Instructions to install are documented in comment 6.
Comment 10•5 years ago
|
||
Official snap beta 72.0b2-1 (289) working great so far (standard confinement) with Yaru theme on Ubuntu 19.10.
Comment 11•5 years ago
|
||
In the effort to verify this issue in the snap build provided in comment 8 I have downloaded and tried to install the Breeze-Darker theme from https://www.gnome-look.org/p/1301661/
. I have stumbled upon the fact that I can't copy the theme in the .themes folder, although it's a read-only file I couldn't change the permission from terminal. I also found the bashrc file and I don't know where to put the GTK_THEME variable, if someone could help me with some guidance on how to install the theme.
Assignee | ||
Comment 12•5 years ago
|
||
So unfortunately for themes that aren't provided by gtk_common_themes, you need to create a snap package specifically and connect it via the gtk_3_themes slot.
Here is an example of my version with the sweet GTK theme. https://github.com/Kedstar99/sweet-snap/blob/master/snapcraft.yaml
I have also published adapta-gtk-snap. https://snapcraft.io/adapta-gtk-snap
There I have listed more instructions to how to do it.
If you are building your own snap custom, again just build the theme snap and connect it via the --dangerous --jailmode flags.
Assignee | ||
Comment 13•5 years ago
|
||
Breeze-dark is provided by the gtk_common_themes snap.
As such, to test for Breeze_dark on the commandline just run 'GTK_THEME=Breeze-Dark firefox'.
Comment 14•5 years ago
|
||
I can confirm that the issue is fixed on the snap build from comment 8, after properly installing the GTK Adapta theme, firefox is starting with the selected theme when it is opened from the terminal with the GTK_THEME=Adapta-Nokto-Eta ./firefox -p --dangerous --jailmode
. Thank you Krish for providing the steps on how to install a GTK theme and how to run it.
(In reply to Johan Lorenzo [:jlorenzo] from bug 1591751 comment #10)
(In reply to Krish De Souza bug 1591751 from comment #8)
Would it be possible to know how many people are currently using the Firefox snap? This is just for personal interest and to measure the impact of my change.
Hey Krish! I can say 92.8% of our beta population got 72.0b3! The rest still has to update :)
Followup: 72 was officially released last week and the latest numbers show that more than 85% of the global user base runs now 72 or higher. I haven't heard about any fall-outs due to your patch. I'd like to seize the opportunity to thank you very much, Krish, for your involvement and the quality of your work π― ππ
Assignee | ||
Comment 16•5 years ago
|
||
(In reply to Johan Lorenzo [:jlorenzo] from comment #15)
(In reply to Johan Lorenzo [:jlorenzo] from bug 1591751 comment #10)
(In reply to Krish De Souza bug 1591751 from comment #8)
Would it be possible to know how many people are currently using the Firefox snap? This is just for personal interest and to measure the impact of my change.
Hey Krish! I can say 92.8% of our beta population got 72.0b3! The rest still has to update :)
Followup: 72 was officially released last week and the latest numbers show that more than 85% of the global user base runs now 72 or higher. I haven't heard about any fall-outs due to your patch. I'd like to seize the opportunity to thank you very much, Krish, for your involvement and the quality of your work π― ππ
Hi Johan,
Thanks for letting me know and for helping me get my first commit in. I am always looking out for small areas like this where I can help out. Glad that things seem to be working smoothly.
Kind regards,
Krish
Assignee | ||
Comment 17•5 years ago
|
||
Hi Johan,
I notice that the Firefox 73 build hasn't been pushed from candidate to stable. Is there any particular problem occurring with the build?
Kind regards,
Krish
Hi Krish!
Thank you for your message. I do see 73.0 being on candidate but not on stable yet. Usually, the release management team is in charge of releasing the snap build to the broad population. Although, they're short on people these days. Ryan, are you okay to make the 73.0-3 snap build available to all? If so, do you want me to handle it?
Comment 19•5 years ago
|
||
It was held back due to stability issues in the 73.0 release. We're planning to ship 73.0.1 tomorrow to address that.
Description
•