Redshift and geoclue2 [WORKAROUND]

Questions about applications and software
Forum rules
Before you post please read how to get help
Summerof69
Level 3
Level 3
Posts: 176
Joined: Sun Oct 25, 2015 11:52 am
Location: Mainland,Denmark

Redshift and geoclue2 [WORKAROUND]

Post by Summerof69 »

Hello until yesterday evening Redshift-gtk worked with geoclue2 as intended.

When I turned on Redshift at 19.00 today, I got a message that says: "Failed to run Redshift" Trying location provider geoclue2"

I don't use auto start for Redshift.

I'm able to manually run Redshift through terminal with longitude and latitude.

And I've made a workaround for goeclue2 by placing and slightly altering a "redshift.conf" in ~/.config.
I got it from the creators site:
https://jonls.dk/redshift/

But it would be nice to know how to get Geoclue2 up and running again...

I'm on Linux Mint 19.1 Cinnamon, 64bit
Last edited by Summerof69 on Wed Apr 24, 2019 3:59 pm, edited 3 times in total.
For millions of years mankind lived much like the animals
Then something happened which unleashed the power of our imagination
We learned to talk
All we need to do is make sure we keep talking
Stephen Hawkin's voice on Keep Talking by Pink Floyd
Summerof69
Level 3
Level 3
Posts: 176
Joined: Sun Oct 25, 2015 11:52 am
Location: Mainland,Denmark

Re: Redshift and geoclue2

Post by Summerof69 »

I don't know what happened, but fact is that Geoclue2 is running again, and Redshift is able to obtain some placement.

The only thing that has been done from my side is shutting down last night, and turning on pc this afternoon.

I've decided to keep the configuration file for Redshift, because it's more precise.

Geoclue2 places me in the Danish city Horsens exactly where my ISP is... (I'm on cable - not Wi-fi)

Edit: For some reason Geoclue2 didn't run when I tested it at 18.30 hours.
The annoying part of the service not running is, that I might want to take my laptop with me when travelling.
For millions of years mankind lived much like the animals
Then something happened which unleashed the power of our imagination
We learned to talk
All we need to do is make sure we keep talking
Stephen Hawkin's voice on Keep Talking by Pink Floyd
Glosoli
Level 1
Level 1
Posts: 32
Joined: Sat Feb 03, 2018 10:26 am

Re: Redshift and geoclue2 [WORKAROUND]

Post by Glosoli »

I'm facing the same issue. Linux Mint Cinnamon 19.1

edit: I've tried again after two hours, and it's working now. What's going on? :roll:
Summerof69
Level 3
Level 3
Posts: 176
Joined: Sun Oct 25, 2015 11:52 am
Location: Mainland,Denmark

Re: Redshift and geoclue2 [WORKAROUND]

Post by Summerof69 »

Hi Glosoli, I can definitely recommend a configuration file for Redshift, and manually setting "lat" and "lon"in order to override the Geoclue service.

There is a usable file in your /usr/share/doc/redshift/example-redshift.conf,
but the one referred to in the OP is more up to date, and contains some explanation.

If you need any help in setting up a redshift.conf file, please say so. :)
For millions of years mankind lived much like the animals
Then something happened which unleashed the power of our imagination
We learned to talk
All we need to do is make sure we keep talking
Stephen Hawkin's voice on Keep Talking by Pink Floyd
Glosoli
Level 1
Level 1
Posts: 32
Joined: Sat Feb 03, 2018 10:26 am

Re: Redshift and geoclue2 [WORKAROUND]

Post by Glosoli »

Summerof69 wrote:
Thu Apr 25, 2019 5:08 am
Hi Glosoli, I can definitely recommend a configuration file for Redshift, and manually setting "lat" and "lon"in order to override the Geoclue service.

There is a usable file in your /usr/share/doc/redshift/example-redshift.conf,
but the one referred to in the OP is more up to date, and contains some explanation.

If you need any help in setting up a redshift.conf file, please say so. :)
Thank you, but I got a warning trying to load the website
Attachments
Screenshot from 2019-04-25 21-12-40.png
Summerof69
Level 3
Level 3
Posts: 176
Joined: Sun Oct 25, 2015 11:52 am
Location: Mainland,Denmark

Re: Redshift and geoclue2 [WORKAROUND]

Post by Summerof69 »

@Glosoli, yes he needs to get his certificate updated.

Here are the redshift.conf:

Code: Select all

; Global settings for redshift
[redshift]
; Set the day and night screen temperatures
temp-day=5700
temp-night=3500

; Enable/Disable a smooth transition between day and night
; 0 will cause a direct change from day to night screen temperature.
; 1 will gradually increase or decrease the screen temperature.
transition=1

; Set the screen brightness. Default is 1.0.
;brightness=0.9
; It is also possible to use different settings for day and night
; since version 1.8.
;brightness-day=0.7
;brightness-night=0.4
; Set the screen gamma (for all colors, or each color channel
; individually)
gamma=0.8
;gamma=0.8:0.7:0.8
; This can also be set individually for day and night since
; version 1.10.
;gamma-day=0.8:0.7:0.8
;gamma-night=0.6

; Set the location-provider: 'geoclue', 'geoclue2', 'manual'
; type 'redshift -l list' to see possible values.
; The location provider settings are in a different section.
location-provider=manual

; Set the adjustment-method: 'randr', 'vidmode'
; type 'redshift -m list' to see all possible values.
; 'randr' is the preferred method, 'vidmode' is an older API.
; but works in some cases when 'randr' does not.
; The adjustment method settings are in a different section.
adjustment-method=randr

; Configuration of the location-provider:
; type 'redshift -l PROVIDER:help' to see the settings.
; ex: 'redshift -l manual:help'
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
; are negative numbers.
[manual]
lat=48.1
lon=11.6

; Configuration of the adjustment-method
; type 'redshift -m METHOD:help' to see the settings.
; ex: 'redshift -m randr:help'
; In this example, randr is configured to adjust screen 1.
; Note that the numbering starts from 0, so this is actually the
; second screen. If this option is not specified, Redshift will try
; to adjust _all_ screens.
[randr]
screen=1
The values that you need to alter are:
lat=48.1
lon=11.6

You can use google-maps or any other map service that offers longitude and latitude, to obtain your coordinates.

Also: You may have to alter the screen=1 to screen=0 - if the programs returns an error code for non existing screen.

Save the configuration file as "redshift.conf", and place it in ~/.config
For millions of years mankind lived much like the animals
Then something happened which unleashed the power of our imagination
We learned to talk
All we need to do is make sure we keep talking
Stephen Hawkin's voice on Keep Talking by Pink Floyd
Glosoli
Level 1
Level 1
Posts: 32
Joined: Sat Feb 03, 2018 10:26 am

Re: Redshift and geoclue2 [WORKAROUND]

Post by Glosoli »

@Summerof69 I followed your istructions, and it worked. Thank you very much.
Summerof69
Level 3
Level 3
Posts: 176
Joined: Sun Oct 25, 2015 11:52 am
Location: Mainland,Denmark

Re: Redshift and geoclue2 [WORKAROUND]

Post by Summerof69 »

Glosoli wrote:
Thu Apr 25, 2019 5:48 pm
@Summerof69 I followed your istructions, and it worked. Thank you very much.
You are welcome.
For millions of years mankind lived much like the animals
Then something happened which unleashed the power of our imagination
We learned to talk
All we need to do is make sure we keep talking
Stephen Hawkin's voice on Keep Talking by Pink Floyd
User avatar
Pjotr
Level 22
Level 22
Posts: 15539
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Redshift and geoclue2 [WORKAROUND]

Post by Pjotr »

Thanks! Workaround works fine. :)
Tip: 10 things to do after installing Linux Mint 20 Ulyana
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Summerof69
Level 3
Level 3
Posts: 176
Joined: Sun Oct 25, 2015 11:52 am
Location: Mainland,Denmark

Re: Redshift and geoclue2 [WORKAROUND]

Post by Summerof69 »

Pjotr wrote:
Sun Apr 28, 2019 5:32 pm
Thanks! Workaround works fine. :)
You're welcome. :)
For millions of years mankind lived much like the animals
Then something happened which unleashed the power of our imagination
We learned to talk
All we need to do is make sure we keep talking
Stephen Hawkin's voice on Keep Talking by Pink Floyd
User avatar
Pjotr
Level 22
Level 22
Posts: 15539
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Redshift and geoclue2 [WORKAROUND]

Post by Pjotr »

This is a simplified redshift.conf, which gets rid of the need to specify a screen:

Code: Select all

; Global settings for redshift, the file name and path need to be: ~/.config/redshift.conf
; This settings file is meant to be used as workaround when geoclue2 malfunctions.
[redshift]
; Set the location-provider: 'geoclue', 'geoclue2', 'manual'
; type 'redshift -l list' to see possible values.
; The location provider settings are in a different section.
location-provider=manual

; Configuration of the location-provider:
; type 'redshift -l PROVIDER:help' to see the settings.
; ex: 'redshift -l manual:help'
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
; are negative numbers.
; The preset values are those of Amsterdam, The Netherlands.
[manual]
lat=52.4
lon=4.9
Tip: 10 things to do after installing Linux Mint 20 Ulyana
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
deanr72
Level 3
Level 3
Posts: 163
Joined: Sat Mar 24, 2018 2:00 pm
Location: Poland

Re: Redshift and geoclue2 [WORKAROUND]

Post by deanr72 »

The workaround didn't work for me - but then I've never changed a config file before so I'm sure I did something wrong or failed to do something I should have. Just to check, I'm supposed to:

1. change the longitude & latitude settings one this: /usr/share/doc/redshift/example-redshift.conf
2. save as redshift.conf and put here: ~/.config

But what about the original config file? Should I change the name and the settings on that too and leave it where it is? (This is what I did, btw, to no avail).

In the meantime I've discovered f.lux. Does anyone know how this compare to Redshift?
User avatar
kyphi
Level 9
Level 9
Posts: 2701
Joined: Sat Jul 09, 2011 1:14 am
Location: The Hunter Valley, Australia

Re: Redshift and geoclue2 [WORKAROUND]

Post by kyphi »

The file "example-redshift.conf" in /usr/share/doc/redshift is only an example file that you can use as a template to write your own "redshift.conf" file.

Open a text editor such as xed and copy and paste either the text provided by Summerof69 or by Pjotr. Save the file as redshift.confinto .config in your home directory. Pjotr's file does away with the need to specify monitors (if you have only one) but you still have to alter the longitude and latitude to the ones applicable to where you live. Save after making that change.
The location co-ordinates are necessary to establish the time of day or night in your locality.
Linux Mint 20.0 Cinnamon - 64bit
Summerof69
Level 3
Level 3
Posts: 176
Joined: Sun Oct 25, 2015 11:52 am
Location: Mainland,Denmark

Re: Redshift and geoclue2 [WORKAROUND]

Post by Summerof69 »

deanr72 wrote:
Wed May 01, 2019 1:16 pm
In the meantime I've discovered f.lux. Does anyone know how this compare to Redshift?
Yes Redshift is inspired by f.lux. The programmer of Redshift thought that f.lux on Ubuntu lacked in both function and GUI, compared to the windows version.
For millions of years mankind lived much like the animals
Then something happened which unleashed the power of our imagination
We learned to talk
All we need to do is make sure we keep talking
Stephen Hawkin's voice on Keep Talking by Pink Floyd
Celmer
Level 1
Level 1
Posts: 3
Joined: Sat May 04, 2019 2:25 pm

Re: Redshift and geoclue2 [WORKAROUND]

Post by Celmer »

I found another workaround. You have to edit geoclue-demo-agent.desktop file. It is stored in /etc/xdg/autostart/.
Replace Exec=/usr/lib/geoclue-2.0/demos/agent with Exec=/usr/lib/geoclue-2.0/demos/where-am-i
.
Summerof69
Level 3
Level 3
Posts: 176
Joined: Sun Oct 25, 2015 11:52 am
Location: Mainland,Denmark

Re: Redshift and geoclue2 [WORKAROUND]

Post by Summerof69 »

Celmer wrote:
Sat May 04, 2019 2:45 pm
I found another workaround. You have to edit geoclue-demo-agent.desktop file. It is stored in /etc/xdg/autostart/.
Replace Exec=/usr/lib/geoclue-2.0/demos/agent with Exec=/usr/lib/geoclue-2.0/demos/where-am-i
.
Hi Celmer, is that workaround for Linux Mint?

I don't have anything "geoclue" in /etc/xdg/autostart, nor do I have "geoclue-demo-agent.desktop" anywhere.
For millions of years mankind lived much like the animals
Then something happened which unleashed the power of our imagination
We learned to talk
All we need to do is make sure we keep talking
Stephen Hawkin's voice on Keep Talking by Pink Floyd
Celmer
Level 1
Level 1
Posts: 3
Joined: Sat May 04, 2019 2:25 pm

Re: Redshift and geoclue2 [WORKAROUND]

Post by Celmer »

It's worked for me on Linux Mint 19.1. You have to install geoclue-2.0 package. Look at the installed files:
Screenshot from 2019-05-05 10-52-41.png
Summerof69
Level 3
Level 3
Posts: 176
Joined: Sun Oct 25, 2015 11:52 am
Location: Mainland,Denmark

Re: Redshift and geoclue2 [WORKAROUND]

Post by Summerof69 »

@Celmer: I have not installed the full geoclue.2 package, I'm using the default installation of geoclue.2 that comes with Linux Mint 19 :)
For millions of years mankind lived much like the animals
Then something happened which unleashed the power of our imagination
We learned to talk
All we need to do is make sure we keep talking
Stephen Hawkin's voice on Keep Talking by Pink Floyd
Celmer
Level 1
Level 1
Posts: 3
Joined: Sat May 04, 2019 2:25 pm

Re: Redshift and geoclue2 [WORKAROUND]

Post by Celmer »

Summerof69
Level 3
Level 3
Posts: 176
Joined: Sun Oct 25, 2015 11:52 am
Location: Mainland,Denmark

Re: Redshift and geoclue2 [WORKAROUND]

Post by Summerof69 »

Another thing regarding the geoclue service is, that the position retrieved by geoclue is the positon of my ISP.

Personally I think that the redshift.conf is not only a workaround but a better solution, at least on my network.
For millions of years mankind lived much like the animals
Then something happened which unleashed the power of our imagination
We learned to talk
All we need to do is make sure we keep talking
Stephen Hawkin's voice on Keep Talking by Pink Floyd
Post Reply

Return to “Software & Applications”