Skip to content

Instantly share code, notes, and snippets.

@scottharwell
Forked from dkd903/Install_Sublime_Text_3_64.sh
Last active December 28, 2016 01:53
Show Gist options
  • Save scottharwell/665d8259912f4d205c80b17ee23d9d87 to your computer and use it in GitHub Desktop.
Save scottharwell/665d8259912f4d205c80b17ee23d9d87 to your computer and use it in GitHub Desktop.
Install Sublime Text 3 editor on Fedora Linux & Red Hat Linux - 64 Bit Edition. More at: http://digitizor.com/?p=15885
# This script is an enhancement of Debjit Saha's helpful original.
# https://gist.github.com/dkd903/8ba3f51313c1781cc571
# This script works with Fedora 25 and prints a prettier error when no file
# is provided.
#!/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;Programming;"
SCRIPT="#!/bin/sh
if [ \$# -eq 0 ]
then
echo \"No arguments supplied\"
elif [ \${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 "https://download.sublimetext.com/sublime_text_3_build_3126_x64.tar.bz2" -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/subl"
chmod +x "/usr/local/bin/subl"
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