Skip to content

Instantly share code, notes, and snippets.

@mavuriel
Last active June 7, 2024 17:46
Show Gist options
  • Select an option

  • Save mavuriel/3087f7ed5ace9785d0967e7965f8e460 to your computer and use it in GitHub Desktop.

Select an option

Save mavuriel/3087f7ed5ace9785d0967e7965f8e460 to your computer and use it in GitHub Desktop.
Script to install Firefox Developer Edition
#!/bin/bash
echo -e "\n === Firefox Developer Setup ==="
FFXNAME="firefox"
FFXTARNAME="${FFXNAME}.tar.bz2"
echo -e "\n === Downloading latest firefox in current directory ${PWD} ==="
wget "https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=en-US" -O ${FFXTARNAME}
if ! [ -f ${FFXTARNAME} ] ; then
echo -e "\n ----- Something went wrong while downloading firefox -----"
exit 1
fi
echo -e "\n === Unpacking tar file ==="
sudo tar xjfv ${FFXTARNAME} -C /opt/
echo -e "\n === Removing tar file from ${PWD} ==="
sudo rm -rf ${FFXTARNAME}
OPTPATH="/opt/${FFXNAME}"
echo -e "\n === Changing ownership to ${USER} in ${OPTPATH} ==="
sudo chown -R $USER $OPTPATH
echo -e "\n === Add path to shell file ${SHELL} ==="
if [ "${SHELL}" = "/bin/bash" ] ; then
echo -e "\n == Adding path to .bashrc =="
echo "export PATH=/opt/firefox/firefox:\$PATH" >> ~/.bashrc
elif [ "${SHELL}" = "/usr/bin/zsh" ] ; then
echo -e "\n == Adding path to .zshrc =="
echo "export PATH=/opt/firefox/firefox:\$PATH" >> ~/.zshrc
else
echo -e "\n ===== No configuration for $SHELL add this to your shell file ====="
echo "export PATH=/opt/firefox/firefox:\$PATH"
fi
echo -e "\n === Adding desktop entry ==="
DESKPATH=~/.local/share/applications/firefoxDeveloperEdition.desktop
echo -e "\n Copying desktop data to ${DESKPATH}"
cat > $DESKPATH <<EOL
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Firefox Developer Edition
StartupWMClass="Firefox Developer Edition"
GenericName=Web Browser
Exec=${OPTPATH}/firefox
Terminal=false
Icon=${OPTPATH}/browser/chrome/icons/default/default128.png
Type=Application
Categories=Network;WebBrowser;Favorites;
StartupNotify=true
Keywords=web;browser;internet;
Actions=new-window;new-private-window;
StartupWMClass=Firefox Developer Edition
MimeType=text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;
X-Ayatana-Desktop-Shortcuts=NewWindow;NewIncognito
[Desktop Action new-window]
Name=New Window
Exec=${OPTPATH}/firefox --new-window
[Desktop Action new-private-window]
Name=New Private Window
Exec=${OPTPATH}/firefox --private[Desktop Entry]
EOL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment