Add a custom menu item in Ubuntu

mononz
2 min readApr 29, 2018
“A young man working on a laptop while seated on a ledge in a city during sunset” by Avi Richards on Unsplash

Some software can be annoying to install on Linux systems like Ubuntu. A menu entry is generally created when software is installed via the ‘Software Center’ or apt-get install methods. When installing Linux software shipped as a .run file we can create our own launcher.

If you have already installed your software, skip the next paragraph. I’ll use Teamspeak3 to demonstrate installing from a .run file and creating a custom launcher for your desktop or start menu.

Download

Teamspeak3 is a commonly used voice communication application for gamers. Jump over to https://www.teamspeak.com/en/downloads and grab the latest Linux client. You’ll get file labelled something like teamspeak.run

Personally I like to have a folder in my user home directory called ‘Software’. I feel it is easier to maintain a single directory of manually installed software; especially when new updates are required.

Install a .run by setting as an executable then execute it

$ chmod a+x teamspeak.run
$ ./teamspeak.run

After which you can run the program using terminal and sh

$ sh /teamspeak/ts3client_runscript.sh

Assuming the software is working as expected, we can go on and create our Ubuntu desktop entry.

Custom Launcher

To add the program to your main menu, we need to create a .desktop file in ~/usr/local/share/applications

Using terminal run

sudo gedit /usr/local/share/applications/Teamspeak.desktop

and paste in the following into gedit. (Substitute with your program values accordingly)

[Desktop Entry]
Encoding=UTF-8
Exec=~/Software/teamspeak/ts3client_runscript.sh
Name=Teamspeak3
GenericName=Teamspeak
Type=Application
Terminal=false
StartupNotify=false
Type=Application
Icon=~/Software/teamspeak/icon.png
Categories=Game

Common category values include: AudioVideo, Development, Education, Game, Graphics, Network, Office, Settings, System, Utility

Heads up, I downloaded my own icon for the desktop entry and placed it in the installed folder.

Mark the teamspeak.desktop file as executable using the terminal command (Might not be necessary)

$ chmod +x /usr/local/share/applications/Teamspeak.desktop

Restart your system and you should find a your program added to your main menu in the category you defined.

Reference: https://wiki.lxde.org/en/Main_Menu

--

--

mononz

Primarily a native mobile app developer. Currently building https://apialerts.com and chasing dreams