Note: when I say Chromium, I mean both Google Chrome and Chromium.
What I do know about applying the same settings for applications to all new users is either defining an schema/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 Chromium and get this to apply to all users? Does Chromium use gsettings
type settings? If so, which ones?
Does Chromium use config files (e.g. in ~/.config
)? If so, which ones?
I happen to be using either Gnome or Unity - but I suspect any answer will apply to any desktop environment.
I've found this link for a similar Q for Chrome - but for Windows.
Does this apply somehow to Ubuntu ... and also to Chromium?
Having had a quick chat in the general room ... /etc/chromium-browser/customizations
was mentioned - so this may give a clue on what may need to be done for themes.
User config directory
Chromium does use a
~/.config
directory (~/.config/chromium
-~/.config/google-chrome
for Google Chrome), customisable using a command line flag:So, the simplest way to create a new configuration is to run either of these with
--user-dir=newconfig
, customize as needed, then copy over thenewconfig
directory to/etc/skel/.config/chromium
and/etc/skel/.config/google-chrome
.Administrative policies
The last, but perhaps the most flexible, way would be to use
/etc/chromium-browser/policies
(or/etc/opt/chrome/policies
for Google Chrome). The Chromium Documentation for Administrators has pages for Windows, Mac and Linux.Essentially, on Linux, you make use of JSON files in
policies/managed
andpolicies/recommended
. Themanaged
directory is for settings that are enforced - the user can't change them.I'll just adapt the example given for Linux:
Now, on Chromium, the homepage is locked to
www.chromium.org
. Correspondingly, if the file had been inrecommended
, the user can change their home page.The current list of policies is available here. It lists policies, their descriptions and example values.
To install a theme or an extension, the
ExtensionInstallForcelist
policy can be used. It can't berecommended
, onlymanaged
:This will install the Adblock Extension and the GData Centers 1 Council Bluffs, Iowa theme.
/etc/chromium-browser/customizations
/etc/chromium-browser/customizations/00-example
seems to indicate it can only be used for detecting plugins and adding command line flags:(That's from
48.0.2564.116-0ubuntu0.14.04.1.1111
, by the way, despite what theUPSTREAM_VERSION
might indicate. And for some reason, only the 32-bit package on Ubuntu 14.04 has it, not the 64-bit one.)The list of command line flags for Chromium can be found at http://peter.sh/experiments/chromium-command-line-switches/, according to
the Chromium website.
discover_registration
doesn't seem to be an executable command - it might be a shell function, but I'm inclined to suspect these files are not parsed by our normal shells. In any case, I think this method is not sufficiently versatile, and it's difficult to override if all you want is for users to start off with some settings while letting them change those later. And the flags don't seem to provide a way of installing a theme or an extension.GSettings
A quick scan of
dconf-editor
on my system indicates Google Chrome doesn't use it. Neither, apparently (thanks @Serg), does Chromium.Conclusion
All told, either of the first two methods can be used, and Google Chrome supports whatever Chromium does, but with different paths. Where Chromium has
/etc/chromium-browser
and~/.config/chromium
, Google Chrome has/etc/opt/chrome
and~/.config/google-chrome
, respectively. The first method is OK for one-time initialization, anything more would require the second method.Since not all settings can be configured using policies, you might have to use both of them.