A PCRE internal error occured. This might be caused by a faulty plugin
====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tricks:application-icon [2015/08/25 01:03] admin [Download/Extract the Application] |
tricks:application-icon [2016/02/16 17:43] (current) admin [References] |
||
---|---|---|---|
Line 12: | Line 12: | ||
Then right click on the downloaded .tar.bz2 archive and and select "extract here"... | Then right click on the downloaded .tar.bz2 archive and and select "extract here"... | ||
- | ===== | + | === Move to /opt and change access rights === |
+ | It is of use, in the Linux environment, to put "extra" software in the /opt directory. To do this, you'll need to have admin rights: | ||
+ | <code> | ||
+ | > cd ~/Downloads | ||
+ | > mv "Sublime Text 2" sublime | ||
+ | > sudo mv sublime /opt | ||
+ | > cd /opt | ||
+ | > sudo chown -R root:root sublime | ||
+ | > sudo chmod -R +r sublime | ||
+ | </code> | ||
+ | |||
+ | |||
+ | In some cases, the extracted directories won't bare the correct "x" (execute) options (i.e.: -rwx------). Using the above sudo chmod -R +r will only add the "read" flag for anyone but wont let group or others "open" the directories (x). As we do NOT want to change all files "x" option, but only directories, we'll use the next command: | ||
+ | <code> | ||
+ | > sudo find /opt/sublime -type d -exec chmod 755 {} + | ||
+ | </code> | ||
+ | |||
+ | And to set execution rights correctly on files: | ||
+ | <code> | ||
+ | > sudo find /opt/sublime/ -type f -perm 744 -exec chmod +x {} + | ||
+ | </code> | ||
+ | ===== Create Executable in /usr Path ===== | ||
+ | |||
+ | <code> | ||
+ | > sudo nano /usr/bin/sublime_text | ||
+ | |||
+ | Paste: | ||
+ | #!/bin/sh | ||
+ | export SUBLIME_HOME="/opt/sublime" | ||
+ | $SUBLIME_HOME/sublime_text "$*" | ||
+ | |||
+ | Save the file (Ctrl+x - y) | ||
+ | |||
+ | > sudo chmod 775 /usr/bin/sublime_text | ||
+ | </code> | ||
+ | |||
+ | ===== Create a Menu Icon ===== | ||
+ | |||
+ | <code> | ||
+ | > sudo nano /usr/share/applications/sublime.desktop | ||
+ | |||
+ | Paste: | ||
+ | [Desktop Entry] | ||
+ | Encoding=UTF-8 | ||
+ | Name=Sublime Text | ||
+ | Comment=Sublime Text 2 | ||
+ | Exec=sublime_text | ||
+ | Icon=/opt/sublime/Icon/256x256/sublime_text.png | ||
+ | Terminal=false | ||
+ | Type=Application | ||
+ | Categories=GNOME;GTK;Utility;TextEditor; | ||
+ | StartupNotify=true | ||
+ | |||
+ | Save the file (Ctrl+x - y) | ||
+ | </code> | ||
+ | |||
+ | You should now find the Sublime Text icon in **Menu > Accessories > Sublime Text** | ||
+ | |||
+ | Alternatively if you'd like to only have the icon available for a certain user, create the .desktop file in: **~/.local/share/applications** | ||
+ | |||
+ | ==== References ==== | ||
+ | |||
+ | For all details regarding the options that can be used in the .desktop file, refer to [[https://specifications.freedesktop.org/desktop-entry-spec/latest/index.html|these references]]. | ||
+ | |||
+ | For a list of categories, refer to the [[http://standards.freedesktop.org/menu-spec/latest/apa.html|freedesktop.org Registered Categories list]] as well as the [[http://standards.freedesktop.org/menu-spec/latest/apas02.html|additional categories]]. |