On Wed, 2017-03-22 at 18:47 +0100, Olaf Hering wrote:
My silly grep over 10k .spec files gives this list of directories where *.desktop files are stored. Who is the consumer of .desktop files and why are there some many different places to store them?
The question seems trivial - but is not
And: Is a simple "%_datadir/applications" not good enough for most of them? It would be so easy. And compatible.
the 'main' location for .desktop files shown by the various desktops is indeed /usr/share/applications (aka %_datadir/applications)
560 %_datadir/applications
So this is the most common way
224 /opt/kde3/share/applications/kde 140 /opt/kde3/share/services Legacy stuff - KDE3: let's just ignore this and forget this exists :)
171 %_kf5_applicationsdir 122 %_kde4_servicesdir 105 %_kf5_servicesdir
The KDE Team, in the spirit of how KDE3 was handled, basically kept their set of macros; kf5_applicationsdir is /usr/share/applications. The idea there was an easy 'move' to /opt should this ever be needed
63 %yast_desktopdir 58 %_kde4_applicationsdir 55 %_sysconfdir/xdg/autostart
Same fileformat to be stored, different meaning - but you know that anyway. XDG compliant DEs will auto-start all .desktop files in there that are matching either the OnlyShowIn= or not maching the NotShowIn= entries
30 %_kf5_servicetypesdir 29 %_datadir/xfce4/panel/plugins 28 /opt/kde3/share/servicetypes 28 /opt/kde3/share/services/kaddressbook 25 %_datadir/xsessions
the various entries you see in sddm/gdm/lightdm (not xdm though)
22 %_kde4_servicesdir/kded 13 /usr/share/applications
Somebody forgot to use the macros
13 %_kf5_configdir/autostart 11 %_datadir/mimelnk/application 8 %_kf5_sharedir/%name/extras/multimedia 7 %_kde4_servicesdir/ServiceMenus 7 %_datadir/applications/kde4 6 %desktopdir 6 %_kde4_servicetypes 6 %_datadir/xfce4/panel-plugins 5 %_kde4_servicetypesdir 5 %_datadir/kde4/services 5 %_datadir/autostart 4 %_libdir/gnome-settings-daemon-3.0/gtk-modules 4 %_kde4_appsdir/solid/actions 4 %_datadir/solid/actions 4 %_datadir/kservices5 3 %buildroot/%_datadir/applications
Those are very likely a bug
3 %_libdir/%name/share/applications 3 %_datadir/xgreeters 3 %_datadir/system-config-selinux 3 %_datadir/kde4/services/ServiceMenus 2 /usr/share/autoinstall/modules 2 %_prefix/share/applications/YaST2 2 %_kf5_servicesdir/ServiceMenus 2 %_kde4_servicesdir/phononbackends 2 %_kde4_appsdir/kwin 2 %_kde4_appsdir/konqueror/dirtree/remote 2 %_jvmdir/%sdkdir/jre/lib/desktop 2 %_datadir/wayland-sessions 2 %_datadir/kservices5/ServiceMenus 2 %_datadir/kde4/services/phononbackends 2 %_datadir/gnome/wm-properties 2 %_datadir/gnome/autostart 2 %_datadir/gdm/greeter/applications 2 %_datadir/applications/YaST2 1 Swift/resources 1 /usr/share/xsessions 1 /etc/xdg/autostart 1 %yast_desktopdir/groups 1 %kdeprefix/share/applications 1 %gnome_prefix/share/applications 1 %gnome_prefix/share/application-registry 1 %gnome_datadir/applications 1 %_kf5_sharedir/xsessions 1 %_kf5_sharedir/locale/* 1 %_kf5_sharedir/akonadi/agents 1 %_kf5_sharedir/%name/extras/system 1 %_kf5_servicesdir/kded 1 %_kde4_servicesdir/qimageioplugins 1 %_kde4_appsdir/remoteview 1 %_kde4_appsdir/konqsidebartng/virtual_folders/services 1 %_datadir/tracker/miners 1 %_datadir/susehelp/meta 1 %_datadir/services/kded 1 %_datadir/remoteview 1 %_datadir/konqsidebartng/virtual_folders/services 1 %_datadir/kdm/sessions 1 %_datadir/kde4/apps/ksmserver/windowmanagers 1 %_datadir/gdm/autostart/LoginWindow 1 %_datadir/applications/kde 1 %_datadir/appdata
erm - here should be NO desktop files - this is definitively wrong
1 %_datadir/akonadi/agents 1 %_datadir/Thunar/sendto
Most of the things are fine - KDE just uses their own set of macros; a
few things are indeed bugs. Please file those as such so they can be
verified / fixed.
Cheers
Dominique
--
Dimstar / Dominique Leuenberger