rofipass
This commit is contained in:
		
							parent
							
								
									7c9abb835c
								
							
						
					
					
						commit
						df4ecdd275
					
				@ -42,6 +42,7 @@ bindsym $mod+Shift+q kill
 | 
				
			|||||||
# start dmenu (a program launcher)
 | 
					# start dmenu (a program launcher)
 | 
				
			||||||
# bindsym $mod+d exec dmenu_run
 | 
					# bindsym $mod+d exec dmenu_run
 | 
				
			||||||
bindsym $mod+d exec rofi -show run
 | 
					bindsym $mod+d exec rofi -show run
 | 
				
			||||||
 | 
					bindsym $mod+p exec ~/etc/rofipass.sh --type
 | 
				
			||||||
# There also is the (new) i3-dmenu-desktop which only displays applications
 | 
					# There also is the (new) i3-dmenu-desktop which only displays applications
 | 
				
			||||||
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
 | 
					# shipping a .desktop file. It is a wrapper around dmenu, so you need that
 | 
				
			||||||
# installed.
 | 
					# installed.
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										24
									
								
								rofipass.sh
									
									
									
									
									
										Executable file
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										24
									
								
								rofipass.sh
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,24 @@
 | 
				
			|||||||
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					shopt -s nullglob globstar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typeit=0
 | 
				
			||||||
 | 
					if [[ $1 == "--type" ]]; then
 | 
				
			||||||
 | 
						typeit=1
 | 
				
			||||||
 | 
						shift
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					prefix=${PASSWORD_STORE_DIR-~/.password-store}
 | 
				
			||||||
 | 
					password_files=( "$prefix"/**/*.gpg )
 | 
				
			||||||
 | 
					password_files=( "${password_files[@]#"$prefix"/}" )
 | 
				
			||||||
 | 
					password_files=( "${password_files[@]%.gpg}" )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					password=$(printf '%s\n' "${password_files[@]}" | rofi -dmenu -p pass "$@")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[[ -n $password ]] || exit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [[ $typeit -eq 0 ]]; then
 | 
				
			||||||
 | 
						pass show -c "$password" 2>/dev/null
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						xdotool - <<<"type --clearmodifiers -- $(pass show "$password" | head -n 1)"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user