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

I just got inspired of this project:

http://www.opendesktop.org/content/show.php?content=145633

Well , i wanted to do a similar thing , after dpkg places something new in /usr/share/applications directory , but where should my script point to , and the parameter to pass in ?

share|improve this question
up vote 4 down vote accepted

If the script do not takes parameters, add a file in /etc/apt/apt.conf.d/, for example 92local (numbers are used to force execution order of scripts in that directory), with the following content:

DPkg::Post-Invoke { "/path-to/my-script"; };

and remember to make it executable.

Cannot find right now information on how to pass parameter or input to the script.
If can be of help, when running apt on command line, you should find the command line in the environment variable SUDO_COMMAND.

share|improve this answer
    
i modified that script to find all the .desktop files automatically , so far my problem is resolved , thanks ! – warl0ck Sep 30 '11 at 23:44

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.