You are not logged in.

#1 2016-03-13 22:06:33

chevy787
Member
Registered: 2016-03-13
Posts: 2

[SOLVED] Can't launch apps after sleep "Can't open display ':0'"

So, I recently have had this problem after updating my system:

I am able to use my system normally until after I sleep and wake up. Afterwards, all aplications will fail to start as my display to open.
Even doing an xrefresh I
xrefresh:  unable to open display ':0'

I tried echoing DISPLAY before sleeping and it is indeed ':0' and everything functions. I am not sure what would change from sleeping/waking that would break the functionality.

Any help is appreciated. Thanks.

Last edited by chevy787 (2016-03-14 03:54:33)

Offline

#2 2016-03-13 23:33:39

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: [SOLVED] Can't launch apps after sleep "Can't open display ':0'"

This is likely caused by a hostname change when reacquiring a network connection on resume.

If the new hostname differs from the previous one which xauth knows about (see xauth list) then you'll not be able to access the Xserver.

Either prevent hostname changing (see respective wiki about various network managers for how) or add the new hostname to the Xserver with xauth add "$DISPLAY" . mcookie where mcookie is the same value you obtained from xauth list (these are generated via the mcookie(1) tool which essentially just does head -c 512 /dev/urandom | md5sum).

Edit: A better solution would be to use xhost(1) instead and let the Xserver interpret the meaning, for example xhost +si:localuser:$USER (see Xsecurity(7)).

Last edited by Earnestly (2016-03-13 23:43:56)

Offline

#3 2016-03-14 03:50:51

chevy787
Member
Registered: 2016-03-13
Posts: 2

Re: [SOLVED] Can't launch apps after sleep "Can't open display ':0'"

This seems to have worked!

I owe you one.

Offline

Board footer

Powered by FluxBB