Skip to content

Instantly share code, notes, and snippets.

@jonchampagne
Created May 19, 2018 15:30
Show Gist options
  • Save jonchampagne/315d600d1fd4cae2cc0301a806fa4d90 to your computer and use it in GitHub Desktop.
Save jonchampagne/315d600d1fd4cae2cc0301a806fa4d90 to your computer and use it in GitHub Desktop.
Wayland sudo
#!/bin/bash
if [ -n $XDG_SESSION_TYPE ] && [[ $XDG_SESSION_TYPE == "wayland" ]]
then
xhost +SI:localuser:root
/sbin/sudo $@
xhost -SI:localuser:root
xhost
else
/sbin/sudo $@
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment