~adigitoleo/dotconf

40d4255bf8a560859c82cfdb7cbe6fb2d3037ce5 — adigitoleo 3 months ago c0776e4
feat: Add login alias script
1 files changed, 12 insertions(+), 0 deletions(-)

A .local/bin/lal
A .local/bin/lal => .local/bin/lal +12 -0
@@ 0,0 1,12 @@
#!/bin/sh
set -eu
readonly SCRIPTNAME="${0##*/}"
helpf() {
    printf 'Usage: %s alias\n' "$SCRIPTNAME"
    echo 
    echo 'Use wl-clipboard(1) to copy the login associated with the given alias.'
    echo 'Aliases are defined in ~/.password-store/login_aliases.txt.'
}

[ $# -gt 0 ] || { helpf; exit 1 ;}
grep "$1" ~/.password-store/login_aliases.txt|cut -d: -f2|wl-copy