On Arch, the system-wide shortcuts are stored in /usr/share/applications. Each one is a .desktop file with a few parameters. user-specific icons are stored in ~/.local/share/applications. I downloaded eclipse and extracted it in my home directory, so I'll use eclipse as the example application.

  1. Create the .desktop file

    nano ~/.local/share/applications/Eclipse.desktop
    

    Paste this in:

    [Desktop Entry] 
    Encoding=UTF-8 
    Version=1.0 
    Type=Application 
    NoDisplay=false 
    Exec=/path/to/eclipse/eclipse 
    Name=Eclipse Comment=Launcher for Eclipse
    

    Each line is pretty self-explanatory. Edit to suit your needs. As soon as you save the file, you will be able to see your new shortcut in the list.

  2. (Optional) Give the shortcut a nice-looking icon: You probably noticed that your icon is an ugly diamond. To pretty it up, you simply have to add one more line to the desktop file.

    Icon=/path/to/eclipse/eclipse.svg
    

    Your application may have included a png icon, but to make it really look nice, you should grab an SVG file of the logo from somewhere. Arch has a very simple packaging process which lets you examine all of the package building elements through their webpage at http://www.archlinux.org/packages/. I was able to grab the SVG which the package uses like this:

    wget -O eclipse.svg http://projects.archlinux.org/svntogit/packages.git/plain/trunk/eclipse.svg\?h\=packages/eclipse
    

Comments

comments powered by Disqus