Adding pass support.
This commit is contained in:
		
							parent
							
								
									0595964aea
								
							
						
					
					
						commit
						36794b4d6a
					
				| 
						 | 
					@ -101,7 +101,7 @@
 | 
				
			||||||
       ;;macos                 ; MacOS-specific commands
 | 
					       ;;macos                 ; MacOS-specific commands
 | 
				
			||||||
       magit                   ; a git porcelain for Emacs
 | 
					       magit                   ; a git porcelain for Emacs
 | 
				
			||||||
       make                    ; run make tasks from Emacs
 | 
					       make                    ; run make tasks from Emacs
 | 
				
			||||||
       ;;pass                  ; password manager for nerds
 | 
					       pass                    ; password manager for nerds
 | 
				
			||||||
       ;;pdf                   ; pdf enhancements
 | 
					       ;;pdf                   ; pdf enhancements
 | 
				
			||||||
       ;;prodigy               ; FIXME managing external services & code builders
 | 
					       ;;prodigy               ; FIXME managing external services & code builders
 | 
				
			||||||
       ;;rgb                   ; creating color strings
 | 
					       ;;rgb                   ; creating color strings
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										40
									
								
								zsh/modules/bin/fzf-pass
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										40
									
								
								zsh/modules/bin/fzf-pass
									
									
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -0,0 +1,40 @@
 | 
				
			||||||
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cd "$HOME/.password-store" || exit 1
 | 
				
			||||||
 | 
					PASSFILE=$(tree -Ffi | grep '.gpg' | sed 's/.gpg$//g' | sed 's/^..//' | fzf)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -z "$PASSFILE" ]; then
 | 
				
			||||||
 | 
						exit 0
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					PASSDATA="$(pass "$PASSFILE")"
 | 
				
			||||||
 | 
					USRNAME="$(echo "$PASSDATA" | grep "username:" | cut -d' ' -f2-)"
 | 
				
			||||||
 | 
					PASS="$(echo "$PASSDATA" | head -n 1)"
 | 
				
			||||||
 | 
					URL="$(echo "$PASSDATA" | grep url: | cut -d' ' -f2-)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					RESP=$(cat <<EOF | fzf
 | 
				
			||||||
 | 
					Autotype
 | 
				
			||||||
 | 
					Username
 | 
				
			||||||
 | 
					Password
 | 
				
			||||||
 | 
					URL
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					swaymsg move container to workspace 9
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					case "$RESP" in
 | 
				
			||||||
 | 
						Autotype)
 | 
				
			||||||
 | 
							ydotool type "$USRNAME" && ydotool key Tab && ydotool type "$PASS" && ydotool key Enter
 | 
				
			||||||
 | 
							;;
 | 
				
			||||||
 | 
						Username)
 | 
				
			||||||
 | 
							ydotool type "$USRNAME"
 | 
				
			||||||
 | 
							;;
 | 
				
			||||||
 | 
						Password)
 | 
				
			||||||
 | 
							ydotool type "$PASS"
 | 
				
			||||||
 | 
							;;
 | 
				
			||||||
 | 
						URL)
 | 
				
			||||||
 | 
							ydotool type "$URL"
 | 
				
			||||||
 | 
							;;
 | 
				
			||||||
 | 
						*)
 | 
				
			||||||
 | 
							exit 1
 | 
				
			||||||
 | 
					esac
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user