osmin icon indicating copy to clipboard operation
osmin copied to clipboard

Follow the XDG Base directory specification for storing data like map files

Open PureTryOut opened this issue 1 year ago • 10 comments

Right now osmin makes 2 folders in my home folder, "Maps" and "osmin", while those should really be located in $XDG_DATA_HOME/osmin (or ~/.local/share/osmin if the $XDG_DATA_HOME environment variable isn't set).

You can read the full specification on where to store any kind of program data/config file here or read a shortened version on the Arch Linux wiki.

PureTryOut avatar Mar 24 '23 10:03 PureTryOut

Agree. But the application is intended for the end user, who does not know the XDG standard. Finding its data (gpx files, favorites, styles and maps) could be a nightmare if we store them in hidden path. The simplest is the best without breaking your head.

janbar avatar Aug 10 '23 08:08 janbar

Why would "the end user" need to know where the data is stored anyway? They should have no reason to start looking for it. And if they did, it would be best if all applications stored it in the same fashion, thus following the standard.

PureTryOut avatar Aug 10 '23 10:08 PureTryOut

Not liking a cluttered home directory, and accepting @janbar's comment, could we have a Setting so that the user could choose the location?

AndyM48 avatar Oct 03 '23 12:10 AndyM48

(which then defaults to the XDG location please)

PureTryOut avatar Oct 03 '23 12:10 PureTryOut

At least for non-Android. I expected to find map files under ~/.local/share/osmin/.

I would also prefer if the config was at ~/.config/osmin.conf or ~/.config/osmin/osmin.conf, $XDG_CONFIG_HOME. The current ~/.config/io.github.janbar/osmin.conf is quite Androidy (or Java?), no other program I have installed does that to its configuration location.

Having just installed osmin, said the above and opened a couple of issues, I want to add that I so far like the overall UX very much.

omnivagant avatar Oct 06 '23 09:10 omnivagant

I don't think ~/.config/io.github.janbar/osmin.conf is actually a problem. It's the "fully-qualified" name and is actually becoming normal on desktop Linux as well due to for example Flatpak using that scheme. For Osmin it might not be much of a problem but in general it is used to prevent conflicts between app names and is very effective at that.

PureTryOut avatar Jul 18 '24 19:07 PureTryOut

From version 1.11.0, I reviewed the location of files owned by osmin.

  • On desktop all files are moved to the folder $HOME/osmin . The old folder ~/Maps is therefore no longer used.
  • On Android, all files are stored in the internal storage. Unfortunately, Maps cannot be accessible due to new security rules of Google (Android >= 12). All others resources are available in the app folder using an USB connection, i.e GPX etc.

janbar avatar Jul 20 '24 10:07 janbar

Well 1 folder in $HOME is better than 2, but even better would still be 0 😅

Again, I wonder why a user would need to access these files outside of the app. And if they really do a better option might be adding a button in the app to open a file manager directly to the location.

PureTryOut avatar Jul 20 '24 21:07 PureTryOut

Yo, this folder is required to allow user to add, change, delete, brief manage ...

  • GPX --> install new or backup the gpx files.
  • maps --> add/remove map databases, built by itself or downloaded from an other provider.
  • voices --> add/remove voices built by itself or downloaded from an other provider.
  • resources/favorites.csv --> to load a bulk of favorites or manage them with a better tool, or backup.
  • resources/*.json --> change the provider for map, tiles, voices, or hillshade

Finally, installing OSMIN in desktop computer does not make sense ! It is an app for navigation, and should be installed in a mobile device, having GPS, compass, and sure a battery. The only use for the desktop installation is to develop it, or perhaps to have a view of maps and GPX tracks, but this is a very limited use.

janbar avatar Jul 21 '24 13:07 janbar

I never said I'd consider installing the application on desktops, I am thinking of mobile. Linux mobile that is. From this comment I'm assuming you consider Linux (non-Android) support at all only for convenience of developing and thus do not care about following the standards there? That would be a shame, I consider Osmin the best option at the moment for turn-by-turn navigation on mobile Linux.

I get your point that it can be useful for the end-user to access the files, but like I said I consider adding an button to just open the file manager there a better solution. And for importing a GPX file an in-app solution to browse the filesystem to add one could be considered more user-friendly as well. Also, ~/.local/share/osmin is not that hard to find. Wouldn't you consider manually putting files in the right place a use-case for advanced users? They would have no problem finding the right location as long as that location follows known standards.

PureTryOut avatar Jul 21 '24 21:07 PureTryOut