About Ubuntu Shortcut Launcher
Most apps (snap or from package) will automatically install a shortcut launcher, but not all. The following will be a description how to do manually. I use as example the launcher for MATLAB. Shortcut launcer files are the ones with the ‘.desktop’ extension.
- Where to store? Find the right location:
In case of difficulties to the find applications path use the ‘find’ command. but not all in the local path will find all paths with “applications” in the name, but not necessary with the *.desktop extension, but will give an overview:
$ find /usr/ ~ -name applications /usr/local/MATLAB/R2023a/sys/java/jre/glnxa64/jre/lib/desktop/applications /usr/local/MATLAB/R2023a/toolbox/shared/spcuilib/applications /usr/local/share/applications /usr/share/ubuntu-wayland/applications /usr/share/gdm/greeter/applications /usr/share/applications /usr/share/doc/lm-sensors/applications /usr/share/ubuntu/applications /.local/share/applications
I will use the .local one (the last from the findings), from the home folder:
/.local/share/applications
- Download a better, enhanced MATLAB Icon and store it in a folder:
- Get icons with transparaency (need an account wiht mathworks.com):
- My (synchronized) folder is:
./TGONet_Virtual/Bilder/Icons/
- Locate MATLAB with ‘which’ command:
$ which matlab /usr/local/bin/matlab
- With all this informations, create the following .desktop file in the local storage via terminal from home directory:
nano ./.local/share/applications/matlab.desktop
- Copy this snippet into the new file and save:
Version = 1.5 Type = Application Name = MATLAB GenericName = numeric computing environment Comment = Version R2023a # Icon location: /home/tgohle/TGONet_Virtual/Bilder/Icons/ Icon = /home/tgohle/TGONet_Virtual/Bilder/Icons/matlabicon_256.png Categories = Development;Math;Science; Terminal = false Exec = matlab -r clc -desktop StartupNotify = true
Open Questions, not solved yet
- ‘StartupWMClass‘ in .desktop files. Is there a need for? Actual (2023-05-29) I’m not using it. For MATLAB additional Line in .desktop according to some examples would be:
StartupWMClass=com-mathworks-util-PostVMInit
- Register MATLAB *.m files. However, StartupWMClass does not help to register *.m files. So how to connect matlab script files, extension *.m with the MATLAB example? Searching shows sereveral issues, with different solutions and ideas for XOrg, Wayland. Start with right path should be:
matlab -desktop -r "open %U;"
Sources and Links