This forum has been archived. All content is frozen. Please use KDE Discuss instead.
The Discussions and Opinions forum is a place for open discussion regarding everything related to KDE, within the boundaries of KDE Code of Conduct. If you have a question or need a solution for a KDE problem, please post in the apppropriate forum instead.

Google Chrome not remembering its command line arguments

Tags: None
(comma "," separated)
rihad
Registered Member
Posts
25
Karma
0
OS
Hi, I'm running Google Chrome on Kubuntu 12.04. The desktop is configured to restore all windows each session. I've also changed Chrome's invocation with kmenuedit:
from /opt/google/chrome/google-chrome %U
to: /opt/google/chrome/google-chrome --disk-cache-dir=/var/tmp/chrome-cache --disk-cache-size=104857600 %U

The problem is, KDE ignores this change and runs Chrome without them on next session.
How do I work around this bug? AFAIK there are no other ways to tell Chrome to use non-default cache directory (because it may be "too confusing" for its users wink-wink)

Platform Version 4.8.5 (4.8.5) as per System Settings -> Help -> About.KDE
User avatar
google01103
Manager
Posts
6668
Karma
25

Tue Oct 29, 2013 4:16 pm
You should check out https://wiki.archlinux.org/index.php/Ch ... and_Tweaks
especially:
Making it all persistent

You can export your flags from ~/.profile:
export CHROMIUM_USER_FLAGS="--disk-cache-dir=/tmp --disk-cache-size=50000000"

Or add them to /etc/chromium/default:
# Default settings for chromium. This file is sourced by /usr/bin/chromium
#
# Options to pass to chromium
CHROMIUM_FLAGS="--scroll-pixels=200"

Chromium will prefer the user defined flags in CHROMIUM_USER_FLAGS to those defined in
/etc/chromium/default.


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
google01103
Manager
Posts
6668
Karma
25

Tue Oct 29, 2013 4:23 pm
Another option might be to create an executable script called google-chrome that resides in your ~/bin folder and should, if that dir is earlier in $PATH, be the one executed
Code: Select all
#! /bin/bash
google-chrome --disk-cache-dir=/var/tmp/chrome-cache --disk-cache-size=104857600 %U


OpenSuse Leap 42.1 x64, Plasma 5.x

rihad
Registered Member
Posts
25
Karma
0
OS

Re:

Tue Oct 29, 2013 4:53 pm
Thanks, but I'm not using Chromium, but stock Chrome install (DEB package): https://www.google.com/intl/en/chrome/browser/

google01103 wrote:Another option might be to create an executable script called google-chrome that resides in your ~/bin folder and should, if that dir is earlier in $PATH, be the one executed
Code: Select all
#! /bin/bash
google-chrome --disk-cache-dir=/var/tmp/chrome-cache --disk-cache-size=104857600 %U


Do you think KDE will remember to run my bash script, and not Chrome itself? I've also thought about adding it to $HOME/.kde/Autostart/
but how will this work with the KDE session restoration feature? I don't want to have to close Chrome before logging out, so it doesn't get run twice next session (first from session restoration, and another one from Autostart).
User avatar
google01103
Manager
Posts
6668
Karma
25

Tue Oct 29, 2013 5:31 pm
Google-chrome and Chromium should function the same, the differences are pretty minor except for multimedia (especially Flash) and some file/folder locations (chromium instead of google-chrome) see http://code.google.com/p/chromium/wiki/ ... ogleChrome

if your path has ~/bin preceding ~/usr/bin then your script should be executed

I don't know how it will work if you add it to autostart, I would guess you'd get 2 unless there was a single instance startup option and I did not see one though in a script you could test if chrome was running and not autostart it if it was - only way to tell is to test, If you use autostart you could force a closing of google-chrome at the close of your session using systemsettings -> startup & shutdown -> autostart -> add a script run at shutdown that kills chrome (never tried this so let me know how it works)

finally you could skip restore previous and use empty session and autostart everything which is what I do (don't exactly remember why but had issues with saved sessions)


OpenSuse Leap 42.1 x64, Plasma 5.x

rihad
Registered Member
Posts
25
Karma
0
OS
Thanks, I've simply removed Chrome and installed Chromium. It's exactly like Chrome, I didn't want to install it because I thought it was some kind of a cheap work-alike. Thank god Chromium reads its settings file no matter how it gets to run. Problem solved. And shame on Google for making it difficult to use their software.


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot]