Last active
October 24, 2017 18:21
-
-
Save ajohnclark/756c7be5fde329853ddcd6b90a54a8b3 to your computer and use it in GitHub Desktop.
sublime text 3 fedora 26 build_3143
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 | |
SHORTCUT="[Desktop Entry] | |
Name=Sublime Text 3 | |
Comment=Edit text files | |
Exec=/opt/subl3/sublime_text | |
Icon=/opt/subl3/Icon/128x128/sublime-text.png | |
Terminal=false | |
Type=Application | |
Encoding=UTF-8 | |
Categories=Utility;TextEditor;" | |
SCRIPT="#!/bin/sh | |
if [ \${1} == \"--help\" ]; then | |
/opt/subl3/sublime_text --help | |
else | |
/opt/subl3/sublime_text \$@ & | |
fi" | |
MIME="[Default Applications] | |
text/plain=sublime-text-3.desktop;" | |
# latest version as of 8/18/17 | |
curl -L "https://download.sublimetext.com/sublime_text_3_build_3143_x64.tar.bz2" -o "/opt/Sublime Text 3.tar.bz2" | |
cd /opt | |
tar -xvjf "Sublime Text 3.tar.bz2" | |
mv -fv "sublime_text_3" "subl3" | |
echo "${SCRIPT}" > "/usr/local/bin/subl" | |
chmod +x "/usr/local/bin/subl" | |
echo "${SHORTCUT}" > "/usr/share/applications/sublime-text-3.desktop" | |
rm -f "Sublime Text 3.tar.bz2" | |
# add to 'open with' + make default [untested may break this] | |
cd ~/.local/share/applications/ | |
/bin/cp /usr/share/applications/sublime-text-3.desktop ~/.local/share/applications/ | |
echo "${MIME}" > ~/.local/share/applications/mimeapps.list | |
echo "DONE!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment