password-store-completion

password-store-completion

A completion-based pass frontend inspired by rofi-pass. Integrates with Ivy or Embark.

The main purpose is typing passwords with xdotool (useful in EXWM).

Also take a look at Nicolas Petton’s pass. password-store-completion is designed as complementary to Nicolas’ package.

Installation

As the package isn’t yet available anywhere but in this repository, you can clone the repository, add it to the load-path, and require the package. My preferred way is use-package with straight:

(use-package password-store-completion
  :straight (:host github :repo "SqrtMinusOne/password-store-completion"))

xdotool has to be available in $PATH.

For Ivy integration:

(require 'password-store-ivy)

Also be sure to load the main package before Ivy.

For Embark integration:

(require 'password-store-embark)
(password-store-embark-mode)

Usage

Emacs’ built-in password store integration has to be set up.

For Ivy integration, the command is M-x password-store-ivy, which invokes Ivy to select an entry from the pass database. Available commands in the selection buffer:

  • M-a: Perform autotype
  • M-p: Type password
  • M-u: Type username
  • M-U: Type URL
  • M-f: Select a field to type

For other completion frameworks, run M-x password-store-completion. If Embark integration is enabled, the same actions are added.

Customization

The following parameters control delays:

  • password-store-completion-initial-wait controls the initial delay before starting to type a sequence (in milliseconds)
  • password-store-completion-delay controls the delay between typing characters (in milliseconds)

password-store-completion-sequences determines the steps of sequences. It is an alist; the keys correspond to the default sequences:

  • autotype
  • password
  • username
  • url

The values are lists of the following elements:

  • wait: Wait for password-store-completion-initial-wait milliseconds
  • (wait <milliseconds>): Wait for <milliseconds>
  • (key <key>): Type <key>
  • (field <field>): Type <field> of entry

The default value is as follows:

'((autotype . (wait
	       (field . "username")
	       (key . "Tab")
	       (field . secret)
	       (key . "Return")))
  (password . (wait (field . secret)))
  (username . (wait (field . "username")))
  (url . (wait (field . "url"))))

Sequences can also be overridden in a particular entry with a field called sequence-<name>, where <name> is a key of password-store-completion-sequences.

For example, to press Tab twice in the autotype sequence:

<pass>
username: thexcloud@gmail.com
url: <url>
sequence-autotype: (wait (field . "username") (key . "Tab") (key . "Tab") (field . secret) (key . "Return"))

Or, create a custom sequence:

<pass>
username: thexcloud@gmail.com
url: <url>
sequence-doubletab: (wait (field . "username") (key . "Tab") (key . "Tab") (field . secret) (key . "Return"))

Custom sequences can be run in the field selection interface (M-f in Ivy, M-x embark-act f in Embark).