I need suggestions. Currently fogger creates .desktop files for fogapps and puts them in ~/.local/share/applications so that they can be launched from dash or legacy app menus. Everything works as expected but these application shortcuts remain lying around after fogger is removed by the user thus cluttering the applications lens with useless entries. I've a couple of solutions in mind.
Ship fogger with a postremoval script which finds all fogapp .desktop files for every user and removes or disables them (Hidded attribute) and a preinstall script which again finds already present apps and enables thems. This should be straight forward but I'm not sure if it is considered a sane practice for deb files to mess with users' home directories.
Second solution is to keep all the .desktop files hidden by default and ship fogger with a special lens for launching fogapps. The draw back here is that fogapps will not be shown in legacy menus or launchers other than dash like synapse. Also, only 2 days are left to implement this and fix/improve/add other features.
I don't know what fogger or a fogapp is, but there are some things you possibly should or shouldn't do:
The scripts in a debian package should not do anything to user-specific files. If the user decides to simply uninstall, and re-install, to try and solve some problem, this "solution" would result in all of those fogapps they had, no longer being accessible.
You can add TryExec to the desktop files, which the system will check for and hide the launcher from view, if the app is not installed.
How are these "fogapps" started exactly? If you tell me, I can update the answer to provide an example.
It's a very bad idea to have a postremoval modify user homes:
I'd install a small clean up script in the user's home the first time he creates a fogapp .desktop file. You may even offer an option to only remove those files created on the current system.