Skip to content

Commit

Permalink
Fix for SUDO_ASKPASS on Wayland
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxhw committed Apr 8, 2022
1 parent da480e9 commit eb2d6e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Resources/hardware-probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit eb2d6e5

Please sign in to comment.