Forked from simonewebdesign/install_sublime_text.sh
Last active
August 10, 2024 22:29
-
-
Save grenade/3b3c5b17586881d01142 to your computer and use it in GitHub Desktop.
this script is based on another for Sublime Text (http://www.simonewebdesign.it/install-sublime-text-3-on-linux/). It will handle updates (detects the latest developer or nightly edition) and locale (using your $LANG environment variable) (only tested on a 64 bit, fedora system, feedback welcome).
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
#!/bin/sh | |
# Firefox Developer Edition install | |
# No need to download this script, just run it on your terminal: | |
# $ curl -L git.io/firefoxdev | sh | |
# When you need to update Firefox Developer Edition, run this script again. | |
START_CMD="firefox-dev" | |
INSTALLATION_DIR="/opt/${START_CMD}" | |
# Detect the locale | |
LOCALE=$(echo ${LANG/_/-} | cut -d. -f1) | |
# Download the tarball, unpack and install | |
URL="https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=${LOCALE}" | |
curl -L -o ${HOME}/${START_CMD}.tar.bz2 $URL | |
if tar -xf ${HOME}/${START_CMD}.tar.bz2 --directory=${HOME}; then | |
# Create an application launcher file based on the regular firefox launcher | |
cat /usr/share/applications/firefox.desktop | sed -r 's/Name=Firefox/Name=Firefox Developer Edition/g' | sed -r "s/Exec=firefox %u/Exec=${START_CMD} %u/g" | sed -r "s/Icon=firefox/Icon=$(echo ${INSTALLATION_DIR} | sed -r 's/\//\\\//g')\/browser\/chrome\/icons\/default\/default128.png/g" > ${HOME}/firefox/firefox.desktop | |
# Remove the installation folder and the symlink, they might already exist | |
sudo rm -rf ${INSTALLATION_DIR} /bin/${START_CMD} | |
sudo mv ${HOME}/firefox ${INSTALLATION_DIR} | |
sudo ln -s ${INSTALLATION_DIR}/firefox /bin/${START_CMD} | |
fi | |
rm ${HOME}/${START_CMD}.tar.bz2 | |
# Add to applications list | |
sudo ln -sf ${INSTALLATION_DIR}/firefox.desktop /usr/share/applications/${START_CMD}.desktop | |
echo "" | |
echo "Firefox Developer Edition installed." | |
echo "Run with: ${START_CMD}" |
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
#!/bin/sh | |
# Firefox Nightly Edition install | |
# No need to download this script, just run it on your terminal: | |
# $ curl -L git.io/firefoxnightly | sh | |
# When you need to update Firefox Nightly Edition, run this script again. | |
START_CMD="firefox-nightly" | |
INSTALLATION_DIR="/opt/${START_CMD}" | |
# Detect the locale | |
LOCALE=$(echo ${LANG/_/-} | cut -d. -f1) | |
# Download the tarball, unpack and install | |
URL="https://download.mozilla.org/?product=firefox-nightly-latest-ssl&os=linux64&lang=${LOCALE}" | |
curl -L -o ${HOME}/${START_CMD}.tar.bz2 $URL | |
if tar -xf ${HOME}/${START_CMD}.tar.bz2 --directory=${HOME}; then | |
# Create an application launcher file based on the regular firefox launcher | |
cat /usr/share/applications/firefox.desktop | sed -r 's/Name=Firefox/Name=Firefox Nightly Edition/g' | sed -r "s/Exec=firefox %u/Exec=${START_CMD} %u/g" | sed -r "s/Icon=firefox/Icon=$(echo ${INSTALLATION_DIR} | sed -r 's/\//\\\//g')\/browser\/chrome\/icons\/default\/default128.png/g" > ${HOME}/firefox/firefox.desktop | |
# Remove the installation folder and the symlink, they might already exist | |
sudo rm -rf ${INSTALLATION_DIR} /bin/${START_CMD} | |
sudo mv ${HOME}/firefox ${INSTALLATION_DIR} | |
sudo ln -s ${INSTALLATION_DIR}/firefox /bin/${START_CMD} | |
fi | |
rm ${HOME}/${START_CMD}.tar.bz2 | |
# Add to applications list | |
sudo ln -sf ${INSTALLATION_DIR}/firefox.desktop /usr/share/applications/${START_CMD}.desktop | |
echo "" | |
echo "Firefox Nightly Edition installed." | |
echo "Run with: ${START_CMD}" |
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
#!/bin/sh | |
# golang install (last update: Thursday 31 May 2018) | |
# No need to download this script, just run it on your terminal: | |
# curl -L https://gist.github.com/grenade/3b3c5b17586881d01142/raw/update_golang.sh | sh | |
OS="linux" | |
INSTALL_DIR_PARENT="/usr/local" | |
if [[ "$(uname -m)" = "x86_64" ]]; then | |
ARCHITECTURE="amd64" | |
else | |
ARCHITECTURE="386" | |
fi | |
# todo: obtain latest checksum and validate download | |
VERSION="$(echo $(curl -s https://golang.org/dl/) | sed -rn "s#.*<a class=\"download downloadBox\" href=\"https:\/\/dl\.google\.com\/go\/go([0-9\.]+)\.${OS}-${ARCHITECTURE}\.tar\.gz\">.*#\1#p")" | |
ARCHIVE="go${VERSION}.${OS}-${ARCHITECTURE}.tar.gz" | |
INSTALL_DIR="${INSTALL_DIR_PARENT}/go${VERSION}.${OS}-${ARCHITECTURE}" | |
rm -f ${HOME}/Downloads/${ARCHIVE} | |
curl -o ${HOME}/Downloads/${ARCHIVE} https://dl.google.com/go/${ARCHIVE} | |
sudo rm -rf ${INSTALL_DIR} | |
sudo mkdir -p ${INSTALL_DIR} | |
if sudo tar -C ${INSTALL_DIR} -xzf ${HOME}/Downloads/${ARCHIVE}; then | |
sudo rm -rf /usr/local/go | |
sudo ln -sf ${INSTALL_DIR}/go /usr/local/go | |
rm -f ${HOME}/Downloads/${ARCHIVE} | |
fi | |
echo "" | |
echo "go ${VERSION} installed." |
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
#!/bin/sh | |
# Skype install | |
# No need to download this script, just run it on your terminal: | |
# $ curl -L https://gist.githubusercontent.com/grenade/3b3c5b17586881d01142/raw/update_skype.sh | sh | |
# When you need to update Skype, run this script again. | |
START_CMD="skype" | |
INSTALLATION_DIR="/opt/skype" | |
URL="http://www.skype.com/go/getskype-linux-beta-dynamic" | |
# Download the tarball, unpack and install | |
curl -L -o $HOME/$START_CMD.tar.bz2 $URL | |
if tar -xf $HOME/$START_CMD.tar.bz2 --directory=$HOME; then | |
# Remove the installation folder and the symlink, they might already exist | |
sudo rm -rf $INSTALLATION_DIR /bin/$START_CMD | |
sudo mv $HOME/skype-* $INSTALLATION_DIR | |
sudo ln -s $INSTALLATION_DIR/skype /bin/$START_CMD | |
fi | |
rm $HOME/$START_CMD.tar.bz2 | |
# Add to applications list | |
for i in 16 32 48 64 128; do sudo cp $INSTALLATION_DIR/icons/SkypeBlue_${i}x${i}.png /usr/share/icons/hicolor/${i}x$i/apps/$START_CMD.png; done | |
sudo ln -s $INSTALLATION_DIR/skype.desktop /usr/share/applications/$START_CMD.desktop | |
# Install dependencies | |
sudo dnf install -y libX11.i686 libv4l.i686 alsa-plugins-pulseaudio.i686 qt-x11.i686 libXScrnSaver.i686 libXv-1.0.10-2.fc22.i686 qtwebkit-2.3.4-6.fc22.i686 | |
echo "" | |
echo "Skype installed successfully!" | |
echo "Run with: $START_CMD" |
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
#!/bin/sh | |
# Sublime Text 3 Install (last update: Monday 8 April 2019) | |
# No need to download this script, just run it on your terminal: | |
# curl -sL https://gist.github.com/grenade/3b3c5b17586881d01142/raw/update_sublime_text_3.sh | sh | |
# Detect the architecture | |
if [[ "$(uname -m)" = "x86_64" ]]; then | |
ARCHITECTURE="x64" | |
else | |
ARCHITECTURE="x32" | |
fi | |
# Fetch the latest build version number (thanks daveol) | |
BUILD=$(echo $(curl -s http://www.sublimetext.com/3) | sed -rn "s#.*<p class=\"latest\"><i>Version:<\/i> Build ([0-9]+)..*#\1#p") | |
echo "detected available release: ${BUILD}" | |
URL="https://download.sublimetext.com/sublime_text_3_build_${BUILD}_${ARCHITECTURE}.tar.bz2" | |
if [ -L /usr/local/bin/subl ] && [ -e /usr/local/bin/subl ]; then | |
EXISTING_INSTALLATION_DIR=$(dirname $(readlink /usr/local/bin/subl)) | |
echo "detected previous install at: ${EXISTING_INSTALLATION_DIR}" | |
INSTALLATION_DIR=$(dirname ${EXISTING_INSTALLATION_DIR})/sublime_text_${BUILD} | |
else | |
INSTALLATION_DIR="/opt/sublime_text_${BUILD}" | |
fi | |
echo "install dir set to: ${INSTALLATION_DIR}" | |
# Download the tarball, unpack and install | |
if curl -o ${HOME}/st3.tar.bz2 ${URL}; then | |
echo | |
echo "downloaded: ${HOME}/st3.tar.bz2 from: ${URL}" | |
rm -rf ${HOME}/sublime_text_3 | |
if tar -xf ${HOME}/st3.tar.bz2 --directory=${HOME}; then | |
if [ -d "${INSTALLATION_DIR}" ] && sudo rm -rf ${INSTALLATION_DIR}; then | |
echo "deleted: ${INSTALLATION_DIR}" | |
fi | |
sudo mv ${HOME}/sublime_text_3 ${INSTALLATION_DIR} | |
sudo rm -f /opt/sublime_text | |
sudo ln -sf ${INSTALLATION_DIR} /opt/sublime_text | |
sudo ln -sf ${INSTALLATION_DIR}/sublime_text /usr/local/bin/subl | |
# Add to applications list | |
if sed -i -e 's/Icon=sublime-text/Icon=\/opt\/sublime_text\/Icon\/256x256\/sublime-text.png/g' ${INSTALLATION_DIR}/sublime_text.desktop; then | |
echo "icon path set in: ${INSTALLATION_DIR}/sublime_text.desktop" | |
fi | |
if sudo ln -sf ${INSTALLATION_DIR}/sublime_text.desktop /usr/share/applications/sublime_text.desktop; then | |
echo "symlink: /usr/share/applications/sublime_text.desktop created with target: ${INSTALLATION_DIR}/sublime_text.desktop" | |
fi | |
echo | |
echo "sublime text 3 installation complete." | |
echo "run with: subl" | |
else | |
echo "failed to extract: ${HOME}/st3.tar.bz2 to: ${HOME}" | |
fi | |
if rm ${HOME}/st3.tar.bz2; then | |
echo "deleted: ${HOME}/st3.tar.bz2" | |
else | |
echo "failed to delete: ${HOME}/st3.tar.bz2" | |
fi | |
else | |
echo "failed to download: ${HOME}/st3.tar.bz2 from: ${URL}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i wasn't. thank you for pointing that out @RichieMcG. corrected now.