jonls / redshift

Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night.
http://jonls.dk/redshift
GNU General Public License v3.0
5.91k stars 429 forks source link

erroneous documentation about configuration file #878

Open farvardin opened 1 year ago

farvardin commented 1 year ago

Describe the bug

The Readme states:

"The configuration file should be saved in the following location depending on the platform:

Linux/macOS: ~/.config/redshift/redshift.conf (if the environment variable XDG_CONFIG_HOME is undefined) or ${XDG_CONFIG_HOME}/redshift/redshift.conf (if XDG_CONFIG_HOME is defined).

"

https://github.com/jonls/redshift

but it won't work if redshift.config is located into ~/.config/redshift:

"cp redshift.conf ~/.config/redshift/"

it will only work if the conf is ~/.config/redshift.conf instead

as correctly documented in http://jonls.dk/redshift/#configuration-file

yllekz commented 1 year ago

Also curious about this. I always kinda suspected my redshift.conf file wasn't actually doing anything, so I'd also like to know which path is the right one.

Update: oh wow holy crap yeah it definitely DOESN'T work at the documented path of ~/.config/redshift/redshift.conf and DOES work at ~/.config/redshift.conf. I tested with a very extreme conf file in the latter directory while deleting/removing my original (and seemingly ineffective) conf file in the former directory.

So yeah. Official documentation is wrong/bad.

EngelPika32 commented 1 year ago

To help a little: You can use redshift -v -p (in the console) to check the configuration redshift would use.

~/.config/redshift.conf and ~/.config/redshift/redshift.conf both work for me. (XDG_CONFIG_HOME unset.)
Changelog dates back to https://github.com/jonls/redshift/releases/tag/v1.12 (the sub-dir is used preferable since then), though the website seems outdated about this.

Other things to look into could be: Permissions, Typos, env, Paths?

I'd suggest to provide some setup information (aka. complete the issue template) For example, this might be needed at minimum:

**Software versions (please complete the following information):**
 - OS: [e.g. Linux/Windows/macOS]
 - Redshift version: [e.g. 1.11, run `redshift -V` in a terminal]
 - Distribution: [e.g. Ubuntu]
 - Redshift installed from: [e.g. "using apt-get", "built from source"]

PS: I'm not a maintainer and just stumbled over this issue while browsing :woman_shrugging:

srappel commented 1 year ago

I can reproduce this issue on Linux Mint 21.

If I save my configuration as ~/.config/redshift/redshift.conf and run redshift -p, it prints the default actions (4500k, geoclue2, etc.)

If I save my configuration as ~/.config/redshift.conf and run redshift -p, my configurations are printed as defined in my .conf.

farvardin commented 1 year ago

I'd suggest to provide some setup information (aka. complete the issue template) For example, this might be needed at minimum:

I've tried again, with the config in ~/.config/redshift.conf and in ~/.config/redshift/redshift.conf with redshift 1.12 on Linux Mint 21.2

I can find the matching informations from redshift -p -v in both case. If I remove the redshift.conf from any of those location, then it will go to default (geoclue2 and 6500K / 4500K)

Maybe redshift / the distribution had been upgraded since then...

@srappel do you have the same redshift version? (1.12)

srappel commented 1 year ago

do you have the same redshift version? (1.12)

Yes, but I have not updated LM to 21.2 yet.

paccerdk commented 11 months ago

I can reproduce this issue on Linux Mint 21.

If I save my configuration as ~/.config/redshift/redshift.conf and run redshift -p, it prints the default actions (4500k, geoclue2, etc.)

If I save my configuration as ~/.config/redshift.conf and run redshift -p, my configurations are printed as defined in my .conf.

I couldn't understand why redshift wouldn't read my configuration also.

Turns out that this is a bug with AppArmor not allowing redshift to read the configuration if its located in ~/.config/redshift/redshift.conf

However, This is is the correct, new path, but its affect by this: https://github.com/jonls/redshift/issues/820#issuecomment-899798987. (more info: https://github.com/jonls/redshift/issues/850#issuecomment-1193378198)

Luckily, the previous (now deprecated) path ~/.config/redshift.conf still appear to be working without problems.

This should probably be mentioned in the readme until the bug is fixed