Some help on this script and applying it for crunchbang if possible.

view story

http://crunchbang.org – I have a script here written by a person in python I beleive. It is used to mute my beats speaker when headphones are plugged in. I beleive the guy that wrote this script was using ubuntu. If I could get some assistance with how to rewrite it I suppose it would be helpful. There is also a events file he created that is suppose to go into "To configure, put the headphones file in the /etc/acpi/events/ directory and put the headphones.py file in the /etc/acpi/ directory and make it executable" any help appreciated ..... (HowTos)