Skip to content

Instantly share code, notes, and snippets.

@welshstew
Created December 9, 2016 21:10
Show Gist options
  • Save welshstew/4839921475fe85bd8fdd8b7343333f5c to your computer and use it in GitHub Desktop.
Save welshstew/4839921475fe85bd8fdd8b7343333f5c to your computer and use it in GitHub Desktop.
sublime text 3 install
#!/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 "http://c758482.r82.cf2.rackcdn.com/sublime_text_3_build_3083_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!"
@f3rn4s
Copy link

f3rn4s commented Apr 8, 2017

Can you help me plz? I am a noob and i can t install sublime coz i can t find to help me with it. I m using fedora 25

Copy link

ghost commented Apr 28, 2017

@f3rn4s Hi, you can download this .sh file and execute it. It should work out of the box for fedora 25 :)

Now with that said, if you want the latest sublime text 3 build, you need to edit line # 18 into https://download.sublimetext.com/sublime_text_3_build_3126_x64.tar.bz2

Next you will need to update also line #6 to Icon=/usr/local/sublime-text-3/Icon/128x128/sublime-text.png... (we just changed the underscore to a hyphen)

Your sh file should look like this:

#!/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 "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!"

That should work :)... If you're wondering how to execute a .sh file, you just need to execute this: sudo sh sublime-install.sh

@marcoslanzoni
Copy link

For Fedora 25, in line 21, should be:

cd "sublime_text_3"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment