I write a application with cmake
how to show the image when I start my application.
Like google, picture, …
This probably involves a .desktop
file. You’ll need to package one properly with your application for this to work; CMake doesn’t do anything with these icons on Linux.
Do you have the sample for all process.
ParaView’s .desktop
file is here. The CMake code to handle installation is here. The spec has more fields that may be of interest.
It is so great. Thanks
I only see it put the .desktop into “${CMAKE_INSTALL_DATAROOTDIR}/applications”
And then nothing to do. Does the project have the special command to implement the .desktop
###############################
Here I found.
But I meet the problem that the command is not work.
If it work, I expect the 123.desktop will write to ~/.local/share/applications/123.desktop
sudo xdg-desktop-menu install --novendor --mode system /usr/share/applications/123.desktop
or
sudo xdg-desktop-menu install --novendor --mode user /usr/share/applications/123.desktop
Here is the successful command without sudo.
And it will write 123.desktop to ~/.local/share/applications/123.desktop.
But there is not the 123.desktop on ~/.local/share/applications/ for the other user
xdg-desktop-menu install --novendor /usr/share/applications/123.desktop
If you’re installing for multiple users, you can install to the system location. If you want it to be user-local, each user will need to install the application themselves.