commit 2465ec78c2dff6654e73361b7756cadaa6f514c7 parent d5305cf47e2877bb3eb8d158547380bb0de60fd3 Author: Chris Roberts <chris.roberts@learningunix.net> Date: Tue, 2 Jun 2026 18:43:57 -0500 added password menu script and updated the readme. Diffstat:
| M | README.md | | | 5 | +++++ |
| A | pass-menu.sh | | | 27 | +++++++++++++++++++++++++++ |
2 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md @@ -8,3 +8,8 @@ A script that wraps the pushover API for sending notifications. [Here](https://learningunix.net/posts/dead-simple-notifications-with-pushover/) is an article on example usage. It relies on the user's pushover user and api key to be saved as environment variables. + +## pass-menu.sh +Pipe the password store entries into wofi to create a selectable menu. +Depends on wofi, pass, and wl-clipboard. Kilpper was fighing me when +clearing the clipboard so the dbus6 line was added. diff --git a/pass-menu.sh b/pass-menu.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +deps="wofi pass wl-copy" + +for dep in $deps; do + command -v $dep >/dev/null 2>&1 || { + echo "error: $dep is not installed" >&2 + exit 1 + } +done + +store="${PASSWORD_STORE_DIR:-$HOME/.password-store}" + +passwords="$(find "$store" -name "*.gpg" | sed -e 's|\.gpg$||' | sed -e "s|$store/||")" + +selection=$(echo "$passwords" | wofi --dmenu) + +[ -z "$selection" ] && exit 0 + +pass show "$selection" | head -n 1 | wl-copy + +( + sleep 15 + wl-copy --clear + command -v qdbus6 >/dev/null 2>&1 && qdbus6 org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory + +) &