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

Unable to connect to GeoClue. Unable to get location from provider. #318

Open
DimitriPapadopoulos opened this issue Feb 17, 2016 · 102 comments
Assignees

Comments

@DimitriPapadopoulos
Copy link

Unable to start redshift 1.11 on Fedora 23 since yesterday:

$ redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Geolocation disabled for UID 1000.
Unable to connect to GeoClue.
Unable to get location from provider.
$ 

This is similar to #158 but the proper fix - having both redshift.desktop and redshift-gtk.desktop files - doesn't help any more. Indeed both files are available in Fedora since #1309177 was closed:

$ rpm -qf /usr/share/applications/redshift.desktop
redshift-1.11-1.fc23.x86_64
$ rpm -qf /usr/share/applications/redshift-gtk.desktop
redshift-gtk-1.11-1.fc23.x86_64
$ 

Both alternative solutions work although they are supposed to be bad solutions:

  1. Run as sudo redshift-gtk
  2. Add to /etc/geoclue/geoclue.conf:
[redshift]
allowed=true
system=false
users=
@DimitriPapadopoulos
Copy link
Author

I've found location services had been turned off. After turning on location services redshift runs smoothly.

It makes sense that redshift needs a location. However instead of exiting with a cryptic error message, redshift could display a dialog to manually set a location or turn on location services.

For example gnome-maps doesn't crash when location services are not running:

  • either you enter a location manually from the search bar,
  • or gnome-maps offers to turn on location services in settings.

See attached screen capture of gnome-maps:
gnome-maps

@mikeatlas
Copy link

@DimitriPapadopoulos where can I "turn on location services" setting you are describing... gnome-maps doesn't work on 14.04. I presume there's an underlying package and not something inherently required about gnome-maps being installed to fix redshift's geoclue2 problems.

@DimitriPapadopoulos
Copy link
Author

Gnome maps is just an example of an alternative way to handle missing location services. Other than that it is totally unrelated to redshift.
I don't know about Ubuntu 14.04, I have Fedora 23 here and location services can be enabled/disabled from Settings.

@DimitriPapadopoulos
Copy link
Author

As far as I can tell it is quite difficult to disable intrusive services like geoclue (location service) in Ubuntu:
http://askubuntu.com/questions/106916/how-do-i-stop-geoip-from-connecting-to-the-internet-every-time-i-boot

My guess is that location services are not disabled on your Ubuntu computer. Also I have just tried an Ubuntu 14.04 workstation and gnome-maps works pretty well once installed. Something might be broken on your computer.

@mikeatlas
Copy link

I decided to just install the latest build 1.11 from source and specify my lat:lon manually in the config. Personally I don't travel with my workstation across time zones .... Like ever. So dynamic geoclue calls every time redshift starts aren't really worth the struggle to resolve. Thanks for the reply @DimitriPapadopoulos

@clayzermk1
Copy link

Was encountering this and have a clean fix.
Currently using redshift 1.10-5ubuntu on Linux Mint 18 Sarah (straight from repo).

Installed redshift and redshift-gtk packages.
Attempted to run redshift-gtk and encountered this issue.
Ran redshift from command line and got:

$ redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Unable to connect to GeoClue.
Unable to get location from provider.

Installed geoclue-2.0 sudo apt-get install geoclue-2.0.
Ran another time from the terminal.
Started no problems.
Exited the terminal process and started redshift-gtk, no problems.

Hope this helps someone else 🍻

@eadebayo
Copy link

@clayzermk1
Thanks for the post. Worked for me. Mint 18, MATE.

@clayzermk1
Copy link

At least in the .deb, it seems like geoclue-2.0 should be a requirement of the package if it's required. It seems like the .rpm could also use a dependency based on @DimitriPapadopoulos's original post. Can anyone on a .rpm distro comment as to the minimum set of packages they had to install to get redshift to work?

@mrschaal
Copy link

mrschaal commented Jan 8, 2017

@clayzermk1 thank you very much, helped me a lot. Worked perfectly for me, using Linux Mint 18 KDE

@vbsteja
Copy link

vbsteja commented Apr 19, 2017

@clayzermk1 it solved for me. thanks so much.

@artforlife
Copy link

I am still having this issue on Ubuntu 16.04. I have tried every solution advised in this thread to no avail. Any idea how I can troubleshoot this?

@imflash217
Copy link

imflash217 commented Nov 1, 2017

Based on the original post, the geo2 location provider is already installed.
So there are two solutions to this:

  1. Run Redshift from command line as root sudo redshift
  2. Turn on Location services: Goto Settings --> Privacy --> Location Services (ON/OFF)

@sodomak
Copy link

sodomak commented Feb 23, 2018

Ok, so it is not possible to run Redshift without location services? It would be nice to be able to set the location manualy (I think I know where I am:) ). I see it as the privacy issue.

@helo9
Copy link

helo9 commented Feb 24, 2018

No you don't need any location service, simply pass
-l LAT:LON
as option on command line.

@saif-ellafi
Copy link

On Fedora 28 KDE, only thing that worked was redshift-gtk -l 0:0

@navoytak
Copy link

On Fedora 28 Cinammon, the command redshift-gtk -l 0:0 also works
Seems like recent update breaks the app.

@ElijahLynn
Copy link

I had this issue as well, my environment is Fish > Tmux > Guake. I had to exit Tmux within Guake and run redshift outside of Tmux. I had tried creating a new window (shell session) inside Tmux but that didn't work.

@rmlrml
Copy link

rmlrml commented Jul 2, 2018

Getting almost the same error message in Debian too. geoclue-2.0 is installed.
Error popup on startup:

Failed to run Redshift
Trying location provider `geoclue2'...
Unable to start GeoClue client:
GDBus.Error:org.freedesktop.DBus.Error.AccessDenied:
'redshift' disallowed, no agent for UID 1000.
Unable to connect to GeoClue.
Unable to get location from provider.

In the terminal, no gtk:

ryan@pocketwee:~$ redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: 'redshift' disallowed, no agent for UID 1000.
Unable to connect to GeoClue.
Unable to get location from provider.

sudo same:

ryan@pocketwee:~$ sudo redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: 'redshift' disallowed, no agent for UID 0.
Unable to connect to GeoClue.
Unable to get location from provider.

Was suggested to start service, no go:

ryan@pocketwee:~$ systemctl --user start redshift.service
ryan@pocketwee:~$ redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: 'redshift' disallowed, no agent for UID 1000.
Unable to connect to GeoClue.
Unable to get location from provider.

@akostadinov
Copy link

What version was merge request 6 merged into? Perhaps it will resolve the issue.

FYI for Fedora 28 issue is 1585970.

@DrDoctor13
Copy link

I'm getting this issue on KDE 5.13.3. When I log in, I get prompted to allow location access (not something I knew KDE did) but it doesn't seem to do anything.

Trying location provider `geoclue2'...
Using provider `geoclue2'.
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.

@ElijahLynn
Copy link

This seems like an issue with connectivity with the external server. The error handling needs to be better around refused connections.

@sbrl
Copy link

sbrl commented Jul 23, 2018

I'm using an Arch-based distro (Artix Linux actually - it uses OpenRC instead of SystemD) with XFCE4, and I get a prompt every time I sign in asking me whether I want redshift to be allowed to access my location. I found a notify_location preference under xfce4-notifyd in the Xfconf settings editor - and its set to 2, but I'm currently unsure if this is the right setting I'm after - and, indeed, what to set it to to auto-approve location access for redshift if it is.

@Skatox
Copy link

Skatox commented Jul 23, 2018

I have the same problem on Arch inside KDE, I don't know how to enable location from KDE, since it seems like it's a GNOME thing.

@akostadinov
Copy link

You need patched geoclue, and make sure geoclue demo agent is running. Agent will start geoclue on demand.

@Jeremytho2050
Copy link

I'm new to GitHub and I do not know how to post the error

I have a problem starting Redshitf in Konsole: redshift -o.
And I get this:

Waiting for the current location to be 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.
The location of the provider could not be obtained.

Help me please :'v

@sbrl
Copy link

sbrl commented Jul 24, 2018

@akostadinov:

You need patched geoclue, and make sure geoclue demo agent is running. Agent will start geoclue on demand.

Where can I find this patched geoclue?

Also, I'm unsure as to what you mean by geoclue demo agent.

@akostadinov
Copy link

@sbrl , read my last comment about bug fix. You need a version with the merge request applied. On Fedora 28 I'm using Fedora 29 latest Koji builds, see the bugzilla issue.

The demo agent that is part of the GeoClue distribution needs to be started unless you are running Gnome. On Fedora 28 XFCE starts it automatically. No idea about other distros and/or DEs.

@DimitriPapadopoulos
Copy link
Author

DimitriPapadopoulos commented Jun 21, 2021

@Rybec Rants such as "this just isn't very good software", "most of the world" or "if it actually worked, which it clearly doesn't" won't help. We're just end users like you trying to help. Besides, if I were the programmer, I would choose to ignore your rants.

To the best of my knowledge, most Night Mode programs do have a mode based on suntime/sunset, and that is usually the default mode. Here are facts:

That said, the transition might not occur precisely at sunset/sunrise - precisely depending on the location because as you wrote it might make less sense near the poles.

And as I wrote, one can imagine an alternative mode where the transition occurs at a time specified by the user and not at sunset/sunrise time. Actually, most Night Mode programs out there do support that, including redshift as far as I can see (#529).

The problem here is not the existence of two modes, based on:

  • time defined by the user,
  • sunset/sunrise time.

The problem is that the default mode, based on sunset/sunrise time has problems retrieving the location and this breaks redshift. That the whole point of this issue. And yes, these problems really are a pain, hence the length of this page. I guess it's not easy to fix.

@Rybec
Copy link

Rybec commented Jun 21, 2021

First, Windows "sunset/sunrise" option uses set times for that, not actual sunset to sunrise. I've been using mostly Windows for the last year (and Windows on at least one computing for several), and on all three of the computers I used it on, the "sunset to sunrise" time was the same range, both for Idaho and for here in Alaska. It doesn't actually try to do sunset to sunrise. I was actually wrong above about Windows starting at 9pm. It starts at 7:30p for "sunset". I changed it to 9pm myself on all three systems. It did start at 7:30p for sunset to sunrise mode though, including on my new laptop, which I setup here in Alaska. Neither Mac nor Windows use your location data though. They use time zone (which may be set by location data, though not in my case, because I set my time zones manually and disabled the location tracking for Windows).

Second, this is what the MS link you provided says, "Your display emits blue light—the kind of light you see during the day—which can keep you up at night. To help you get to sleep, turn on the night light and your display will show warmer colors at night that are easier on your eyes." I didn't realize Redshift was designed more to be novelty software to make it easier to work late into the night. I just went back and read the README, and it says that Redshift is designed purely to reduce eyestrain due to blue light at night. The issue is that other Night Mode software is designed for sleep, not eyestrain from working in the dark. As implied in the MS link, blue light signals your brain that it is still daytime, making it harder to sleep right after using computers. I assumed this was the intent of Redshift, but that clearly isn't the case. It is clear now that it is intended to make it easier to have poor sleep habits rather than as a help to maintain good sleep habits, and in that context, it does make sense to trigger on actual sunset.

Third, yeah, it does appear to be hard to fix, though it wouldn't be hard to mitigate. A simple default of falling back on local time or just providing a manual button if location cannot be obtained would be pretty easy to implement. It looks like the developers just don't care, given how long this has been a problem.

I do understand that it can be hard to keep up with open source projects. I run a few of my own. But if the owners and contributors of the project don't have time to continue maintaining it, it would be nice if they would at least make that known. (If I no longer had time to work on my own projects, I would certainly add a note at the top of the README for my repos, saying that they were no longer being actively maintained, because that's just good manners.) I would rather know a project is no longer being maintained than spend two hours searching for a solution to a problem that turns out to be 5+ years old. And maybe if the owners had said they weren't actively maintaining it anymore, Debian wouldn't be including such broken software in their repositories anymore. Had it not been available though apt-get, I wouldn't have wasted all of this time. (Though, to be fair, part of the fault here is with Debian, for not being thorough in their testing.)

Anyhow, for anyone else (still reading after that wall of text...) who needs something like this but can't get Redshift to work, Debian, Ubuntu, and most other Debian based distros have a package called sct. This can be used to change the color temperature of the screen. For night mode, run sct 4500 (or somewhere within a few hundred of 4500). To return to day mode, run sct or sct 6500. (6500 is the default, so running sct by itself goes to 6500.) According to sct, you can do anything from 1000 to 10000, so you can pick what works best. If you need it timed, you can use cron, anacron, or any other task scheduling software available for your distro. (Note that sct isn't persistent. So if you reboot, you will be back at 6500...at least, unless you have some boot script that runs sct...)

@DimitriPapadopoulos
Copy link
Author

DimitriPapadopoulos commented Jun 21, 2021

Still, I think most programs use or used to use sunset/sunrise time by default, most importantly f.lux which was the first mainstream night mode program, if I recall correctly, and probably the one redshift tried to mimic. But then both MacOS and Windows have ended up including their own utility. Not sure about macOS, but yes, on Windows Microsoft have chosen local time by default (transition to warmer 21:00-07:00 as you explained). And it's true Windows means "most users", at least as far as computers are concerned.

By the way, I discovered sct thanks to your post, indeed it's simple and just works. But it requires skills such as setting up a crontab, skills some users don't have. Actually, it looks like redshift merely provides a GUI around sct or the equivalent function calls, with two modes, based on sunset/sunrise time or based on a default or user-set local time. Both are interesting, so the question might be, which one should be the default?

Finally, I'm not certain redshift is not maintained anymore. It's just that this issue seems to be related to system peculiarities and geolocation servers not responding for some reason (maybe not easily available for free anymore). I spent some time looking into it a few years ago and the causes were multiple, depending on the Linux distribution and system parameters, although I cannot remember the details. Perhaps your suggestion to change to a default mode based on local time instead of sunset/sunrise time, like Windows, might be a good way to mitigate this issue. Why not create a new issue for that?

@Rybec
Copy link

Rybec commented Jun 21, 2021

Mac and Windows don't. They have "sunset to sunrise" settings, but they actually use time. I haven't tried f.lux, so you might be right there.

As far as sct goes, I am currently considering writing a systemd service in Python that uses sct to achieve this functionality using local time. The one problem I have is that I hate GUI programming, and I don't think it would be ideal to require users to edit a config file to adjust the on/off times. That said, if I do this, I'll put it on Github, even if it doesn't have GUI configuration. Maybe I'll start with this and add GUI later, if I have time.

I would say Redshift is unmaintained at this point, because the last commit was June 14th 2020. That was over year ago. That doesn't mean they can't start maintaining it again, but it does mean that for all intent the project is unmaintained.

Using the the local time as the default would be an excellent idea, but if no one has worked on this in a year, and they didn't do that 5 years ago, when this issue started coming up, I don't see the point opening an issue for it. Clearly it's not a priority to make this more broadly usable, and the devs only care about the sunset/sunrise functionality and not the sleep applications, I can respect that (even if I don't agree with it).

I'll post here if I end up writing that service, but it will have sct as a dependency. (Redshift has several backend options for adjusting color temperature. Maybe I could add that in the future, but right now, my priority is something that works for me, and if there is a good chance it will help others, I'm willing to release it under an open source license.)

@DimitriPapadopoulos
Copy link
Author

Also, Gnome and KDE now have their own built-in Night Light and Night Color, that's what I have been using for some time now. Their default is "sunset/sunrise" but it just works and might be actually based on fixed times instead of geolocation and actual sunset/sunrise times...

@Rybec
Copy link

Rybec commented Jun 22, 2021

Yeah, this is kind of a fringe thing at this point, because it is built in for most OSs and most desktop managers in Linux. I'm using Enlightenment, which does not have this feature.

I did just finish rolling my own, and I even wrote a GUI config program. I was planning to do it as a service, but since different users might want different settings, I've decided to make a desktop autostart thing. I guess you won't need it, but I plan on putting it on Github sometime tomorrow.

@ghost
Copy link

ghost commented Oct 6, 2021

On Ubuntu 21.10 solved by installing girl1.2-geoclue-2.0, libgeloclue-2-0 and libgeocode-glib0, and adding coordinates into sudo nano /etc/geoclue/geoclue.conf. Not sure which of these fixed it but after installing these 3 redshift finally works.

Alternatively, gammastep on Ubuntu is a clone of redshift that also worked

also note that while the v1.12 change logs notes that the conf file location was changed from ~/.config/redshift.conf to ~/.config/redshift/redshift.conf, this doesn't appear to be the case.... create and make changes to ~/.config/redshift.conf for things like lat/long and color temps to be read

@thriveth
Copy link

thriveth commented Oct 7, 2021

@gpioneer90 Which version of redshift is that? I have all these packages installed in Debian 10 and it does not work for me there, with redshift v. 1.12.

@ghost
Copy link

ghost commented Oct 7, 2021

@gpioneer90 Which version of redshift is that? I have all these packages installed in Debian 10 and it does not work for me there, with redshift v. 1.12.

1.12. Did you try making a config file in ~/.config/redshift.conf instead of ~/.config/redshift/redshift.conf ? (I made a typo in the above post for the directory, fixed it)

if that doesn't work, see if gammastep is available to download in your repos because that worked out of the box for me

@pannet1
Copy link

pannet1 commented Dec 4, 2021

i am just using qtile tiling manager and hence dont have any DEs for running the graphical redshift-gtk. though i could show some icons on the qtile bar, i tried to do make it work on the command line.
i created a redshift configuration file manually like so

[redshift]
location-provider=manual
[manual]
lon=60
lat=6

still it did not work. then when i ran
redshift -c ~/.config/redshift.conf
it worked. hope this helps someone.

now need to figure out how to run it on the startup.

ps: got my co-ordinates from google map. you should change it your location.

@LambertCliff
Copy link

Hi,
For me, the solution was the following :
My setup : Fedora 34 with Cinnamon (was working fine with Fedora 33 until the update to 34).
I realised that when I open my user session, the Geoclue Service isn't yet running and so Redshift encounters a "timeout" to fetch the coordinates.
The workaround :
In the folder /usr/lib/systemd/system I edited the geoclue.service file by adding at the bottom :

[Install]
WantedBy=multi-user.target

And then run : systemctl enable geoclue.service

That's it.

It works fine now.

Hope it could help someone.

@ToddAndMargo
Copy link

ToddAndMargo commented Jan 5, 2022 via email

@ToddAndMargo
Copy link

ToddAndMargo commented Jan 5, 2022 via email

@pguerin3
Copy link

pguerin3 commented Jan 8, 2022

For those with the following issue:

> redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
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.
> 

If you just want a minimal install, then you can run the app like this instead:

> redshift -l manual -l -24.43:100.85
Using method `randr'.
Waiting for initial location to become available...
Location: 24.43 S, 100.85 E

I'm using Fedora 35 LXDE.
Hope this helps anyone trying to do some troubleshooting.

@ToddAndMargo
Copy link

ToddAndMargo commented Jan 13, 2022 via email

@ToddAndMargo
Copy link

ToddAndMargo commented Jan 16, 2022 via email

@jakob1379
Copy link

I got this error and instead of having to install yet another program I put this snippet together

#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'

if [ ! -z "$(pgrep redshift)" ]; then
    killall redshift
    wait
fi

gpsinfo="$(curl -s ipinfo.io | sed 's/[" ]//g')"
lat=$(echo "$gpsinfo" | awk -F '[:,]' '/loc/{print $2}')
lon=$(echo "$gpsinfo" | awk -F '[:,]' '/loc/{print $3}')

redshift-gtk -l $lat:$lon 2>/dev/null &

@mhitza
Copy link

mhitza commented May 6, 2022

To work around this issue, I've made the geoclue service autostart on multi-user.target (graphical.target definitely should work as well).

In order to do that I've created the directory and file /etc/systemd/system/geoclue.service.d/multi-user.conf (a systemd drop-in file/override) with the following content.

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable geoclue.service

@Reno-Sifana
Copy link

Reno-Sifana commented Jul 8, 2022

Based on the original post, the geo2 location provider is already installed. So there are two solutions to this:

1. Run Redshift from command line as root **`sudo redshift`**

2. Turn on Location services: Goto **Settings --> Privacy --> Location Services (ON/OFF)**

Yesterday I after restarting my linux at night I realized suddenly Redshift didn't detect my location. After morning to evening I reinstalled Redshift and changed the geoclue.conf configuration to no avail. instead there is a "Timeout was reached" error message when I run the sudo timeshift command in the terminal.
Desktop Environment: Xfce
Screenshot_2022-07-08_23-03-27

@goekce
Copy link

goekce commented Sep 18, 2022

@Reno-Sifana I had the same output on Archlinux using i3. I solved it by running /usr/lib/geoclue-2.0/demos/agent in the background.

For details, refer to the redshift page on Archwiki.

@Reno-Sifana
Copy link

@Reno-Sifana I had the same output on Archlinux using i3. I solved it by running /usr/lib/geoclue-2.0/demos/agent in the background.

For details, refer to the redshift page on Archwiki.

Yes. At that time the geoclue agent was already in the Startup list. It turns out that the cause is because the internet connection at home is not reliable. (which I remember at that time)

@paxapy
Copy link

paxapy commented Nov 18, 2022

@Reno-Sifana I had the same output on Archlinux using i3. I solved it by running /usr/lib/geoclue-2.0/demos/agent in the background.

For details, refer to the redshift page on Archwiki.

Can confirm on Ubuntu 22.04 solved with running an agent.
Had to add it to autorun..
Yet I prefer manually setting lon/lat but it seems like .config/redshift/redshift.conf ignored when installing as regular package.

@DeeDeeRanged
Copy link

@Reno-Sifana I had the same output on Archlinux using i3. I solved it by running /usr/lib/geoclue-2.0/demos/agent in the background.
For details, refer to the redshift page on Archwiki.

Can confirm on Ubuntu 22.04 solved with running an agent. Had to add it to autorun.. Yet I prefer manually setting lon/lat but it seems like .config/redshift/redshift.conf ignored when installing as regular package.

On Debian you put the file here .config/redshift.conf and not ./config/redshift/redshift.conf
This is mentioned in the man redshift.

@TomaszWaszczyk
Copy link

On Debian same problem:

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

@raimue
Copy link

raimue commented Jul 9, 2023

In my case the problem was two-fold on Ubuntu 22.04 LTS. I had the described problem with geoclue2 and tried overriding this in ~/.config/redshift.conf like this:

[redshift]
location-provider=manual
[manual]
lon=42
lat=23

However, it seemed like all configuration settings were ignored and it still tried to contact the geoclue2 service, which is not running. The problem was that my ~/.config/redshift.conf was a symlink to the real path ~/dotfiles/.config/redshift.conf. This caused a permission denied error that was also reproducable using redshift -c ~/dotfiles/.config/redshift.conf. The access was denied by apparmor, which is enabled by default on Ubuntu.

The real fix for me was to allow access to my configuration file in the apparmor profile. Maybe this also helps others.

--- a/apparmor.d/usr.bin.redshift
+++ b/apparmor.d/usr.bin.redshift
@@ -39,2 +39,3 @@
   owner @{HOME}/.config/redshift.conf r,
+  owner @{HOME}/dotfiles/.config/redshift.conf r,
   owner /run/user/*/redshift-shared-* rw,

@wachin
Copy link

wachin commented Oct 12, 2023

In my case the problem was two-fold on Ubuntu 22.04 LTS. I had the described problem with geoclue2 and tried overriding this in ~/.config/redshift.conf like this:

[redshift]
location-provider=manual
[manual]
lon=42
lat=23

Thanks, work in Linux Mint 21 Vanessa using Fluxbox Window Manager. I found the latitude and longitude in: https://www.geodatos.net/

@tremby
Copy link

tremby commented Oct 15, 2023

@Reno-Sifana I had the same output on Archlinux using i3. I solved it by running /usr/lib/geoclue-2.0/demos/agent in the background.

For details, refer to the redshift page on Archwiki.

This is what did it for me, only on Ubuntu 22 it was at /usr/libexec/geoclue-2.0/demos/agent.

@fonzi
Copy link

fonzi commented Jun 17, 2024

Since this is still open, and it seems to be some obscure issue on Debian + XFCE especially, something is using wayland in debian XFCE. I've read it's lightDM but not sure, tried to solve it. So, I went ahead and wrote a little script that uses xsct wrapped with yad to provide a super simple screen red light alternative

https://github.com/fonzi/bash-tools/tree/master/debian/screen-temp

@DeeDeeRanged
Copy link

Main issue is that redshift depends on geoclue running see previous comments. above.

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