Added automated totp followup for bwgp helper.
This commit is contained in:
11
.bashrc
11
.bashrc
@ -32,7 +32,16 @@ alias gpa='git remote | xargs -L1 git push --all'
|
||||
# simplify bitwarden cli usage
|
||||
cpcmd="xclip -selection c"; if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then cpcmd="wl-copy"; fi
|
||||
alias bwu='export BW_SESSION=$(bw unlock --raw > ~/.bw_session && cat ~/.bw_session)'
|
||||
function bwgp () { local test=$(export BW_SESSION=~/.bw_session) && bw get password "$1" | $cpcmd; }
|
||||
|
||||
function bwgp () {
|
||||
local test=$(export BW_SESSION=~/.bw_session) && bw get password "$1" | $cpcmd;
|
||||
|
||||
# If the login has a totp associated we should leave a follow-up prompt for it
|
||||
if totp=$(bw get totp "$1"); then
|
||||
read -p "Press enter when ready for totp"
|
||||
echo "${totp}" | $cpcmd
|
||||
fi
|
||||
}
|
||||
function bwgt () { local test=$(export BW_SESSION=~/.bw_session) && bw get totp "$1" | $cpcmd; }
|
||||
function bwgi () { local test=$(export BW_SESSION=~/.bw_session) && bw get item --pretty "$1"; }
|
||||
function bwli () { local test=$(export BW_SESSION=~/.bw_session) && bw list items --search "$1" --pretty | egrep -i 'name|"id":'; }
|
||||
|
||||
Reference in New Issue
Block a user