dmenu script for lastpass-cli with account name and account user
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

19 lines
362 B

#!/bin/bash
IFS='
'
declare -A map
for item in `lpass ls --format "%ai %an %au"`;do
id=${item#* }
id="${id#"${id%%[![:space:]]*}"}"
id="${id%"${id##*[![:space:]]}"}"
if [ "$id" != "" ]; then
map[$id]=${item%% *}
fi
done
selection=`printf '%s\n' "${!map[@]}" | dmenu`
if [ "$selection" != "" ]; then
lpass show -c --password ${map[$selection]} &
fi