Where can I set CLI flags for Google Chrome on Unity?
For xubuntu/xfce4, though it might work similarly elsewhere:
cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications/google-chrome.desktop
and modify the three
Exec= lines in
~/.local/share/applications/google-chrome.desktop to include the arguments you want. Because it has the same filename, xfce4-whiskermenu will pick up only your modified
If Chrome is your default browser, another application opening a URL will still cause Chrome to launch without your arguments. To fix this, create a new file
~/bin/google-chrome with these contents:
/usr/bin/google-chrome YOUR_EXTRA_ARGS "$@"
chmod +x ~/bin/google-chrome. Then, in Preferred Applications, set your Web Browser to Other... and enter:
Also, to avoid having to change the arguments in four places in the future, you can point the
Exec= lines in
google-chrome.desktop to your
I'm running Xubuntu and I was trying to figure this one out as well. I tried the solution to edit the .desktop file. I haven't updated, but I have the same concern as you (will it get overwritten). I tried a different option where I added an alias to my .bashrc file.
alias chromium-browser="/usr/bin/chromium-browser [FLAGS]"
For Chromium, the method suggested by @errr is correct, however, it is deprecated as of Chromium 52 (or earlier):
┌ alex [~] └──> export CHROMIUM_USER_FLAGS="--version" ┌ alex [~] └──> chromium-browser Using PPAPI flash. WARNING: $CHROMIUM_USER_FLAGS is deprecated. Instead, update CHROMIUM_FLAGS in ~/.chromium-browser.init or place configuration for all sers in /etc/chromium-browser/customizations/ . WARNING: Ignoring system flags because $CHROMIUM_USER_FLAGS is set. CHROMIUM_FLAGS= --ppapi-flash-path=/usr/lib/adobe-flashplugin/libpepflashplayer.so --ppapi-flash-version= CHROMIUM_USER_FLAGS=--version Chromium 52.0.2743.116 Built on Ubuntu , running on Ubuntu 16.04
As you can see, the solution is quite obvious however.
┌ alex [~] └──> echo "CHROMIUM_FLAGS=\"--version\"" >> ~/.chromium-browser.init chromium-browser ┌ alex [~] └──> chromium Using PPAPI flash. Chromium 52.0.2743.116 Built on Ubuntu , running on Ubuntu 16.04
These changes will persist through upgrades, making it superior to solutions updating system files.
However, for Google Chrome, I have not found a single way other than modifying desktop files or writing custom launchers.
First, open up a terminal. Then type in
(release-type) with the release of google chrome you are using (stable,unstable,ect.) and
(flag) with the flag that you want to run Google Chrome with.
To have the flags run when you click on the Google Chrome Unity icon in the launcher:
- first install Unity Launcher Editor.
- Open up a terminal window and type
sudo apt-get install bzr.
- When it is has finished installing, type
bzr branch lp:unity-launcher-editor.
- Next, launch Unity Launcher Editor by typing
- Now, click on the Google Chrome icon, and add the flag you want to run in the Command box.