monero-project / monero-gui

Monero: the secure, private, untraceable cryptocurrency
Other
1.74k stars 769 forks source link

Standardize file locations on Linux #2291

Open sanderfoobar opened 5 years ago

sanderfoobar commented 5 years ago

GUI currently uses the following files and directories:

Quoting rnhmjoj

The idea of the XDG spec is to allow the separation of configuration files, user generate data and cache files. The main advantage is that it makes the locations configurable; also it's easier backup by simply selecting the directory (like $XDG_DATA_HOME/monero), without worrying about excluding temporary files.

I get the point about fragmentation but monero-gui is already using XDG_CACHEHOME for the qml cache, and the log file certainly belong to this category. An "uninstall" procedure could simply be to delete: $XDG{CACHE,DATA,CONFIG}_HOME/monero-project

This issue proposes to discuss that GUI related files could go into $XDG_{CACHE,DATA,CONFIG}_HOME (except for ~/.bitmonero) so that it follows the XDG spec.

sanderfoobar commented 5 years ago

I think an exception can also be made for the wallet directory, which currently is ~/Monero/wallets. This would become /home/dsc/.local/share/Monero/wallets but I think that ~/Documents/Monero is more appropriate.

@rnhmjoj thoughts?

rnhmjoj commented 5 years ago

I think an exception can also be made for the wallet directory

I agree, since users more often access the wallet it's better to keep the directory visible, so ~/Monero is fine in my opinion. Besides monero let you choose where to save the wallet at the start.

On my computer the cache and configuration files are

$XDG_CONFIG_HOME/monero-project/monero-core
$XDG_CACHE_HOME/monero-project/monero-core

so they seems already compliant. I would simplify monero-project/monero-core to just monero, which I think is a bit ugly. I suspect this is added by Qt when setting the company/project name. The tricky part will be changing .bitmonero because it's also used by the monero daemon. Summing it up, I propose something like this:

$XDG_CONFIG_HOME/monero/ -> configuration files
$XDG_CACHE_HOME/monero/ -> qml cache, daemon and gui logs
$XDG_DATA_HOME/monero/ -> blockchain data
$HOME/Monero -> wallets

Anyway, if you intend to change the locations I'd suggest to implement a check for the old locations (like .bitmonero) and, if needed, move the content to the new location. This should make the transition painless. Also, thank you for considering the idea.

colemickens commented 4 years ago

Maybe the wallet location could also be configurable with a line in one of the configuration files, as well.

oxalica commented 3 years ago

GUI seems also leave ~/.shared-ringdb in home. It should also be moved to $XDG_DATA_HOME or $XDG_CACHE_HOME.

xeruf commented 3 years ago

That might belong into XDG_STATE_HOME now that that is out

xeruf commented 3 years ago

~/Documents/Monero is definitely not an appropriate path for anything. I interact with many programs in $XDG_DATA_HOME regularly without issues. At least use XDG_DOCUMENTS_DIR (obtainable via xdg-user-dir DOCUMENTS) as prefix then.

tiritto commented 1 year ago

As of version 0.18.1.2, this is still an issue.