Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
Also note that apps submitted through the Ubuntu App Developer process cannot contain maintainer scripts in their package. I could not find a reference to it on wiki.ubuntu.com/AppReviewBoard/Review/Guidelines, but I know it's part of the App Review Board policy –  David Planella Jul 7 '12 at 7:25
    
Thanks David. I've found a solution other than that. –  Owais Lone Jul 7 '12 at 10:48
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
Fogger is a program he is working on which creates desktop apps (.desktop) from a website.Its like having a desktop shortcut for Twitter and so on.Much like Fluidapp. –  Nickolas Jul 6 '12 at 19:54
    
Awesome! TryExec is exactly what is needed for this situation. Hide the .desktop files when the executable is not installed. Perfect! –  Owais Lone Jul 6 '12 at 20:41
add comment

It's a very bad idea to have a postremoval modify user homes:

  • A user's home directory may be used with more than one system
  • On system with a very large user base it can take quite some time to delete all the files.
  • You may not be able to access the users's homes if they are encrypted or you need to authenticate before mounting them from a server.

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.