Run commands when triggered from certain events.