I am trying to log the applications that a user opens/closes. Is there a way to execute a script (Java,Python,etc) everytime an application (like firefox) is opened and closed?
You can use a wrapper, e.g. possibly called
firefox, which can be found earlier in your
$PATH. For instance:
#!/bin/sh [commands executed before Firefox starts] /usr/bin/firefox "$@" [commands executed after Firefox quits]