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

Could not connect to wayland display, exiting. #897

Open
1 task done
yuriccosta opened this issue Jun 24, 2024 · 16 comments
Open
1 task done

Could not connect to wayland display, exiting. #897

yuriccosta opened this issue Jun 24, 2024 · 16 comments

Comments

@yuriccosta
Copy link

Describe the bug
The redshift is unable to change my screen, cannot get my location and keeps on loop. It seems like the errors of some people here, but mine doesn't say that is unable to connect to geoclue and says something about wayland.

To Reproduce
Just run redshift on terminal or in gtk version.

Expected behavior
It should change my screen based on my location.

Error output/logs/screenshots
I tried on terminal and gtk and the error is the same:

Trying location provider `geoclue2'...
Using the `geoclue2' provider.
Could not connect to wayland display, exiting.
Failed to start adjustment method wayland.
Trying next method...
Using the `randr' method.
Waiting for the initial location to be available...

Software versions (please complete the following information):

  • OS: [Linux]
  • Redshift version: [1.12]
  • Distribution: [Linux Mint]
  • Redshift installed from: ["using apt-get", it already came with Mint]
@lovestaco
Copy link

lovestaco commented Jul 1, 2024

Same for me
Distribution: [Linux Mint] + i3wm

lovestaco@i3nux-mint:~$ sudo redshift
[sudo] password for lovestaco:  
Trying location provider `geoclue2'...
Using provider `geoclue2'.
error: XDG_RUNTIME_DIR not set in the environment.
Could not connect to wayland display, exiting.
Failed to start adjustment method wayland.
Trying next method...
Authorization required, but no authorization protocol specified
`RANDR Query Version' returned error -1
Initialization of randr failed.
Trying next method...
Authorization required, but no authorization protocol specified
X request failed: XOpenDisplay
Initialization of vidmode failed.
Trying next method...
No more methods to try.


lovestaco@i3nux-mint:~$ redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Could not connect to wayland display, exiting.
Failed to start adjustment method wayland.
Trying next method...
Using method `randr'.
Waiting for initial location to become available...
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: 'redshift' disallowed, no agent for UID 1000.
Access to the current location was denied by GeoClue!
Make sure that location services are enabled and that Redshift is permitted
to use location services. See https://github.com/jonls/redshift#faq for more
information.
Unable to get location from provider.

@ItzzCode
Copy link

ItzzCode commented Jul 4, 2024

Same system/software details as the original poster, same problem.

itzzme@itzziclaptop:~$ redshift -V
redshift 1.12

itzzme@itzziclaptop:~$ redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Could not connect to wayland display, exiting.
Failed to start adjustment method wayland.
Trying next method...
Using method `randr'.
Waiting for initial location to become available...
^Cpoll: Interrupted system call
Unable to get location from provider.

itzzme@itzziclaptop:~$ sudo redshift
[sudo] password for itzzme:           
Trying location provider `geoclue2'...
Using provider `geoclue2'.
error: XDG_RUNTIME_DIR not set in the environment.
Could not connect to wayland display, exiting.
Failed to start adjustment method wayland.
Trying next method...
Authorization required, but no authorization protocol specified
`RANDR Query Version' returned error -1
Initialization of randr failed.
Trying next method...
Authorization required, but no authorization protocol specified
X request failed: XOpenDisplay
Initialization of vidmode failed.
Trying next method...
No more methods to try.

Edit: probably the same issue as #895

@ledufff
Copy link

ledufff commented Jul 7, 2024

It stopped working several weeks ago on my debian 12 / xfce system, tried everything to get geolocation working (wifi configurations/different networks, reinstalling redshift and geoclue, etc).
Is the wayland warning expected? that and the permanent waiting for initial location warning are always in the output.

Trying location provider geoclue2'... Using provider geoclue2'.
Solar elevations: day above 3.0, night below -6.0
Temperatures: 6500K at day, 4500K at night
Brightness: 1.00:1.00
Gamma (Daytime): 1.000, 1.000, 1.000
Gamma (Night): 1.000, 1.000, 1.000
Could not connect to wayland display, exiting.
Failed to start adjustment method wayland.
Trying next method...
Using method `randr'.
Waiting for initial location to become available...

@bbbhltz
Copy link

bbbhltz commented Jul 8, 2024

geoclue2 is down I guess. This has happened before, if I recall.

The workaround is to create a redshift.conf in your ~/.configdirectory. Mine looks like this because I am using an older version of redshift:

; Global settings
[redshift]
temp-day=5700
temp-night=3500
transition=1
gamma=0.8:0.7:0.8
location-provider=manual
adjustment-method=randr

; The location provider and adjustment method settings
; are in their own sections.
[manual]
lat=49.4
lon=1.1

; In this example screen 1 is adjusted by vidmode. Note
; that the numbering starts from 0, so this is actually
; the second screen.
[vidmode]
screen=0

there should be an example in /usr/share/doc/redshift and you just need to change the lat/lon values to test it out.

other things to poke around at: #158 (comment) #445

@janxkoci
Copy link

janxkoci commented Jul 8, 2024

Maybe not geoclue - this was linked in another issue: mozilla/ichnaea#2065

@ItzzCode
Copy link

ItzzCode commented Jul 9, 2024

i tried setting my config to manual location, but it seems to just ignore my config (which is at ~/.config/redshift/redshift.conf)

@bbbhltz
Copy link

bbbhltz commented Jul 9, 2024

i tried setting my config to manual location, but it seems to just ignore my config (which is at ~/.config/redshift/redshift.conf)

and at ~/.config/redshift.conf?

@ItzzCode
Copy link

ItzzCode commented Jul 9, 2024

not there because thats not what the README says?

@bbbhltz
Copy link

bbbhltz commented Jul 9, 2024

that is a fallback if $XDG_CONFIG_HOME is not set

export XDG_CONFIG_HOME="$HOME/.config" needs to be set depending on your distro

(keep in mind that I only sorted this out myself yesterday)

@ItzzCode
Copy link

ItzzCode commented Jul 9, 2024

there we go! thanks!

@sirnacnud
Copy link

I just included the location-provider settings in the config and it seems to have worked, at least there is no error dialog.

; Global settings
[redshift]
location-provider=manual

; The location provider and adjustment method settings
; are in their own sections.
[manual]
lat=<your lat>
lon=<your lon>

@lovestaco
Copy link

lovestaco commented Jul 12, 2024

export XDG_CONFIG_HOME="$HOME/.config"

This worked thanks!

lovestaco@i3nux-mint:~$ vim ~/.config/redshift.conf
lovestaco@i3nux-mint:~$ cat ~/.config/redshift.conf 
; Global settings
[redshift]
location-provider=manual

; The location provider and adjustment method settings
; are in their own sections.
[manual]
lat=12.971599
lon=77.594566
lovestaco@i3nux-mint:~$ redshift
Could not connect to wayland display, exiting.
Failed to start adjustment method wayland.
Trying next method...
Using method `randr'.
Waiting for initial location to become available...
Location: 12.97 N, 77.59 E

@maxyudin
Copy link

I solved this problem by replacing
~/.config/redshift/redshift.conf
with
~/.config/redshift.conf

  • Linux Mint 21.3 Mate

@suzunn
Copy link

suzunn commented Nov 11, 2024

Don't forget to reboot after all! Then it will be solved

@Am0rphous
Copy link

Thank you @maxyudin . This fixed it for me (Kali with kernel 6.6.9-amd64).

mv  ~/.config/redshift/redshift.conf ~/.config/redshift.conf 

@chrisspadanuta
Copy link

I just included the location-provider settings in the config and it seems to have worked, at least there is no error dialog.

; Global settings
[redshift]
location-provider=manual

; The location provider and adjustment method settings
; are in their own sections.
[manual]
lat=<your lat>
lon=<your lon>

Thanks @sirnacnud that worked for me, got my lat and lon out of Google Maps. Running Linux Mint 21.2 Cinnamon.

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