[PATCH] Add XDG Base Directory support

Allan Odgaard lists+pass at simplit.com
Wed May 27 02:02:46 CEST 2020

On 22 May 2020, at 4:26, Nicolai Dagestad wrote:

> If people can take a look at this and see if it breaks something we 
> could
> maybe advance a little on this debat.

The way you find the password store is inconsistent across these 

Some will check `~/.password-store` even when `PASSWORD_STORE_DIR` is 
set, others will not.

Some will check `~/.local/share/password-store` even when 
`XDG_DATA_HOME` is set, others will not.

This idea about migrating to XDG Base Directory with backwards 
compatibility seems messy: The great thing about `pass` is the 
simplicity of the password storage, in this patch, the fish completion 
file now use a 12 line helper function to find the location of where 
files are stored.

I would suggest:

1. Write an exact specification of how one should obtain the password 
2. Add a `prefix` command to `pass` that output this directory, and use 
in the helper scripts.
3. For helper scripts that cannot call `$(pass prefix)`: write the 
simplest possible code to obtain the directory (conformant to the 
specification) and use that consistently across them all.

Regarding the first item: It should also cover the case where no 
directory is found, i.e. what would `pass init` use?

More information about the Password-Store mailing list