Updated script to work a bit better on system (Linux Mint 17 Cinnamon)