Skip to content

rnadler/password-menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

password-menu.el

https://melpa.org/packages/password-menu-badge.svg https://github.com/rnadler/password-menu/actions/workflows/melpazoid.yml/badge.svg

Description

password-menu is a UI wrapper (“porcelain”) for the built-in Emacs auth-source secrets library. This package allows you to display auth-source entries in the minibuffer with either completing-read or transient. The password for the selected entry is copied to the kill ring and system clipboard and automatically removed later.

Installation

If you use MELPA, an easy way to install this package is via package-install. Alternatively, download password-menu.el, put it in your load-path and require it.

If you use both MELPA and use-package, you can use this, too:

(use-package password-menu
  :ensure t)

Custom key bindings

(global-set-key (kbd "C-x j") 'password-menu-transient)
(global-set-key (kbd "C-x J") 'password-menu-completing-read)

Doom configuration

packages.el

;;...
(package! password-menu)
;;...

Key bindings

These can be added to config.el as shown above.

Disclaimers

  • I have only tested this with Emacs 29.1.
  • Testing of the auth-source backends was limited to only authinfo.gpg.

Usage

Password menus

Menu item entries are formatted with user@host.

Transient menu

M-x password-menu-transient

screenshots/password-menu-transient.png

This uses a one or two character keyboard selection of entries (transient prefix). Since the prefix ordering always matches that of the source, this method is better suited for the use of repeatable discreet key sequences, for example C-x j 3.

Completing read menu

M-x password-menu-completing-read

screenshots/password-menu-completing-read.png

Entries are found by scrolling through or searching the list. This is likely preferable when the list is long.

Confirmation message

Copied password for [email protected] to the kill ring and system clipboard. Will clear in 45 seconds.

Customization

Here are the variables that can be customized:

VariableDefaultDesc.
password-menu-time-before-clipboard-restore45Number of seconds to wait before restoring the clipboard. Can also be set with the PASSWORD_MENU_CLIP_TIME environment variable.
password-menu-prompt“Get password for: ”Menu prompt string.
password-menu-sources-max100Maximum number of sources to find.