8

I've downloaded Sublime Text for Linux (32bit) and put it in /opt, linked it in /usr/bin and currently I can start it by typing sublime_text in console. Whenever I start it its icon appears in the Shell's Dock but I can't pin it, and it doesn't appear in the Applications menu either.

How do I add it?

5

The shortest way:

  1. Press Super to activate overview.
  2. Type main menu and hit Enter
  3. Add new item, where the command is sublime_text.
  4. Voila, you have your shortcut.
| improve this answer | |
  • 2. "Hauptmenü" oder "Menü" auf Deutsch oder "alacarte" (Programmname) – PythoNic Mar 20 '14 at 13:18
  • 1
    This does not work on Gnome Shell, Ubuntu 18.04 LTS. Is this for Unity, or are some packages missing ? – smido Apr 17 '19 at 19:18
5

I installed Sublime Text 3 from Webupd8 PPA, and the .desktop file was already created.

But I was still not able to pin the icon to Gnome Shell dock when the app is launched.

For those who are in the same situation, you can pin it from the dashboard search directly, without launching it.

Just open the dashboard with the Super key, search for Sublime, right click on the icon, then select Add to Favorites.

| improve this answer | |
  • Tried all the aforementioned steps for the most recent sublime upgrade a few days a go and still having trouble with saving to favourites – racemic Sep 17 '17 at 8:46
  • @lxm7 Too bad :( Unfortunately, I can't help more since I'm not using Linux anymore :/ – ByScripts Sep 17 '17 at 12:12
4

You have several options to make this happen. The crux of it is that in order for an app to be usable by GNOME Shell, it needs to have a corresponding .desktop file in either /usr/share/applications or ~/.local/usr/share/applications.

Either:

  • Use alacarte (the old GNOME menu editor) to add a new menu item
  • Use the command gnome-desktop-item-edit ~/.local/usr/share/applications/sublime-text.desktop, which will pop a dialog asking for the information required for the shortcut, the same as alacarte does
  • Add a file into one of those directories yourself, using the same format as other .desktop files

The layout for a desktop file is of the form:

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_GB]=gnome-panel-launcher
Name[en_GB]=Sublime Text 2
Exec=sublime-text
Comment[en_GB]=Sublime Text 2
Name=Sublime Text 2
Comment=Sublime Text 2
Icon=gnome-panel-launcher
| improve this answer | |
  • 1
    ~/.local/usr/share/... - the subdirectory usr/ seems to be wrong. For me it works for ~/.local/share/... – PythoNic Mar 20 '14 at 13:31
1

I've just resolved this issue just playing around a little bit.

In my case I believe I've downloaded Sublime from their website. It downloaded a folder with all the program and it already came with a sublime_text.desktop.

When I looked at their properties, i went to the Permission tab (2nd one, my ubuntu is in Spanish "Permisos") and checked the last option that says something like "Allow to execute this file as a program".

As soon as i checked that and close the properties, the icon changed to the Sublime one, dissapeared the ".desktop" from the name, and I could execute the program with that file, which I can keep in the dock.

Hope it helps to someone.

PD: sorry for my bad english :P

| improve this answer | |
0

This is no longer an issue since ST has linux repositories and integrates itself in the desktop environment natively.

Just follow the instructions:

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt install apt-transport-https 
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt update && sudo apt install sublime-text
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.