Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there some service or event that is created when the deb installer installs new software? I want to create desktop shortcuts everytime a new app is installed. I know how to do the shortcut, I just want to know if there is an event I can tie to that part of the script.

share|improve this question
  • Workaround: If you use unity, when you install software using the software-center (ubuntu software center), there's a note at the bottom of the window asking you if you want to create a unity launcher. You can click "Yes" or "No" accordingly.

  • On the other hand, you could create some script that checks the log file:

    cat /var/log/dpkg.log|grep installed
    
  • There are triggers, but as far as I can read, they are incorporated in debian packages:

    man debian-trigger deb-triggers
    

    (I wonder how desktop-file-utils triggers dpkg: Processing triggers for desktop-file-utils)

    less /usr/share/doc/dpkg-dev/triggers.txt.gz
    ls /var/lib/dpkg/triggers/
    
  • Finally, maybe you could use dnotify for your script and watch the /usr/share/applications directory, where .desktop files are saved:

    http://serverfault.com/questions/50127/how-to-automatically-run-a-script-when-the-contents-of-a-directory-changes-in-li

share|improve this answer
    
For triggers, here is nice post how to use them. stackoverflow.com/questions/15276535/dpkg-how-to-use-trigger. They can be used to watch a folder, in OP case interest /usr/share/applications – Sneetsher Jun 27 '15 at 5:04

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.