Removed the getenv call and using xdg-open instead