I have a doubt about how many .desktop
files can be placed in the .config/autostart/
folder or, overall in Linux, how many .desktop
files can be created.
2 Answers
There is no formal limitation on the number of .desktop files you can have in .config/autostart
or in the menu system. For sure, you can put there much, much more files than you ever can come up with before performance noticeable would be impacted. For practical purposes, there is no limitation.
The FreeDesktop.org specifications that define these folders do not list any limit on the number of files in such a folder. As far as I can tell from a quick look at the source code for various desktop environments that I know implement these standards, they also impose no limits.
This in turn means that any hard limit is imposed by the filesystem itself. Most filesystems will allow at least millions of entries per directory (ZFS for example allows roughly 256 trillion entries per directory). However, as a general rule, you will start seeing performance issues somewhere around ten thousand entries in a single directory (irrespective of what filesystem you’re using, because this ends up being an issue of the application trying to process all that data).
.config/autostart
for services that you want to run on a server, since they generally will only be started when a user logs in, and by a desktop environment at that. For services that you want to start on boot, use systemd services.