13

What I do know about applying the same settings for applications to all new users is either defining a schema or override file in /usr/share/glib-2.0/schemas or copying the folder/file to /etc/skel. When a new user is created, that user is automatically given the gsettings/config file.

So, my question is:

  • How do I apply a theme to Firefox and get this to apply to all users?
  • Does Firefox use gsettings type settings? And if so, which ones?
  • Does Firefox use config files (e.g. in ~/.config)? If so which ones?

I happen to be using either Gnome Shell or Unity, but I think the answer will apply to any desktop environment.

fossfreedom
  • 172,746

1 Answers1

12

Step 1: Download the theme file

Go to Firefox Themes website and download the xpi file of your favorite theme, say Arc Theme.

Download Arc Theme

Step 2: Install the theme for all users

Open the downloaded theme file with Archive Manager.

Open with Archive Manager

You'll see an install.rdf file inside. Open it too and copy the ID between the first <em:id> and</em:id> you find, which in Arc Theme's case is {52c2877e-44e1-11e5-8874-a62d1d5d46B0}. Note the theme's internal name too, you'll need it later.

Theme ID and Name

Rename the theme's xpi file with the ID you just copied. Then place the renamed xpi file in /usr/lib/firefox-addons/extensions/. To do so, open the Terminal and run this command:

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY nautilus /usr/lib/firefox-addons/extensions/

and copy the xpi file ({52c2877e-44e1-11e5-8874-a62d1d5d46B0}.xpi in Arc Theme's case) to the File Manager window that opens up.

Install theme to extensions folder

Step 3: Set the theme as default

Create a theme.js file (or a .js file with any name you like) in /usr/lib/firefox/browser/defaults/preferences/. To do so, open the Terminal and run this command:

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gedit /usr/lib/firefox/browser/defaults/preferences/theme.js

When the preferences file gets opened in Text Editor, copy and paste this into it:

pref("general.skins.selectedSkin", "arc-theme");

But, don't forget to replace arc-theme with the theme's internal name you saw in install.rdf!

Okay, that's all. Firefox is now set to use your favorite theme by default! Tested and verified on Ubuntu 14.04LTS with Firefox 45.

Firefox Arc Themed


Background

Solus Project uses Firefox as it's default browser, but with it's theme set to Arc Darker 'out of box'. So, I poked around their firefox and arc-firefox-theme packages, found out how it works and then reproduced the method on Ubuntu.

  • Nice well written answer.Very useful – Suici Doga Mar 16 '16 at 02:29
  • 1
    Why use pkexec when you can use sudo – Suici Doga Mar 16 '16 at 02:30
  • 1
    Using sudo for GUI applications like Nautilus or Gedit is a bad idea @SuiciDoga, but you could simply use gksudo nautilus /path/to/directory and gksudo gedit /path/to/file - that's what I personally use. – Byte Commander Mar 16 '16 at 11:33
  • @ByteCommander Why is it? – Suici Doga Mar 16 '16 at 13:15
  • 1
    @SuiciDoga Read this question: http://askubuntu.com/questions/270006/why-user-should-never-use-normal-sudo-to-start-graphical-application – Byte Commander Mar 16 '16 at 13:26
  • @ByteCommander gksudo got deprecated and is no longer preinstalled in Ubuntu. Got removed from default installation image by 14.04LTS or so. That's why I used pkexec instead. Yeah, the commands're pretty big when compared to gksudo, but I think Ubuntu 16.04LTS may have updated Polkit files for gedit and nautilus. I'll check if it can be run by simply pkexec nautilus without the environmental variables and update the answer when 16.04LTS is out. – Rohan 'HEXcube' Villoth Mar 17 '16 at 07:08
  • @HEXcube Aha. Well, I still always install the gksu package on every system. I don't see why it should be deprecated - at least as long as there's no equally simple alternative. – Byte Commander Mar 17 '16 at 07:24
  • 1
    Also @ByteCommander I can find posts suggesting gksudo is deprecated, but cannot find a reliable source. The fact that it is not installed by default on Ubuntu does not mean it shouldn't be. Do you have a reliable source, other then "I think...."? – Jacob Vlijm Mar 17 '16 at 10:31