1

On http://susestudio.com/, there's an option to enter custom command line scripts. How do I write one that changes the default homepage and sets the browser full screen?

4 Answers 4

1

If you start Chromium from the command line with a URL, it will open with that page, eg:

chromium http://susestudio.com

As for opening the browser fullscreen, man chromium has an -app option:

--app=URL
Runs URL in "app mode": with no browser toolbars.

which seems to be the closest option.

Similarly, Firefox can be started the same way, with your required URL as an argument to the command. To open Firefox in full screen, create a new profile using the -ProfileManager option, change to Fullscreen and then whenever you start Firefox with that profile, it will use the Fullscreen option.

1
  • Thanks, though where would I put this code? Run script whenever the appliance boots or Run script at the end of the build?
    – user55335
    Dec 26, 2013 at 21:46
1

Jasonwryan gave you what is probably the best solution. If you reall want to change the default home page (not simply start with a specific page, but change what page the Home button loads), you will need to edit your user's config file.

For firefox, the preferences are stored in

$HOME/.mozilla/firefox/RANDOM_STRING.default/prefs.js

The RANDOM_STRING is different for each user profile. The default home page is saved as:

user_pref("browser.startup.homepage", "http://foobar.com");

So, to change the homepage to foo.com from the command line you could do:

sed -i.bak '
 s#\(\"browser\.startup\.homepage\", \"\)http:.*"#\1http://foo.com\"#
' $HOME/.mozilla/firefox/*.default/prefs.js
1
  • This won't work in chrome.
    – Braiam
    Jun 13, 2014 at 15:52
1

Although a bit late, I've found a solution to the full-screen problem.

Apparently chrome as an option called --kiosk which starts it in full screen. You'd have to pass it the webpage you want rather than using --app though.

0
0

I just created this soloution for that Problem

FFPROFILEFOLDER=`find ~/Library/Application\ Support/Firefox/Profiles/*.default -maxdepth 0` && echo 'pref("browser.startup.homepage", "http://foobar.org");' > "$FFPROFILEFOLDER"/user.js
  1. It uses Find to determine the Profile Folder and puts that in a Variable called FFPROFILEFOLDER
  2. It uses echo to crate the user.js Folder and Places the Configuration in it Firefox nneds for setting the homepage.

It has the advantage that you can run it in Terminal, and if you want use it in a Script you get a Variable you can use further. The downside is it works only if the user only have one Profile in his Profiles Folder. (if you want to make that run you will have to make an array to process the multiple found paths correctly)

It was created and testet in OSX 10.6 but it should work in every Linux Distribution i think.

1
  • Thanks, though where would I put this code? Run script whenever the appliance boots or Run script at the end of the build?
    – user55335
    Mar 5, 2014 at 7:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .