-
-
Notifications
You must be signed in to change notification settings - Fork 216
Configuration file should not be created in the $HOME directory on Linux #7
Comments
Is XDG_CONFIG_HOME works same as C:\Users\xxx\AppData\ in Windows. The configuration file is not created by the user, but it is created by the python file to save the information. If the user would like to edit the configuration file, one may, the instructions on the config file is in the main.py. I shall transfer it to the README.md |
I don't know how C:\Users\xxx\AppData\ works on Windows, I rarely use it.
There's also See this for more information: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html |
I have to restructure the code for this, applying for both Windows and Linux. The user home directory was easier for me,because on Linux, it points to ~/guiscrcpy.cfg and on Windows, it points to C:/Users//guiscrcpy.cfg The commit fixing these will be released shortly with the fix for main window resizing problem, hidden landscape button, restructured debug statement with "LOG: ***" , or "ERR: ***" to create a uniformity.. |
Until you get to that, maybe you can at least hardcode it to something like |
Hmm, then I shall chose the .config file both on Windows and Mac.
… |
No need to guess on a default directory, the spec is clear on what the defaults are if the user hasn't specified an alternate and many libraries exist to derive it for you. |
@logix2, guiscrcpy.cfg file is moved to .config in home dir on Linux and AppData/Local on Windows, Home directory on Mac. Marking this as fixed, you may try it. |
Does it simply save to |
@srevinsaju Sure. So users don't need to do anything if they are okay with the defaults or don't care, but they're able to express a different preference if they choose to. It's best not to hardcode this logic in your code, I'd suggest using something like the xdg module; that way, you can just look up the path from the module and it handles the logic for you. |
@lhanson, I understood the benfits of using |
Hardcoding it to I suggest reading over the spec, it's not that long or complicated: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html |
Hmm, thanks @lhanson for the info, will fix it for the next Linux Release v1.11. As running guiscrcpy config flle from |
guiscrcpy currently creates the
guiscrcpy.cfg
file in the user's home directory. This is not the correct way to do it. Instead, maybe you can follow the freedesktop specifications and use something like$XDG_CONFIG_HOME/guiscrcpy
and save it there ($XDG_CONFIG_HOME
defaults to~/.config/
if it's empty by default).Also, I don't see any documentation as to what I could specify in the
guiscrcpy.cfg
configuration file.The text was updated successfully, but these errors were encountered: