Improved desktop detection function. Removed no-root user pre-requisite