use rofi-pass
This commit is contained in:
parent
9275ae1f26
commit
f6fd1209ac
1
Makefile
1
Makefile
@ -3,6 +3,7 @@ FILES = bashrc bash_profile vimrc zshrc gitconfig screenrc commonshrc liquidprom
|
|||||||
i3/config i3status.conf msmtprc spacemacs emacs.d mbsyncrc authinfo \
|
i3/config i3status.conf msmtprc spacemacs emacs.d mbsyncrc authinfo \
|
||||||
config/qutebrowser config/nvim/init.vim ideavimrc agignore \
|
config/qutebrowser config/nvim/init.vim ideavimrc agignore \
|
||||||
config/khal config/vdirsyncer/config config/khard \
|
config/khal config/vdirsyncer/config config/khard \
|
||||||
|
config/rofi-pass \
|
||||||
$(wildcard sbt/0.13/*.sbt sbt/0.13/plugins/*.sbt)
|
$(wildcard sbt/0.13/*.sbt sbt/0.13/plugins/*.sbt)
|
||||||
|
|
||||||
.PHONY: install clean check
|
.PHONY: install clean check
|
||||||
|
59
config/rofi-pass/config
Normal file
59
config/rofi-pass/config
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
# permanently set alternative root dir
|
||||||
|
# root=/path/to/root
|
||||||
|
|
||||||
|
# rofi command. Make sure to have "$@" as last argument
|
||||||
|
_rofi () {
|
||||||
|
rofi -z -i -width 700 -no-levenshtein-sort "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# fields to be used
|
||||||
|
URL_field='url'
|
||||||
|
USERNAME_field='username'
|
||||||
|
AUTOTYPE_field='autotype'
|
||||||
|
|
||||||
|
# delay to be used for :delay keyword
|
||||||
|
delay=2
|
||||||
|
|
||||||
|
## Programs to be used
|
||||||
|
# Editor
|
||||||
|
EDITOR='emacs'
|
||||||
|
|
||||||
|
# Browser
|
||||||
|
BROWSER='xdg-open'
|
||||||
|
|
||||||
|
## Misc settings
|
||||||
|
|
||||||
|
default_do='autopass' # copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl
|
||||||
|
auto_enter='false'
|
||||||
|
notify='false'
|
||||||
|
passlength='20'
|
||||||
|
|
||||||
|
# seconds to wait before re-opening showEntry-menu
|
||||||
|
# after autotyping an entry. Set to "off" to disable
|
||||||
|
count=2
|
||||||
|
|
||||||
|
# color of the help messages
|
||||||
|
# leave empty for autodetection
|
||||||
|
help_color=""
|
||||||
|
|
||||||
|
# Clipboard settings
|
||||||
|
# Possible options: primary, clipboard, both
|
||||||
|
clip=primary
|
||||||
|
|
||||||
|
# Custom Keybindings
|
||||||
|
autotype="Alt+1"
|
||||||
|
type_user="Alt+2"
|
||||||
|
type_pass="Alt+3"
|
||||||
|
open_url="Alt+4"
|
||||||
|
copy_name="Alt+u"
|
||||||
|
copy_url="Alt+l"
|
||||||
|
copy_pass="Alt+p"
|
||||||
|
show="Alt+o"
|
||||||
|
copy_entry="Alt+2"
|
||||||
|
type_entry="Alt+1"
|
||||||
|
copy_menu="Alt+c"
|
||||||
|
action_menu="Alt+a"
|
||||||
|
type_menu="Alt+t"
|
||||||
|
help="Alt+h"
|
||||||
|
switch="Alt+x"
|
@ -24,7 +24,7 @@ bindsym $mod+Shift+q kill
|
|||||||
|
|
||||||
bindsym $mod+d exec rofi -show run
|
bindsym $mod+d exec rofi -show run
|
||||||
bindsym $mod+Tab exec rofi -show window
|
bindsym $mod+Tab exec rofi -show window
|
||||||
bindsym $mod+p exec ~/etc/rofipass.sh --type
|
bindsym $mod+p exec rofi-pass
|
||||||
|
|
||||||
define([dir_bind], [
|
define([dir_bind], [
|
||||||
bindsym $mod+$2 focus $1
|
bindsym $mod+$2 focus $1
|
||||||
|
24
rofipass.sh
24
rofipass.sh
@ -1,24 +0,0 @@
|
|||||||
#!/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