home · contact · privacy
Improve Firefox/Tridactyl setup.
[config] / buster / setup_scripts / setup_eeepc.sh
1 #!/usr/bin/w
2 set -e
3
4 if [ "$#" -ne 1 ]; then
5     echo 'Need exactly one argument (hostname).'
6     false
7 fi
8 hostname="$1"
9
10 # Set up system without user environment.
11 config_tree_prefix="${HOME}/config/buster"
12 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
13 cd "${setup_scripts_dir}"
14 ./setup.sh "${hostname}" ""
15 ./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" eeepc
16 ./install_for_target.sh eeepc
17
18 # Install Firefox directly from Mozilla.
19 url_firefox="https://ftp.mozilla.org/pub/firefox/releases/66.0/linux-x86_64/en-US/firefox-66.0.tar.bz2"
20 wget "${url_firefox}"
21 mv firefox-66.0.tar.bz2 /opt/
22 cd /opt/
23 tar xf firefox-66.0.tar.bz2
24 rm firefox-66.0.tar.bz2
25 ln -s /opt/firefox/firefox /usr/local/bin/
26 update-alternatives --install /usr/bin/x-www-browser x-www-browser /opt/firefox/firefox 200
27 update-alternatives --set x-www-browser /opt/firefox/firefox
28
29 # Install Firefox plugins.
30 # See <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Distribution_options/Sideloading_add-ons>
31 extensions_dir="/usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/"
32 mkdir -p "${extensions_dir}"
33 noscript_xpi="noscript-10.6.xpi"
34 url_noscript="https://secure.informaction.com/download/releases/${noscript_xpi}"
35 wget "${url_noscript}"
36 name=$(unzip -p "${noscript_xpi}" manifest.json | jq -r .applications.gecko.id)
37 mv "${noscript_xpi}" "${name}.xpi"
38 tridactyl_xpi="tridactyl-1.14.9pre2457-an+fx.xpi"
39 url_tridactyl="https://tridactyl.cmcaine.co.uk/betas/${tridactyl_xpi}"
40 wget "${url_tridactyl}"
41 name=$(unzip -p "${tridactyl_xpi}" manifest.json | jq -r .applications.gecko.id)
42 mv "${tridactyl_xpi}" "${name}.xpi"
43 mv *.xpi "${extensions_dir}"
44
45 # Set up user environments.
46 cd "${setup_scripts_dir}"
47 ./copy_dirtree.sh "${config_tree_prefix}/home_files" "/root" minimal root
48 if [ ! -d "/home/plom" ]; then
49     adduser --disabled-password --gecos "" plom
50     usermod -a -G sudo plom
51     su -c "cd && git clone https://plomlompom.com/repos/clone/config" plom
52     su -c "~/config/buster/setup_scripts/copy_dirtree.sh ~/config/buster/home_files ~ minimal user_eeepc" plom
53     su -c "curl -fsSl https://raw.githubusercontent.com/tridactyl/tridactyl/78e662efefd1f4af2bdb2a53edecf03b535b997b/native/install.sh | bash" plom
54     passwd plom
55     echo "As tridactyl user, don't forget to do :source on the first Firefox run and then re-start."
56 fi