3

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.

1 Answers1

2
  • 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:

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

  • For triggers, here is nice post how to use them. http://stackoverflow.com/questions/15276535/dpkg-how-to-use-trigger. They can be used to watch a folder, in OP case interest /usr/share/applications – user.dz Jun 27 '15 at 05:04