foucault / nvfancontrol

NVidia dynamic fan control for Linux and Windows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nvfancontrol doesn't read system-wide configuration file

hubutui opened this issue · comments

I created /etc/xdg/nvfancontrol.conf, but nvfancontrol still warning:

WARN - Could not read configuration file "/home/USER/.config/nvfancontrol.conf": No such file or directory (os error 2); using default curve

Well, this is definitely a bug thanks for reporting it! However it's slightly more complicated than I initially expected. I'm trying to keep the code as much as portable between Windows and Linux (ie. XDG). The thing is the concept of "global" config directory is different between Windows and XDG. The "local configuration directory" is more or less analogous to both operating systems but Windows and XDG treat the "global configuration directory" differently. On Windows the closest to this is again %APPDATA%, which is again what we're using here (so in a sense the "local" and "global" directory are essentially the same). On XDG-based setups $XDG_CONFIG_DIRS does indeed default to /etc/xdg however this is not necessarily the case as $XDG_CONFIG_DIRS can be colon-separated list (similar to $PATH) and the configuration file can reside in any of them essentially. In any case I'll probably handle the XDG case separately if the initial $XDG_CONFIG_HOME case fails to find the file.

That being said, the global configuration was meant to be a way for different users in the system to share a common curve for the GPU and not to run the nvfancontrol service globally. Due to the way the NVIDIA driver interacts with X this is guaranteed to lead to complications.