How to create shortcuts in linux

How to create desktop shortcut or launcher on Linux

If you have a program you use regularly on Linux desktop, you may want to create a desktop shortcut, so you can launch the program by simply clicking on the shortcut. While most GUI programs automatically create their desktop shortcut during installation, GUI programs built from their source or terminal applications may require you to set up associated shortcuts manually.

In this tutorial, I will describe how to create a desktop shortcut or launcher in various Linux desktop environments.

A desktop shortcut is represented by a corresponding .desktop file which contains meta information of a given app (e.g., name of the app, launch command, location of icon file, etc.). Desktop shortcut files are placed in /usr/share/applications or ~/.local/share/applications . The former directory stores desktop shortcuts that are available for every user, while the latter folder contains shortcuts created for a particular user only.

Create a Desktop Shortcut From the Command Line

To manually create a desktop shortcut for a particular program or command, you can create a .desktop file using any text editor, and place it in either /usr/share/applications or ~/.local/share/applications . A typical .desktop file looks like the following.

[Desktop Entry] Encoding=UTF-8 Version=1.0 # version of an app. Name[en_US]=yEd # name of an app. GenericName=GUI Port Scanner # longer name of an app. Exec=java -jar /opt/yed-3.11.1/yed.jar # command used to launch an app. Terminal=false # whether an app requires to be run in a terminal. Icon[en_US]=/opt/yed-3.11.1/icons/yicon32.png # location of icon file. Type=Application # type. Categories=Application;Network;Security; # categories in which this app should be listed. Comment[en_US]=yEd Graph Editor # comment which appears as a tooltip.

Besides manually create .desktop file, there are various desktop-specific ways to create an application shortcut, which I am going to cover in the rest of the tutorial.

Create a Desktop Shortcut on GNOME Desktop

In GNOME desktop, you can use gnome-desktop-item-edit to configure a desktop shortcut easily.

$ gnome-desktop-item-edit ~/.local/share/applications --create-new

In this example, gnome-desktop-item-edit will automatically create a desktop launcher file in ~/.local/share/applications . To customize icon location and other info, you may have to edit the .desktop file manually afterward.

If gnome-desktop-item-edit is not available (e.g., on Ubuntu), you can install it as follows.

$ sudo apt-get install --no-install-recommends gnome-panel

Create a Desktop Shortcut on KDE Desktop

kickoff is the default application launcher in KDE desktop. Adding a new application shortcut to kickoff is straightforward.

First, right-click on kickoff icon located at the left bottom corner of your desktop, and then choose Edit Applications menu.

Click on an appropriate category (e.g., Utilities ) under which you want to create a shortcut, and click on New Item button on the top. Type in the name of the app.

Читайте также:  Linux find sort by name

Finally, fill in the meta information of the app being launched by the shortcut.

Create a Desktop Shortcut on Xfce Desktop

If you are on Xfce desktop, right-click on the desktop background, and then select Create Launcher menu. Then fill out the details of the shortcut.

Create a Desktop Shortcut on Cinnamon Desktop

If you are on Linux Mint Cinnamon desktop, you can create an application launcher by right-clicking on the desktop background, and selecting Create Launcher menu.

Create a Desktop Shortcut on LXDE Desktop

On LXDE desktop, simply right click on the desktop background, and choose Create New Shortcut .

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Источник

How to Create Shortcuts in Linux: A Beginner’s Guide

Linux is a powerful operating system used by millions of people worldwide. It is renowned for its flexibility, customizability, and vast features, making it the go-to choice for developers and power users.

One of the most valuable features is to create shortcuts in Linux, which can help you save time and boost your productivity.

Table of Contents

Shortcuts are a simple and effective way to access frequently used files, folders, or applications on your Linux system. Instead of typing out long and complicated commands, you can create a shortcut that points to a specific file or folder and execute it with just a few keystrokes. This can save you time and make your workflow more efficient.

Creating shortcuts in Linux is relatively easy, and there are several ways to do it. Depending on your level of expertise and the specific task you want to accomplish, you can use the command line or a graphical user interface (GUI) tool to create shortcuts. In this tutorial, we will cover both methods, so you can choose the one that works best for you.

In this tutorial, we will walk you through the steps to create shortcuts in Linux using the command line and GUI methods. We will start with a brief overview of shortcuts and why they are useful, followed by a step-by-step guide on creating them using different tools and techniques. Whether a beginner or an experienced Linux user, this tutorial will help you master the art of creating shortcuts and take your productivity to the next level.

So, without further ado, let’s dive into the world of Linux shortcuts and explore the various ways to create them.

How to create Shortcuts in Linux

For this tutorial, create a folder named ‘Ryan’ under your home directory. Suppose Ryan is a regular user and has basic computer knowledge on creating and saving documents, you’d want to create a shortcut to his folder on your desktop for him to navigate easily.

How to Create Proxy Server

Are you curious about how a proxy server works? Proxy servers useful to control and monitor internet traffic in your network. In this article, we will provide a step-by-step guide on how to create proxy server on Linux – Squid.

Читайте также:  Install minecraft forge server linux

Open up your terminal, assuming Ryan’s situation, the below command would create shortcut or a symbolic link to his folder on your desktop:

create symbolic link in linux

create shortcut icon in linux

After executing that command you will notice a new folder icon on your desktop that looks like a shortcut.

How To Migrate WordPress Manually To New Host

Any website migration is regarded as one of the most difficult operations. Fortunately, WordPress provides a plethora of backup plugins to help and automate the entire backup and migration process. However, WordPress is constructed in such a way that manually migrate WordPress could not be simpler.

Let’s assume that in your case you wish to create a shortcut to your Document directory on your Linux desktop. Similar to that above command, you’d have done it this way:

You can also create a shortcut to almost any type of file. Try creating one yourself for audio files, custom applications, word documents, etc.

A lil’ tad bit advanced

What if you wish to create a symbolic link to a file or folder that is stored in another partition? There is a way I can show you how to achieve that. Mount the appropriate partition in /mnt or /media during computer startup, by editing the /etc/fstab file. Then create a symbolic link to the required folder or file on your home directory.

create shortcut in linux advanced method

​Below is a screenshot of an edited fstab file that mounts my “work partition” to /media/hub on computer starts up.

Technical detail

ln is a command, succeeding it -s is the argument that tells ln to create a symbolic (or soft) link. The tilde symbol and forward slash ~/ is used to indicate the given program to start navigating from the user’s root directory (home directory).

An advantage

There is an advantage when using this symbolic link and that is… ahem, you can create a symbolic link to a directory that exists in another partition. So in the event your Linux partition fails, you can rest assured that your documents, stored and linked from, in another partition stay intact. That’s how I take measure to keep my important directories and files safe, and easy to recover.

What about GNOME?

Picture

GNOME is a very unique desktop environment that keeps its design goals on “simplicity”. So there is no such thing as “desktop icons” on GNOME, only free workspace. Creating a symbolic link on its Desktop directory is possible but expect no shortcut icon at all. I recommend creating links on your home directory and navigating it using a file manager program which is efficient.

Conclusion

Do not create symbolic links to removable storage media like your USB or portable hard disk. It’s impractical (with broken links lying around your desktop or home directory) though there’s no danger in that. Have a great alternative idea on how to create shortcuts on Linux desktop? Please share your thoughts in the comment section below. ​

Источник

How to create a desktop shortcut [duplicate]

PIC RELATED

Can somebody please explain to me how to create a desktop shortcut to an application like Chrome or Blender as if I’m an idiot? I really don’t get it. I have the gnome panel program thing and can run it (see image) but after that I’m lost.

Читайте также:  Linux set permission to all files

Here’s my preferred method, with a detailed example using the Arduino IDE v1.8.5: askubuntu.com/a/1014261/327339

No headache solution: «it simple: just press Ctrl + Shift and drag.» (the folder to the desktop area) , thanks goes here: askubuntu.com/a/691976/277898

3 Answers 3

You have to install gnome-panel package which comes up with ability to create a application launcher on the desktop or wherever you like. Add —no-install-recommends suffix to prevent other package that aren’t necessary.

sudo apt-get install --no-install-recommends gnome-panel 

After installing gnome-panel , use following command to create a launcher.

gnome-desktop-item-edit --create-new ~/Desktop 

Once you execute the above command, create launcher application will be opened.

enter image description here

  • In Type field «Application» will be a default value. If you’re creating launcher for application which has no gui, that runs in terminal like VIM editor then you need to select «Application in Terminal».
  • In Name field type application name.
  • In Command field type the executable command which open your application.
  • Comment field is optional.

To set icon, click on the small box on the top left side near name field and choose a image for it. Click «OK» if you are done.

Note the language localization: on spanish Ubuntu v16.04 you must use gnome-desktop-item-edit —create-new ~/Escritorio or the command will fail.

This will no longer work for Ubuntu 20.04. When I try this I get the following error: gnome-desktop-item-edit: command not found

It appears that gnome-desktop-item-edit was removed from gnome-panel in 19.10: askubuntu.com/a/1184737/457041

Complete instructions can be found in the answers to this question. Here’s the really simple version:

  1. Launch Nautilus (the file manager).
  2. In Nautilus, click on Computer .
  3. From there, navigate to /usr/share/applications .
  4. Find the icon of the program you want a shortcut for, click on it, and type Ctrl+C to copy.
  5. In Nautilus, click on Desktop in the left pane.
  6. Type Ctrl+V to copy the shortcut to the desktop.
  7. Right-click your new shortcut, click Properties , click on the Permissions tab, and make sure that the Allow executing file as program box is ticked.
  8. X out of the Properties dialog and also out of Nautilus. Enjoy your new desktop shortcut!

Edit: @DanDascalescu is right, this method just copies the executable rather than creating a shortcut. Please don’t use this method. Sorry folks!

This doesn’t create a shortcut, this copies the executable to ~/Desktop. How does this answer have so many upvotes?

@DanDascalescu, NO, this does not copy an executable. If you look at the file properties, you will see it says — «Desktop configuration file». If you open it with a text editor, you will see that it is a typical shortcut.

To create a launcher on the Desktop:

1) You need gksu so if you don’t have it yet, run in terminal:

2) Run gedit (or any other text editor) and then enter the info below:

#!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Type=Application Terminal=false Icon[en_US]=/opt/lampp/htdocs/favicon.ico Name[en_US]=XAMPP Exec=gksu /opt/lampp/manager-linux-x64.run Comment[en_US]=Start XAMPP Control Panel Name=XAMPP Comment=Start XAMPP Control Panel Icon=/opt/lampp/htdocs/favicon.ico Save the file on your Desktop as Xampp.desktop 

3) Once the shortcut is on the Desktop, right-click on it, go to Properties, Permissions tab, and check ‘Allow executing file as program’

The above creates a shortcut for XAMPP control panel.

Источник

Оцените статью
Adblock
detector