Revert "Replaced DESKTOP_SESSION switch with if/else statements because in some desktop environments DESKTOP_SESSION is not set. Also replaced /dev/stderr with &2, these should be the same but /dev/stderr symlink is owned by root and throws errors when used as cron job &2 does not."

This reverts commit 2d22f7c23bde3283810a812268b3f98e7dadfe9f.