]> www.git.dmfe.net Git - dotfiles/commitdiff
Add functions for password stores.
authorDmitry Fedotov <dm.fe@yandex.ru>
Sat, 14 Dec 2024 19:38:57 +0000 (22:38 +0300)
committerDmitry Fedotov <dm.fe@yandex.ru>
Sat, 14 Dec 2024 19:38:57 +0000 (22:38 +0300)
shell/aliases/00-aliases
shell/bash_completion [new file with mode: 0644]
shell/functions/00-functions

index 03da67bb1580c97ed78dbec8367f802d3b65e055..e532ecee4dba44fdae0aca7c8369d6dce3df079c 100644 (file)
@@ -28,3 +28,7 @@ alias arangos="sudo /etc/init.d/arangodb stop"
 # docker
 alias d="docker"
 alias dc="docker-compose"
+
+# pass
+alias passdmfe="PASSWORD_STORE_DIR=~/.password-store pass"
+alias passivfe="PASSWORD_STORE_DIR=~/pwd-stores/vania-password-store pass"
diff --git a/shell/bash_completion b/shell/bash_completion
new file mode 100644 (file)
index 0000000..e2b18f5
--- /dev/null
@@ -0,0 +1,11 @@
+source /usr/share/bash-completion/completions/pass
+
+_passdmfe(){
+    PASSWORD_STORE_DIR=~/.password-store/ _pass
+}
+complete -o filenames -o nospace -F _passdmfe passdmfe
+
+_passivfe(){
+    PASSWORD_STORE_DIR=~/pwd-stores/vania-password-store/ _pass
+}
+complete -o filenames -o nospace -F _passivfe passivfe
index 8a634054fb31f4e039a871a3e7343cc01fcd8919..fee8bb176868402e0825d6869bb508fcafb4a2c5 100644 (file)
@@ -23,3 +23,12 @@ function passf() {
   pass find $1
 }
 
+function pass_dmfe() {
+  local choice=$(find $HOME/.password-store -type f -name '*.gpg' -printf '%P\n' | sed 's/\.gpg//' | fzf)
+  [[ -n "$choice" ]] && passdmfe $choice | xclip -i -sel p -f | xclip -i -sel c
+}
+
+function pass_ivfe() {
+  local choice=$(find $HOME/pwd-stores/vania-password-store -type f -name '*.gpg' -printf '%P\n' | sed 's/\.gpg//' | fzf)
+  [[ -n "$choice" ]] && passivfe $choice | xclip -i -sel p -f | xclip -i -sel c
+}