Skip to content

Instantly share code, notes, and snippets.

@pferreir
Forked from henriquemoody/sublime-text-2.sh
Last active December 15, 2015 21:29
Show Gist options
  • Save pferreir/5325928 to your computer and use it in GitHub Desktop.
Save pferreir/5325928 to your computer and use it in GitHub Desktop.
#!/bin/sh
SHORTCUT="[Desktop Entry]
Name=Sublime Text 3
Comment=Edit text files
Exec=/usr/local/sublime-text-3/sublime_text
Icon=/usr/local/sublime-text-3/Icon/128x128/sublime-text.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;"
SCRIPT="#!/bin/sh
if [ \${1} == \"--help\" ]; then
/usr/local/sublime-text-3/sublime_text --help
else
/usr/local/sublime-text-3/sublime_text \$@ > /dev/null 2>&1 &
fi"
curl -L $1 -o "/usr/src/Sublime Text 3.tar.bz2"
cd /usr/src
tar -xvjf "Sublime Text 3.tar.bz2"
cd "sublime_text_3"
mkdir -pv "/usr/local/sublime-text-3"
mv -fv * "/usr/local/sublime-text-3/"
echo "${SCRIPT}" > "/usr/local/bin/subl3"
chmod +x "/usr/local/bin/subl3"
echo "${SHORTCUT}" > "/usr/share/applications/sublime-text-3.desktop"
echo "Finish!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment