Opened 14 years ago
Last modified 9 years ago
#6664 closed enhancement
Josm config files should be in $XDG_CONFIG_HOME instead of ~/.josm — at Version 7
| Reported by: | anonymous | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | 16.10 |
| Component: | Core | Version: | |
| Keywords: | Cc: | spam-josmtrac@…, AMDmi3 |
Description (last modified by )
Josm configuration and user files should be in $XDG_CONFIG_HOME and $XDG_DATA_HOME respectively, as described in the XDG Base Directory Specification: <http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html>.
Josm stores its user files in ~/.josm, instead. This clutters the $HOME directory and makes it hard to backup Josm's settings in a easy way.
Change History (7)
follow-up: 3 comment:1 by , 14 years ago
follow-up: 4 comment:2 by , 14 years ago
So it would look like this (just using the default paths for simplicity):
~/.josm/motd.html --> ~/.cache/josm/
~/.josm/plugins/site-josm.openstreetmap.de-_plugins.txt
--> ~/.cache/josm/
~/.josm/mirror_http___planet.openstreetmap.org_users_agreed_users_agreed.txt
--> ~/.cache/josm/
(and other mirror files the same)
~/.josm/wms-cache --> ~/.cache/josm/wms
~/.josm/imagery/cache --> ~/.cache/josm/imagery
~/.josm/autosave --> ~/.local/share/josm/
~/.josm/plugins/*.jar --> ~/.local/share/josm/plugins/
~/.josm/preferences --> ~/.config/josm/
Same applies for plugins that currently put all their stuff in ~/.josm/plugins/PLUGIN_NAME.
---
Not sure if it is a particularly good idea, though. Sometimes JOSM breaks due to a corrupt cache file or a certain configuration option triggers a serious bug. Then we tell people to simply remove their ~/.josm or %appdata%/JOSM folder respectively. For a stable software, this kind of radical measure shouldn't be necessary. But JOSM is constantly evolving and we do our best, but we don't have enough man power to care for super-stable interfaces.
Now, when configuration, data and cache files are spread over multiple folders, it is cumbersome to reset the state completely. It is much simpler if everything is at one place.
comment:3 by , 14 years ago
Replying to olejorgenb:
A workaround is to run josm as:
APPDATA=$XDG_CONFIG_HOME java -jar josm.jar
I'd write java -Djosm.home=$XDG_CONFIG_HOME -jar dist/josm.jar.
comment:4 by , 14 years ago
Replying to bastiK:
Same applies for plugins that currently put all their stuff in
~/.josm/plugins/PLUGIN_NAME.
Wouldn't it be better to expose some API to the plugins like File getConfigDir(), File getDataDir(), File getCacheDir()?
Not sure if it is a particularly good idea, though. Sometimes JOSM breaks due to a corrupt cache file or a certain configuration option triggers a serious bug. Then we tell people to simply remove their ~/.josm or %appdata%/JOSM folder respectively. For a stable software, this kind of radical measure shouldn't be necessary. But JOSM is constantly evolving and we do our best, but we don't have enough man power to care for super-stable interfaces.
Now, when configuration, data and cache files are spread over multiple folders it is cumbersome to reset the state completely. It is much simpler if everything is at one place.
Wouldn't instead be easier to say "First remove ~/.cache/josm. If that did not work, try removing ~/.config/josm. Is the problem solved now? Did you need to remove the config or was the cache enough?" You would get much better bug replies with that.
I wouldn't mind removing only my cache first, instead of losing all my configuration.
Anyway, if you need a quick workaround, please use java -Djosm.home=${XDG_DATA_HOME:-~/.local/share/} -jar dist/josm.jar, so that all the files end up in the DATA dir, not CONFIG dir (that is often backed up and treated as a collection text files).
comment:5 by , 14 years ago
I could imagine, that we have getConfigDir(), getDataDir() and getCacheDir() in JOSM core and they all point to ~/.josm or %APPDATA%/JOSM by default. In addition to -Djosm.home there would be 3 more switches to configure these folders as desired.
comment:6 by , 14 years ago
| Type: | defect → enhancement |
|---|
comment:7 by , 14 years ago
| Description: | modified (diff) |
|---|



A workaround is to run josm as: