Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to configure firefox from terminal?For example if i want to set toolkit.networkmanager.disable=true in about:config can i do it from terminal?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

This setting should go into your Firefox profile prefs.js file, which should be located in ~/.mozilla/firefox/*something*.default/.

The file format is JavaScript, so in theory it could be mangled to the point of needing a JS parser to modify it, but Firefox is usually nice and prints each setting on its own line in alphabetical order. To add a setting like this you could simply

echo 'user_pref("toolkit.networkmanager.disable", true);' >> ~/.mozilla/firefox/**replace**.default/prefs.js

If this setting is already in the file, I'm not sure whether Firefox will register the last or first instance. Just give it a try. If it's not consistent, you could do this:

if grep 'toolkit.networkmanager.disable' ~/.mozilla/firefox/*.default/prefs.js
then
    sed -i -e 's/^user_pref("toolkit.networkmanager.disable", \(true\|false\));$/user_pref("toolkit.networkmanager.disable", true);/' ~/.mozilla/firefox/*.default/prefs.js
else
    echo 'user_pref("toolkit.networkmanager.disable", true);' >> ~/.mozilla/firefox/*.default/prefs.js
fi
share|improve this answer
    
You've ninja'd me and I'm even happy you did as your answer is even better. +1 –  Octavian Damiean Mar 30 '11 at 8:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.