Last active
March 6, 2019 16:04
-
-
Save dccampbell/6a39880c9196048ef5eadf14b64fc06c to your computer and use it in GitHub Desktop.
Install Firefox Developer Edition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e -x | |
# Variables | |
INSTALL_DIR="/opt/firefox-dev" | |
TEMP_FILE="$HOME/Downloads/firefox-dev.tar.bz2" | |
MENU_FILE="$HOME/.local/share/applications/firefox-dev.desktop" | |
BIN_DIR="$HOME/bin" | |
# Prepare | |
[[ -f "$INSTALL_DIR/firefox" ]] && mv -f "$INSTALL_DIR" "$INSTALL_DIR.bkp" | |
mkdir -p "$INSTALL_DIR" | |
# Download | |
wget "https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=en-US" -qO "$TEMP_FILE" | |
# Extract | |
tar -C "$INSTALL_DIR" -xf "$TEMP_FILE" --strip-components=1 | |
# Link | |
ln -fs "$INSTALL_DIR/firefox" "$BIN_DIR/firefox-dev" | |
# Shortcut | |
tee $MENU_FILE >/dev/null << EOF | |
[Desktop Entry] | |
Name=Firefox Developer | |
GenericName=Web Browser | |
Comment=Browse the World Wide Web | |
Keywords=Internet;WWW;Browser;Web;Explorer | |
Exec=${INSTALL_DIR}/firefox %u | |
Terminal=false | |
Icon=${INSTALL_DIR}/browser/chrome/icons/default/default64.png | |
Type=Application | |
Categories=Network;WebBrowser; | |
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall; | |
StartupNotify=true | |
Actions=new-window;new-private-window; | |
[Desktop Action new-window] | |
Name=Open a New Window | |
Exec=firefox -new-window | |
[Desktop Action new-private-window] | |
Name=Open a New Private Window | |
Exec=firefox -private-window | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment