Saturday, September 30, 2023
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 740  / 5 Months ago, tue, may 23, 2023, 12:41:28

I am kind of a beginner with Linux and just started using pass for managing my passwords. I try to keep my home directory rather clean but pass created 2 dotfiles (.gnupg and .password-store) that I don't know how to move to other directories (.local / .config / .cache). I know I can link them, but it doesn't solve the problem of dotfiles in ~/.


$ ls -a
.cache
.config
Desktop
Documents
Downloads
.gnupg
.local
Music
.password-store
Pictures
Videos

Specified problem: is there a way to move .gnupg and .password-store to another directory and still use them?


There is PREFIX variable in binary that defines it but I do not really know how to change it.


PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}"

More From » home-directory

 Answers
5

The meaning of this bit of shell code:


PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}"

is: set PREFIX to the value of $PASSWORD_STORE_DIR, using the default of $HOME/.password-store if $PASSWORD_STORE_DIR is not set.


That is, you can set the environment variable PASSWORD_STORE_DIR to whatever path you want to set PREFIX to the desired value. So, say, in your .profile or wherever you prefer to manage environment variables, set:


export PASSWORD_STORE_DIR="$HOME/.config/password-store"

This is documented. Check the man 1 pass:


ENVIRONMENT VARIABLES
PASSWORD_STORE_DIR
Overrides the default password storage directory.

Where applications provide support for moving dot files, feel free to do so. After all, they advertise this support, and if it doesn't work, it's a bug that's likely to be fixed.




The same goes for gpg, with the GNUPGHOME environment variable:


GNUPGHOME
If set directory used instead of "~/.gnupg".

[#1218] Thursday, May 25, 2023, 5 Months  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
iriousutur

Total Points: 321
Total Questions: 112
Total Answers: 106

Location: Sweden
Member since Mon, Dec 7, 2020
3 Years ago
iriousutur questions
Sun, Apr 9, 23, 02:48, 6 Months ago
Fri, Oct 21, 22, 02:47, 1 Year ago
Mon, May 9, 22, 00:01, 1 Year ago
Mon, Nov 1, 21, 20:59, 2 Years ago
;