From f6fd1209ac4b84e7ae996a5806be56eb204cb107 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Sun, 24 Jul 2016 09:55:26 +0200 Subject: [PATCH] use rofi-pass --- Makefile | 1 + config/rofi-pass/config | 59 +++++++++++++++++++++++++++++++++++++++++ i3/config.m4 | 2 +- rofipass.sh | 24 ----------------- 4 files changed, 61 insertions(+), 25 deletions(-) create mode 100644 config/rofi-pass/config delete mode 100755 rofipass.sh diff --git a/Makefile b/Makefile index 50e597e..e39ddfd 100644 --- a/Makefile +++ b/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 \ config/qutebrowser config/nvim/init.vim ideavimrc agignore \ config/khal config/vdirsyncer/config config/khard \ + config/rofi-pass \ $(wildcard sbt/0.13/*.sbt sbt/0.13/plugins/*.sbt) .PHONY: install clean check diff --git a/config/rofi-pass/config b/config/rofi-pass/config new file mode 100644 index 0000000..58e2909 --- /dev/null +++ b/config/rofi-pass/config @@ -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" diff --git a/i3/config.m4 b/i3/config.m4 index ebc798b..25df0ff 100644 --- a/i3/config.m4 +++ b/i3/config.m4 @@ -24,7 +24,7 @@ bindsym $mod+Shift+q kill bindsym $mod+d exec rofi -show run bindsym $mod+Tab exec rofi -show window -bindsym $mod+p exec ~/etc/rofipass.sh --type +bindsym $mod+p exec rofi-pass define([dir_bind], [ bindsym $mod+$2 focus $1 diff --git a/rofipass.sh b/rofipass.sh deleted file mode 100755 index f7f8142..0000000 --- a/rofipass.sh +++ /dev/null @@ -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