diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2013-04-08 22:35:39 +0200 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2013-04-08 22:35:39 +0200 |
commit | 156ba2ae4dc06350325ead467af14a8312b6ba5e (patch) | |
tree | a051d333125a8cadfec8322a289d9688ff61ff54 | |
parent | e50a2994e940801b9fec846f4166e149c4c3169e (diff) | |
download | dotfiles-156ba2ae4dc06350325ead467af14a8312b6ba5e.tar.gz dotfiles-156ba2ae4dc06350325ead467af14a8312b6ba5e.tar.xz dotfiles-156ba2ae4dc06350325ead467af14a8312b6ba5e.zip |
Firefox settings: tune up init script
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r-- | scripts/firstrun/10-firefox | 49 | ||||
-rw-r--r-- | scripts/firstrun/10-firefox/.pentadactylrc-firstrun (renamed from .pentadactylrc-firstrun) | 0 | ||||
-rw-r--r-- | scripts/firstrun/10-firefox/main | 130 |
3 files changed, 130 insertions, 49 deletions
diff --git a/scripts/firstrun/10-firefox b/scripts/firstrun/10-firefox deleted file mode 100644 index 27acbe0..0000000 --- a/scripts/firstrun/10-firefox +++ /dev/null @@ -1,49 +0,0 @@ -WGET="wget -N" -DELETE=0 - -# plugins - -plugins+=" 59" # *** User Agent Switcher -plugins+=" 722" # *** NoScript -plugins+=" 748" # *** Greasemonkey -plugins+=" 1027" # **** All-in-One Sidebar -plugins+=" 1368" # **** ColorfulTabs -plugins+=" 1843" # **** Firebug -plugins+=" 1865" # *** Adblock Plus -plugins+=" 3880" # **** Add Bookmark Here -plugins+=" 6366" # ***** FireGestures -plugins+=" 7765" # ? IdentFavIcon -plugins+=" 9609" # ** Ghostery -plugins+=" 13784" # **** Open Bookmarks in New Tab -plugins+=" 71411" # ** Tile Tabs -#plugins+=" 184566" # ***** Tree Style Tab -plugins+=" 193270" # ? Print Edit -> http://piro.sakura.ne.jp/xul/xpi/treestyletab.xpi -#plugins+=" 235854" # ***** Pentadactyl -> http://5digits.org/nightly/pentadactyl-latest.xpi -plugins+=" 318228" # **** Super Start - -plugins_extra+=" http://5digits.org/nightly/pentadactyl-latest.xpi" -plugins_extra+=" http://piro.sakura.ne.jp/xul/xpi/treestyletab.xpi" -plugins_extra+=" https://addons.mozilla.org/firefox/downloads/file/164485/remove_google_search_redirects-0.5-fx.xpi" - -for plugin in $plugins; do - ${WGET} "https://addons.mozilla.org/firefox/downloads/latest/${plugin}/addon-${plugin}-latest.xpi" - firefox "addon-${plugin}-latest.xpi" & -done - -for plugin in $plugins_extra; do - ${WGET} "${plugin}" - firefox "$(echo "${plugin}" | sed 's|.*/\([^/]\+\)|\1|')" & -done - -# searches - -#searches+=" 161972" # *** DuckDuckGo (HTTPS / SSL) -# -#for search in $searches; do -# ${WGET} "https://addons.mozilla.org/firefox/downloads/latest/${plugin}/addon-${plugin}-latest.xml" -#done - -[ "${DELETE}" -ne 0 ] && rm -I *.xpi || read -p "Press any key to continue " x - -sleep 2 -[ -f ~/.pentadactylrc-firstrun ] && firefox -pentadactyl "++cmd 'source ~/.pentadactylrc-firstrun'" diff --git a/.pentadactylrc-firstrun b/scripts/firstrun/10-firefox/.pentadactylrc-firstrun index 94cd262..94cd262 100644 --- a/.pentadactylrc-firstrun +++ b/scripts/firstrun/10-firefox/.pentadactylrc-firstrun diff --git a/scripts/firstrun/10-firefox/main b/scripts/firstrun/10-firefox/main new file mode 100644 index 0000000..fcd2f07 --- /dev/null +++ b/scripts/firstrun/10-firefox/main @@ -0,0 +1,130 @@ +# TODO: move .pentadactyrc-firstrun to script-local dir + +WGET="wget -N" +DELETE=0 + +# plugins + +plugins+=" 59" # *** User Agent Switcher +plugins+=" 722" # *** NoScript +plugins+=" 748" # *** Greasemonkey +plugins+=" 1027" # **** All-in-One Sidebar +plugins+=" 1368" # **** ColorfulTabs +plugins+=" 1843" # **** Firebug +plugins+=" 1865" # *** Adblock Plus +plugins+=" 3880" # **** Add Bookmark Here +plugins+=" 6366" # ***** FireGestures +plugins+=" 7765" # ? IdentFavIcon +plugins+=" 9609" # ** Ghostery +plugins+=" 13784" # **** Open Bookmarks in New Tab +plugins+=" 71411" # ** Tile Tabs +#plugins+=" 184566" # ***** Tree Style Tab +plugins+=" 193270" # ? Print Edit -> http://piro.sakura.ne.jp/xul/xpi/treestyletab.xpi +#plugins+=" 235854" # ***** Pentadactyl -> http://5digits.org/nightly/pentadactyl-latest.xpi +plugins+=" 318228" # **** Super Start + +plugins_extra+=" http://5digits.org/nightly/pentadactyl-latest.xpi" +plugins_extra+=" http://piro.sakura.ne.jp/xul/xpi/treestyletab.xpi" +plugins_extra+=" https://addons.mozilla.org/firefox/downloads/file/164485/remove_google_search_redirects-0.5-fx.xpi" + +searches+=" 161972" # **** DuckDuckGo (HTTPS / SSL) + +if ( test ! -d "${HOME}/.mozilla" || test ! -d "${HOME}/.mozilla/firefox" ); then + mkdir -p "${HOME}/.mozilla/firefox" + touch -- "${HOME}/.mozilla/firefox/profiles.ini" +fi + +while read -p "Enter name of the profile: " profile; do + test ! -d "${HOME}/.mozilla/firefox/${profile}" && break + echo "Exists: ${HOME}/.mozilla/firefox/${profile}" +done + +touch -- "${HOME}/.mozilla/firefox/profiles.ini" +PROFILE="${HOME}/.mozilla/firefox/${profile}" +FIREFOX="firefox -P ${profile}" +mkdir "${PROFILE}" +echo created "${PROFILE}" + +( python | sed 's| = |=|' > "${HOME}/.mozilla/firefox/profiles.ini" ) <<-EOF + from sys import stdout + from ConfigParser import RawConfigParser as RCP + cp = RCP() + cp.optionxform = str + f = open('${HOME}/.mozilla/firefox/profiles.ini', 'r') + cp.readfp(f) + if not cp.has_section('General'): + cp.add_section('General') + cp.set('General', 'StartWithLastProfile', '1') + new_sec = 'Profile' + str(len(cp.sections()) - 1) + cp.add_section(new_sec) + cp.set(new_sec, 'Name', '${profile}') + cp.set(new_sec, 'IsRelative', '1') + cp.set(new_sec, 'Path', '${profile}') + cp.write(stdout) +EOF + +echo "Please set security.dialog_enable_delay to zero (highly recommended)" +${FIREFOX} about:config + +for plugin in $plugins; do + ${WGET} "https://addons.mozilla.org/firefox/downloads/latest/${plugin}/addon-${plugin}-latest.xpi" + ${FIREFOX} "addon-${plugin}-latest.xpi" & +done + +for plugin in $plugins_extra; do + ${WGET} "${plugin}" + ${FIREFOX} "$(echo "${plugin}" | sed 's|.*/\([^/]\+\)|\1|')" & +done + +SEARCHPLUGINS="${PROFILE}/searchplugins" +mkdir "${SEARCHPLUGINS}" +for search in $searches; do + ${WGET} -P "${SEARCHPLUGINS}" "https://addons.mozilla.org/firefox/downloads/latest/${plugin}/addon-${plugin}-latest.xml" +done +cat > "${PROFILE}/search-metadata.json" <<-EOF + { + "[app]/duckduckgo.xml": { + "alias": "ddg", + "order": 1 + }, + "[app]/google.xml": { + "alias": "g", + "order": 2 + }, + "[app]/wikipedia.xml": { + "alias": "we", + "order": 3 + }, + "[app]/amazondotcom.xml": { + "alias": null, + "hidden": true, + "order": 4 + }, + "[app]/bing.xml": { + "alias": null, + "hidden": true, + "order": 5 + }, + "[app]/eBay.xml": { + "alias": null, + "hidden": true, + "order": 6 + }, + "[app]/twitter.xml": { + "alias": null, + "hidden": true, + "order": 7 + }, + "[app]/yahoo.xml": { + "alias": null, + "hidden": true, + "order": 8 + } + } +EOF + +[ "${DELETE}" -ne 0 ] && rm -I *.xpi || read -p "Press any key to continue " x + +[ -f ~/.pentadactylrc-firstrun ] \ + && sleep 2 \ + && ${FIREFOX} -pentadactyl "++cmd 'source .pentadactylrc-firstrun'" |