From 4fa8b9660604cb719092c20980f0bba76b81922b Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Thu, 25 Apr 2019 10:36:27 -0500 Subject: [PATCH] dmenu_bw: Add dmenu front-end for bwpass `dmenu_bw` works like `passmenu`: it uses `dmenu` to provide a picker, and then copies the password for the selected item to the clipboard. --- dmenu_bw | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 dmenu_bw diff --git a/dmenu_bw b/dmenu_bw new file mode 100644 index 0000000..993cbd1 --- /dev/null +++ b/dmenu_bw @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + + +key="$(bwpass | dmenu)" +[ -n "${key}" ] || exit 0 +password="$(bwpass show "${key}")" +[ -n "${password}" ] || exit 1 +printf '%s' "${password}" | xclip -quiet -rmlastnl -sel clip 2> /dev/null & +sleep 12 +kill $!