How to add shortcut/starter (to file, program. or folder) in the desktop or menu bar of Ubuntu 18.04?

11,329

Solution 1

The reality is that you are looking for a workflow that is not anymore supported in Gnome Shell, and to a limited extend by Ubuntu Desktop.

Desktop icons

Gnome Shell does not support desktop icons by default. The rationale is, and to some extend they are right, that that desktop, and thus the icons, is covered by windows more often than not. Fact is that a desktop can be quickly crowded with icons, icons you can't see most of the time. Still, you are free not to like that argument, and prefer icons on your desktop.

Shortcuts to files

Gnome Shell limits the use of shortcuts (.desktop files) to applications in your menuing system and on your dock. They took manipulation of these files out of the hand of the user: .desktop files typically they are installed through software installation and are placed in specific locations, hidden from the user (~/.local/share/applications, /usr/share/applications, ...). Gnome does not anymore come with a graphical tool to create .desktop files yourself.

How does Gnome want you to work

The 6 - 8 applications you commonly use are on the Ubuntu Dock (or the Gnome Shell Dash), and are one click away (two in pure Gnome Shell). Applications you use frequently, end up on the "Frequent" tab in the Application view. They are 2 clicks away. Alternatively, search the applications.

For documents you work with frequently, Gnome developers invented the "Starred" feature. Star your files you use for the moment, and you will find them in the Starred category in File manager. Alternatively, search the files. Obviously, you can also create links ("symbolic links") in a specific place for quick access.

Creating a launcher to a document

You cannot anymore easily create launchers all over the place. That does not mean you cannot create a launcher to a document, but, in Gnome Shell, it is handwork. Create a .desktop file.

gedit myfile.desktop

Add the information to launch:

[Desktop Entry]
Name=Document name
Exec=xdg-open <path-to-your-file>
Terminal=false
Icon=<location of icon file>
Type=Application
Comment=Comment which appears as a tooltip.

Move the .desktop file to ~/.local/share/applications. It will now appear in your applications overview, from where you can pin it to the dash.

Consider a desktop that fits your preferred workflow better

In reality, the better approach is to move to another desktop environment if you are a user that values the somewhat more classical approach of working with shortcuts and launchers on the desktop. Most other desktops (Mate, xfce, KDE...) still fully adhere to that paradigm so in these desktop environments, you will not need to fight to adopt the workflow you prefer.

So this should not only answer how to create the launchers, but also answer why it is all very hidden indeed.

Solution 2

Technically not directly answering the actual question, but still highly related. I find it very useful -- and since I actually asked the question I guess I must know that both questions are highly related. :)

Just install alacarte, which is an extremely simple to use tool to define new starters. Once you defined it that way it's also listed in the search menu, which allows you to add it to the favorites with one click. (Though not to the desktop, but still!)

sudo apt-get install alacarte

If you like this, please like How to add programs to the Unity Launcher or Ubuntu Dock?, since this is where I got it from.

Share:
11,329

Related videos on Youtube

Prof.Chaos
Author by

Prof.Chaos

Updated on September 18, 2022

Comments

  • Prof.Chaos
    Prof.Chaos over 1 year

    For some super-extremely strange reason the menu entry "create shortcut" "got lost" (well, when switching from one Ubuntu version to antoher, so it"s not a bug, it"s just a design error). Whereas previously (I think I used Ubunut 18.04 MATE) I was able to place both shortcuts to any "program" and file (e.g., open xxx.ods using libre) as a shortcut/symbol into the top-most menu bar and desktop, now all of this seems to have disappeared (I think the "standard" Ubuntu, which I have now used, is/uses GNOME?).

    There two bars: the top bar can hardly be configured (in particular: no shortcuts can be placed as far is I know) and the left one can, so it seems, only have shortcuts to programs, but not to files.

    So, two questions:

    (1) How can place shortcuts to files (like "run programX with inputY") to the desktop or (preferred) to any of the two bars?

    (2) wtf? It seems extremely (I cannot stress this enough!) essential to have shortcuts to files to allow efficient working (after all, Linux users are hardly computer-playing kids, they are professionals I suppose), so how in the world can this feature be missing or be that extremely well hidden?? The only thing seeming more obsurde would be to remove the botton for shutting down the computer. Seriously: wtf? I can not understand this at all. :) How is that possible?? (Although I essetially just need question (1) solved I'm really interested in (2), too as it seems too ridiculous.)

    • Prof.Chaos
      Prof.Chaos over 4 years
      A partial answer to (1) -- showing how to add a desktop icon -- is given on a website (linuxconfig.org/…) introducing a tool, which allows, after being installed, to place a certain command (not an ICON!), which THEN allows to do what I want (but only for the deskop, not for the menu). And it also does not explain how to get a shortcut to a folder. Funnily, some users there also complain about the absurdity of this severe disign flaw.
    • vanadium
      vanadium over 4 years
      Please ask one specific question each time. Feel free to open additional questions on different topics.
  • vanadium
    vanadium over 4 years
    WIth respect to (1.1): a shortcut is not a link. A shortcut is a .desktop file.