fix(rbw): do not wipe rbwpw items if newer are copied

This commit is contained in:
Carlo Sala 2025-06-25 14:05:40 +02:00
commit f3c1180f65
No known key found for this signature in database
GPG key ID: DA6FB450C1A4FE9A

View file

@ -29,9 +29,11 @@ function rbwpw {
echo "$service not found"
return 1
fi
local _random="$RANDOM"
echo -n $_random > $ZSH_CACHE_DIR/rbwpw_cache
echo -n $pw | clipcopy
echo "password for $service copied!"
{sleep 20 && clipcopy </dev/null 2>/dev/null} &|
{sleep 20 && [[ $(<$ZSH_CACHE_DIR/rbwpw_cache) == $_random ]] && clipcopy </dev/null 2>/dev/null} &|
}
function _rbwpw {