password-store-completion/README.org

68 lines
3 KiB
Org Mode
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#+TITLE: password-store-ivy
A [[https://www.passwordstore.org/][pass]] frontend based on [[https://github.com/abo-abo/swiper#ivy][Ivy]], made primarily to use with [[https://github.com/ch11ng/exwm][EXWM]] and [[https://github.com/tumashu/ivy-posframe][ivy-posframe]]. Types fields from entries.
Also take a look at Nicolas Petton's [[https://github.com/NicolasPetton/pass][pass]], =password-store-ivy= is designed as complementary to the Nicolas' package.
This package is made with Ivy because I need some fine-tuning like actions and turning off the sort in some completions, and Ivy happens to be the competing system I'm using now.
* Installation
As the package isnt 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=:
#+begin_src emacs-lisp
(use-package password-store-ivy
:straight (:host github :repo "SqrtMinusOne/password-store-ivy")
:after (exwm))
#+end_src
This package types stuff with =xdotool=, so you need to have that available in your =$PATH=.
* Usage
Emacs' built-in [[https://www.gnu.org/software/emacs/manual/html_node/auth/The-Unix-password-store.html][password store]] integration has to be set up.
The only 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
* Customization
There are a few parameters that control delays:
- =password-store-ivy-initial-wait= controls the initial delay before starting to type a sequence (in milliseconds)
- =password-store-ivy-delay= controls the delay between typing characters (in milliseconds)
There is also =password-store-ivy-sequences= that determines the sequence of actions =password-store-ivy= performs.
It is an alist with the following required keys (corresponding to the basic actions):
- =autotype=
- =password=
- =username=
- =url=
The values are lists of the following elements:
- =wait=. Wait for =password-store-ivy-initial-wait= milliseconds
- =(wait <milliseconds>)=. Wait for =<milliseconds>=.
- =(key <key>)=. Type =<key>=.
- =(field <field>)=. Type =<field>= of entry.
For example, the starting values:
#+begin_src emacs-lisp
'((autotype . (wait
(field . "username")
(key . "Tab")
(field . secret)
(key . "Return")))
(password . (wait (field . secret)))
(username . (wait (field . "username")))
(url . (wait (field . "url"))))
#+end_src
In addition to the global override, sequences can be overriden per-entry with a field called =sequence-<name>=, where =<name>= is a key of =password-store-ivy-sequences=.
For example, here is an override to press =Tab= twice:
#+begin_example
<pass>
username: thexcloud@gmail.com
url: <url>
sequence-autotype: (wait (field . "username") (key . "Tab") (key . "Tab") (field . secret) (key . "Return"))
#+end_example