Other Trigger - Power Connected/Disconnected

I'd like to be able to trigger actions when I connect and disconnect the power cable from my MacBook.