This commit is contained in:
Gabriel Ebner 2015-05-28 14:01:44 +02:00
parent 7c9abb835c
commit df4ecdd275
2 changed files with 25 additions and 0 deletions

View File

@ -42,6 +42,7 @@ bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
# bindsym $mod+d exec dmenu_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
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.

24
rofipass.sh Executable file
View 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