diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/dmenu/README.md | 10 | ||||
-rwxr-xr-x | contrib/dmenu/passmenu | 15 | ||||
-rw-r--r-- | contrib/emacs/CHANGELOG.md | 4 | ||||
-rw-r--r-- | contrib/emacs/password-store.el | 5 | ||||
-rw-r--r-- | contrib/vim/redact_pass.vim | 7 |
5 files changed, 37 insertions, 4 deletions
diff --git a/contrib/dmenu/README.md b/contrib/dmenu/README.md index cc810e2..b4bc81d 100644 --- a/contrib/dmenu/README.md +++ b/contrib/dmenu/README.md @@ -19,9 +19,19 @@ If `--otp-pattern REGEXP` is specified, password IDs matching the regular expression will be interpreted as secrets for OTP-style two-factor authentication. When used with `--otp`, only OTP password IDs will be displayed. +On wayland [dmenu-wl][] is used to replace dmenu and [ydotool][] to replace xdotool. +Note that the latter requires access to the [uinput][] device, so you'll probably +need to add an extra udev rule or similar to give certain non-root users permission. + +# Usage + + passmenu [--type] [--otp] [--infer-otp] [--otp-pattern <regexp>] [dmenu arguments...] [dmenu]: http://tools.suckless.org/dmenu/ [xdotool]: http://www.semicomplete.com/projects/xdotool/ [pass]: http://www.zx2c4.com/projects/password-store/ +[dmenu-wl]: https://github.com/nyyManni/dmenu-wayland +[ydotool]: https://github.com/ReimuNotMoe/ydotool +[uinput]: https://www.kernel.org/doc/html/v4.12/input/uinput.html [pass-otp]: https://github.com/tadfisher/pass-otp diff --git a/contrib/dmenu/passmenu b/contrib/dmenu/passmenu index bb8e7d6..e5635fd 100755 --- a/contrib/dmenu/passmenu +++ b/contrib/dmenu/passmenu @@ -20,6 +20,17 @@ while [[ $# -gt 0 && $finish -eq 0 ]]; do [[ $finish -eq 0 ]] && shift done +if [[ -n $WAYLAND_DISPLAY ]]; then + dmenu=dmenu-wl + xdotool="ydotool type --file -" +elif [[ -n $DISPLAY ]]; then + dmenu=dmenu + xdotool="xdotool type --clearmodifiers --file -" +else + echo "Error: No Wayland or X11 display detected" >&2 + exit 1 +fi + prefix=${PASSWORD_STORE_DIR-~/.password-store} password_files=( "$prefix"/**/*.gpg ) password_files=( "${password_files[@]#"$prefix"/}" ) @@ -33,7 +44,7 @@ if [[ $otp -eq 1 ]]; then password_files=(${filtered_files[@]}) fi -password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@") +password=$(printf '%s\n' "${password_files[@]}" | "$dmenu" "$@") [[ -n $password ]] || exit @@ -50,5 +61,5 @@ if [[ $typeit -eq 0 ]]; then pass $otp_arg show -c "$password" 2>/dev/null else pass $otp_arg show "$password" | { IFS= read -r pass; printf %s "$pass"; } | - xdotool type --clearmodifiers --file - + $xdotool fi diff --git a/contrib/emacs/CHANGELOG.md b/contrib/emacs/CHANGELOG.md index 7173f65..ed85577 100644 --- a/contrib/emacs/CHANGELOG.md +++ b/contrib/emacs/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.1.5 + +* (bugfix) Fix an infloop on Windows enviroments. + # 2.1.4 * Drop dependency on f library. diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el index 61c339e..1d23090 100644 --- a/contrib/emacs/password-store.el +++ b/contrib/emacs/password-store.el @@ -88,9 +88,10 @@ or outputs error message on failure." (setq output (concat output text))) :sentinel (lambda (process state) (cond - ((string= state "finished\n") + ((and (eq (process-status process) 'exit) + (zerop (process-exit-status process))) (funcall callback output)) - ((string= state "open\n") (accept-process-output process)) + ((eq (process-status process) 'run) (accept-process-output process)) (t (error (concat "password-store: " state)))))))) (defun password-store--run (&rest args) diff --git a/contrib/vim/redact_pass.vim b/contrib/vim/redact_pass.vim index a3d67e8..2e752fe 100644 --- a/contrib/vim/redact_pass.vim +++ b/contrib/vim/redact_pass.vim @@ -35,6 +35,7 @@ function! s:CheckArgsRedact() " Tell the user what we're doing so they know this worked, via a message and " a global variable they can check + redraw echomsg 'Editing password file--disabled leaky options!' let g:redact_pass_redacted = 1 @@ -48,4 +49,10 @@ augroup redact_pass \,$TMPDIR/pass.?*/?*.txt \,/tmp/pass.?*/?*.txt \ call s:CheckArgsRedact() + " Work around macOS' dynamic symlink structure for temporary directories + if has('mac') + autocmd VimEnter + \ /private/var/?*/pass.?*/?*.txt + \ call s:CheckArgsRedact() + endif augroup END |