30

I have some command line applications (and remote servers) that I want to make individual launchers for on the Unity launcher, how do I do that?

0

3 Answers 3

30

Custom launchers for terminal applications can be used, which can be very useful for applications such as irssi and mutt.

The thing to remember is that you’ll want to specify a different window manager class for the terminal using the --class argument, otherwise after you start your application via the Launcher, it will show up with all your other terminals and you can’t use a superkey keyboard shortcut with it.

For example, to create a launcher to login to another server, you can use something like the following for a .desktop file (see above for how to get this into the Launcher):

[Desktop Entry]
Version=1.0
Name=My Server
Comment=Login to my server
Exec=gnome-terminal --disable-factory --sm-client-disable --class=MyServer -x ssh -t myserver.example.com
StartupWMClass=MyServer
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=utilities-terminal
StartupNotify=true

After you've created this .desktop file (you can name it something like myserver.desktop) you can just drag and drop it onto your launcher.

Adapted from:

Here's an example of how I made it for my personal servers at home:

[Desktop Entry]
Version=1.0
Name=Remote Servers
Comment=Login to my servers
Exec=gnome-terminal --disable-factory --sm-client-disable --class=remoteserver
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=utilities-terminal
StartupNotify=true
StartupWMClass=RemoteServers
X-Ayatana-Desktop-Shortcuts=Server1;Server2;Server3;

[Server1 Shortcut Group]
Name=SSH into bondigas.local
Exec=gnome-terminal --disable-factory --sm-client-disable  --class=remoteserver -x ssh -t bondigas.local
TargetEnvironment=Unity

[Server2 Shortcut Group]
Name=SSH into xbmc.local
Exec=gnome-terminal --disable-factory --sm-client-disable --class=remoteserver -x ssh -t xbmc.local
TargetEnvironment=Unity

[Server3 Shortcut Group]
Name=SSH into miggytop.local
Exec=gnome-terminal --disable-factory --sm-client-disable --class=remoteserver -x ssh -t miggytop.local
TargetEnvironment=Unity

Which ends up with this:

enter image description here

5
  • 1
    +1 for this: "The thing to remember is that you’ll want to specify a different window manager class for the terminal using the --class argument..."
    – jahroy
    Apr 22, 2014 at 22:46
  • --disable-factory is no longer supported in 3.14.1
    – sergiusens
    Nov 20, 2014 at 12:02
  • After locking to Launcher right click on the icon.
    – km1
    Jun 16, 2015 at 16:06
  • 1
    The solution does no longer works in Ubuntu 15.10 and above, options were removed sadly.
    – Fih
    Sep 1, 2016 at 14:28
  • @Fih they are still documented but do not work. Debian bug #238145, Launchpad bug #1453991.
    – Tgr
    Sep 8, 2016 at 16:49
1

I right click on the desktop, click "create launcher", fill in the appropriate file fields, then drag the created launcher onto the dock.

1
  • Doesn't work in 11.10. There is no "Create Launcher" option.
    – Timmmm
    Dec 13, 2011 at 21:02
1

The file stored in usr/share/applications/blender.desktop could be:

[Desktop Entry]
Name=Blender_terminal
Comment=Blender_terminal
Exec=gnome-terminal -x sh -c "cd /home/user/Software/blender_270a &&./blender"
Icon=/home/user/Software/blender_270a/icons/48x48/apps/blender.png
Terminal=false
Type=Application
X-Ayatana-Desktop-Shortcuts=Blender1;Blender2;

[Blender1 Shortcut Group]
Name=Blender
Exec=/home/user/Software/blender_270a/blender
TargetEnvironment=Unity

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .