Prevent repeated checks for the desktop environment.
Prevent repeated checks for the desktop environment.

It is sufficient to check the desktop environment only once.
Also don't shadow 'stdin', 'stdout' and 'stderr'.

OoberMick/Midori,OoberMick/Midori,Dawid/midori,Dawid/midori