Skip to content

Commit eb2d6e5

Browse files
committed
Fix for SUDO_ASKPASS on Wayland
1 parent da480e9 commit eb2d6e5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Resources/hardware-probe.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,10 @@ def run_probe_locally(self):
286286
if os.environ.get('HW_PROBE_FLATPAK') or os.environ.get('HW_PROBE_SNAP') or os.environ.get('NO_SUDO'):
287287
command = self.wizard().hw_probe_tool
288288
args = ["-all", "-output", self.wizard().hw_probe_output]
289+
elif os.environ.get('XDG_SESSION_TYPE') == 'wayland':
290+
# SUDO_ASKPASS doesn't work on Wayland currently, so piping the password
291+
command = 'bash'
292+
args = ["-c", os.environ.get('SUDO_ASKPASS') + " | sudo -S -E " + self.wizard().hw_probe_tool + " -all " + " -output " + self.wizard().hw_probe_output]
289293
else:
290294
command = 'sudo'
291295
args = ["-A", "-E", self.wizard().hw_probe_tool, "-all", "-output", self.wizard().hw_probe_output]

0 commit comments

Comments
 (0)