1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
# 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
sleep 2 \
&& ${FIREFOX} -pentadactyl "++cmd 'source pentadactylrc-firstrun' +c 'mkvimruntime'"
# HTML5 for youtube
#${FIREFOX} http://userscripts.org/scripts/source/105433.user.js
${FIREFOX} https://youtube.com/html5
|