switched the detection to using WAYLAND_DISPLAY and used yad to get the password for sudo -E (It sucks. It works.)