Added compatibility with Cinnamon DE for linux, and small fix

Added detection of desktop environment for linux, and can be extended for other DEs but the key to look for may not be the same.
Got the idea from http://stackoverflow.com/questions/2035657/what-is-my-current-desktop-environment
While testing for windows, I also found that "wb" should be used for writing the file in order to avoid image corruption
Merge pull request #2 from eujing/patch-1

Added compatibility with Cinnamon DE for linux, and small fix