Ubuntu – Desktop shortcut for terminal command

desktopgnome-terminalshortcuts

I was wondering how to make a clickable terminal shortcut for my desktop using the command easytether connect.

I don't want to have to open/close the terminal every time I wish to connect to the Internet through my phone.

I've tried updating my gnome-panel but I can only make a new directory on my desktop.

Best Answer

Right click the desktop and create an empty file (or use gedit) named easytether.desktop. Paste this into this file:

[Desktop Entry]
Name=Easytether
Exec=easytether connect
Terminal=true
Type=Application

and save! You will then need to make the file executable, by editing the properties of the file, or running: chmod +x easytether.desktop.

  • The Name=Easytether line specifies the name of the shortcut that will appear to the user.

  • The Exec=easytether connect line specifies the command to be run, in this case, easytether connect.

  • The Terminal=true line specifies that the command should be run in GNOME Terminal, so that the user can inspect its output. You can later set this to false if you don't want the shortcut to open a Terminal window. For instance, if you made a shortcut to the "sound" panel of the "settings" and want it to only open that (the command would be "gnome-control-center sound").

  • You can even add a line Icon=path/to/png/ (or Icon=iconname and put your iconname.png in ~.local/share/icons) in order to add a custom icon to your launcher.

Also, you can put the easytether.desktop file into ~/.local/share/applications and start it from Dash or other app-launcher (Synapse, Kickoff, Slingshot etc).