Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Could not connect to wayland display, exiting. #897

Open

Description

@yuriccosta

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]

Activity

  1. lovestaco commented on Jul 1, 2024

    @lovestaco

    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.
    
  2. ItzzCode commented on Jul 4, 2024

    @ItzzCode

    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

  3. ledufff commented on Jul 7, 2024

    @ledufff

    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...

  4. bbbhltz commented on Jul 8, 2024

    @bbbhltz

    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

  5. janxkoci commented on Jul 8, 2024

    @janxkoci

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

  6. ItzzCode commented on Jul 9, 2024

    @ItzzCode

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

  7. bbbhltz commented on Jul 9, 2024

    @bbbhltz

    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?

  8. ItzzCode commented on Jul 9, 2024

    @ItzzCode

    not there because thats not what the README says?

  9. bbbhltz commented on Jul 9, 2024

    @bbbhltz

    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)

  10. ItzzCode commented on Jul 9, 2024

    @ItzzCode

    there we go! thanks!

  11. sirnacnud commented on Jul 11, 2024

    @sirnacnud

    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>
    
  12. lovestaco commented on Jul 12, 2024

    @lovestaco

    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
    
  13. maxyudin commented on Oct 31, 2024

    @maxyudin

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

    • Linux Mint 21.3 Mate
  14. suzunn commented on Nov 11, 2024

    @suzunn

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

  15. Am0rphous commented on Nov 15, 2024

    @Am0rphous

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

    mv  ~/.config/redshift/redshift.conf ~/.config/redshift.conf 
    
  16. chrisspadanuta commented on Nov 25, 2024

    @chrisspadanuta

    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.

  17. agustinegonzalez commented on Mar 25, 2025

    @agustinegonzalez

    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

    very useful. What solved my mistake was to specify lat and long.

  18. jasdeepkhalsa commented on Sep 1, 2025

    @jasdeepkhalsa

    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.

    Solved my issue as well - thanks!

    By the way from Google Maps if you right-click anywhere on the map you can easily copy the lat and lon and it's in a pair in the format lat, long

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions