Customize an Ubuntu Launcher Icon

Just a little tip for those Ubuntu users who may be looking to customize the launcher presentation of a particular application. If you right click on the application icon while it’s open and choose “Lock to Launcher” a configuration file is created in the /home/user/.local/share/applications directory, but sometimes the default icon is borked because the application is non-standard or is in a non-standard location or has been moved. But you can easily customize the settings by editing the .desktop file. For instance:


#! /home/mike/.local/share/applications/code.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=VSCode
Icon=/home/mike/vscode/resources/app/resources/linux/vscode.png
Path=/home/mike/vscode
Exec=/home/mike/vscode/Code
StartupNotify=false
StartupWMClass=Code
OnlyShowIn=Unity;
X-UnityGenerated=true