Use proper preferences directories on desktop
See original GitHub issueIssue details
Currently, by default, libGDX Preferences are saved to ~/.prefs
on Linux, which is nonstandard. The XDG Base Directory specification suggests that, to determine where to write configuration files to, programs should:
- First try the environment variable
$XDG_CONFIG_HOME
. - If the environment variable is unset, default to
$HOME/.config
.
This standard serves to make the home directory cleaner, and normalize the way different programs save their configurations.
If this is adopted in libGDX, it would likely be necessary to check the (then legacy) ~/.prefs
path in addition to the above two paths, as to not break existing configurations.
This is somewhat similar to #6367, but not the same as this pertains to preferences rather than local storage.
Please select the affected platforms
- Android
- iOS
- HTML/GWT
- Windows
- Linux
- MacOS
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Ways to organize files on your Mac desktop - Apple Support
Organize items into folders You can quickly group items on the desktop into folders. Select all the items you want to group, Control-click...
Read more >Working with Windows Settings Preference Items Using the ...
In the console tree under User Configuration, expand the Preferences folder, and then expand the Windows Settings folder. Right-click the ...
Read more >How to Adjust Folder Settings in Windows 7 - YouTube
This tutorial will show you how to adjust the folder settings in Windows 7.Don't forget to check out our site http://howtech.tv/ for more ......
Read more >Setting Folder Preferences
To access the Folders preference tool, click Launch, then choose Preferences -> Desktop Preferences -> Folders. Alternatively, you can use the File ...
Read more >The Desktop and Finder Preferences - Mac OS X - InformIT
Launch System Preferences manually. It is located in the system's Applications folder (path: /Applications/System Preferences). After System ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
While at it, it’d also be cool to save prefs in %appdata% on windows and in ~/Library/Preferences on macos. As those are also more recommended to save program preferences in.
I agree with @lyze237. The backend/platform can already be queried by calling
Gdx.app.getType()
and the OS can be determined viaUIUtils
, so there is no need for this class.Why would the core part of the app need to know where the preferences are saved on desktop? I think this is an implementation detail of
Lwjgl3Preferences
(as well asLwjgl2Preferences
andHeadlessPreferences
) and doesn’t belong in core.Also the Android and iOS stuff is unnecessary as those backends don’t save their preferences in certain directories, but rather use some platform specific stuff, and in addition, I don’t think
System.getProperty("os.name")
works on GWT.I think what Lyze meant is that there are already checks in core (i.e.,
Gdx.app.getType()
,UIUtils
) and that is all well, but the additional methods (getUserDataDirectory
,getUserConfigDirectory
) don’t belong in core.