#!/bin/sh pb=$PASSWORD_STORE_DIR [ -z "$PASSWORD_STORE_CLIP_TIME" ] && ct=45 || ct=$PASSWORD_STORE_CLIP_TIME chars=$(echo $pb | wc -c) accts=$(find $pb -type f -name "*-OTP.gpg" | cut -c $chars- | \ rev | cut -c 5- | rev) acct="$(echo "$accts" | dmenu)" pass otp code $acct | xclip -r -selection "primary" \ && pass otp code $acct | xclip -r -selection "clipboard" \ && notify-send "OTP copied to clipboard" \ && sleep $ct \ && pkill xclip