From eb2d6e5145fb8571414bda57676084b7f13b94e5 Mon Sep 17 00:00:00 2001 From: Andrey Ponomarenko Date: Sat, 9 Apr 2022 01:36:02 +0300 Subject: [PATCH] Fix for SUDO_ASKPASS on Wayland --- Resources/hardware-probe.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Resources/hardware-probe.py b/Resources/hardware-probe.py index b798514..303a4ab 100755 --- a/Resources/hardware-probe.py +++ b/Resources/hardware-probe.py @@ -286,6 +286,10 @@ def run_probe_locally(self): if os.environ.get('HW_PROBE_FLATPAK') or os.environ.get('HW_PROBE_SNAP') or os.environ.get('NO_SUDO'): command = self.wizard().hw_probe_tool args = ["-all", "-output", self.wizard().hw_probe_output] + elif os.environ.get('XDG_SESSION_TYPE') == 'wayland': + # SUDO_ASKPASS doesn't work on Wayland currently, so piping the password + command = 'bash' + args = ["-c", os.environ.get('SUDO_ASKPASS') + " | sudo -S -E " + self.wizard().hw_probe_tool + " -all " + " -output " + self.wizard().hw_probe_output] else: command = 'sudo' args = ["-A", "-E", self.wizard().hw_probe_tool, "-all", "-output", self.wizard().hw_probe_output]