Comments (14)
Until you get to that, maybe you can at least hardcode it to something like ~/.config/guiscrcpy/
? (where ~
is the user home dir; this also works: $HOME/.config
), or make the config file hidden by adding a .
(dot) to the beginning of the filename? Users are generally unhappy with having apps creating files (that are not hidden) directly in their home folder.
from guiscrcpy.
@logix2 @lhanson The configuration file has been moved to XDG_CONFIG_HOME
if it is define, defaults to .config/guiscrcpy
. Please review and let me know
from guiscrcpy.
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
from guiscrcpy.
I don't know how C:\Users\xxx\AppData\ works on Windows, I rarely use it.
$XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.
There's also $XDG_DATA_HOME
for data files.
See this for more information: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
from guiscrcpy.
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..
from guiscrcpy.
from guiscrcpy.
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.
from guiscrcpy.
@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.
I shall close the issue in 2days
from guiscrcpy.
Does it simply save to $HOME/.config/guiscrcpy.cfg
? If so, it shouldn't be hardcoded as such, it should respect $XDG_CONFIG_HOME
if set.
from guiscrcpy.
It saves to $HOME/.config/guiscrcpy.cfg. I am not sure if $XDG_CONFIG_HOME is available on all Linux platforms, and I would not like to edit System variables as such. Probably I didn't understand @lhanson 's comment on this. @lhanson , could you please explain me?
from guiscrcpy.
@srevinsaju Sure. $XDG_CONFIG_HOME
is not typically set by default on Linux systems, and it's not required by the spec. If the user doesn't set it, the specification says that an application's configuration goes in a subdirectory under $HOME/.config
. In this case, it would be a directory called $HOME/.config/guiscrcpy
, e.g. the file would be called $HOME/.config/guiscrcpy/guiscrcpy.py
; or better yet, for less redundancy, $HOME/.config/guiscrcpy/config.py
.
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.
from guiscrcpy.
@lhanson, I understood the benfits of using $XDG_CONFIG_HOME
, but s this variable predefined in all the Linux distros, for example, in Raspbian, or in Gentoo, and other non-popular Linux Oses. I used ~/.config/guiscrcpy.cfg
because, its safer compared to $XDG_CONFIG_HOME
, because all the Linux distros have .config folder in their home directory. If $XDG_CONFIG_HOME
is predefined in all Linux distros, including Android Linux, I shall implement it. I am planning to implement guiscrcpy for Android as well, which includes Android to Android screen mirroring as well.
Please advise me on $XDG_CONFIG_HOME
variable. I would love to know more on this!
from guiscrcpy.
$XDG_CONFIG_HOME
is not predefined on any distro I know of. The point of the specification is to assume a default (~/.config/guiscrcpy/
) until/unless the user wants it somewhere else, at which point they have the option to manually set $XDG_CONFIG_HOME
, and compliant apps should respect that.
Hardcoding it to ~/.config
is not safer because it still ignores the user's wishes if they don't want it there.
I suggest reading over the spec, it's not that long or complicated: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
from guiscrcpy.
Hmm, thanks @lhanson for the info, will fix it for the next Linux Release v1.11. As running guiscrcpy config flle from ~/.config
is not very tedious, I will keep this issue open, until I commit the $XDG_CONFIG_HOME
. Thank you
from guiscrcpy.
Related Issues (20)
- [BUG] guiscrcpy.exe won't start HOT 3
- BUG guiscrcpy report HOT 4
- [BUG] scrcpy gave me a error when starting
- Doesn't download the music
- [BUG] Won't open and mount a disk volume for me. Really annoying!
- BUG both tablets not recognized
- [BUG] Does not support m1 mac. HOT 4
- [BUG] CANT CROP (Steam deck)
- [BUG]qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. HOT 1
- could not install guiscrpy well wtih the scrpy. how do i delete in order to install a new one?[BUG]
- [BUG] Software freezes on loading logo
- [BUG] ModuleNotFoundError coloredlogs, but python-coloredlogs is installed HOT 1
- [BUG] "START SCRCPY" crashes the app HOT 1
- Guiscrcpy screen not displaying HOT 2
- [forwarded audio not getting recorded]
- [BUG]
- [BUG] Guiscrcpy wont show android device HOT 2
- [BUG] AppImage missing libcrypt.so.1
- Mirrored screen not loading HOT 4
- [BUG] arguments passed to setSizePolicy are not in the expected format HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from guiscrcpy.