Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Can't open display" message when running sudo ./displaylink-debian.sh #639

Closed
z-nexx opened this issue Oct 27, 2021 · 3 comments
Closed

Comments

@z-nexx
Copy link
Contributor

z-nexx commented Oct 27, 2021

When I run sudo ./displaylink-debian.sh on Debian Bookworm/Sid I get the following message:

$ sudo ./displaylink-debian.sh 
No protocol specified
Can't open display :0
@z-nexx
Copy link
Contributor Author

z-nexx commented Oct 27, 2021

After a quick bit of digging I found that the error message is from xrandr which can't find the X display on line 40. This is due to sudo not passing the user's environment.

The solution is to instead run the following to preserve the environment variables needed.

sudo -E ./displaylink-debian.sh

@janvlug
Copy link

janvlug commented Jan 16, 2023

On my fully up to date Librem 5 phone running PureOS, I get "Can't open display" both when running with sudo -E and running as root.

@janvlug
Copy link

janvlug commented Jan 23, 2023

On Wayland only systems, I always get Can't open display when running xrandr --listproviders.

But the command xrandr --listmonitors gives:

Monitors: 2
 0: +*XWAYLAND0 2560/600x1440/340+2560+0  XWAYLAND0
 1: +XWAYLAND1 2560/600x1440/340+0+0  XWAYLAND1

Note: when logged in via ssh running xrandr --listmonitors gives also Can't open display.

I think that out-commenting the line:

providers="$(xrandr --listproviders)"

(currently line 53)

from the displaylink-debian.sh script does not hurt and makes the script to continue on Wayland only systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants