2022-08-29 23:22:33 +02:00
|
|
|
#!/bin/sh
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
cd ~/.password-store
|
|
|
|
passname=$(find -name "*.gpg" | sed -r 's|\./(.*)\.gpg$|\1|' | rofi -dmenu -p pass)
|
|
|
|
case "$passname" in
|
2024-06-27 12:39:18 +02:00
|
|
|
openttdpro-otp) password="!login $(pass otp "$passname")"; ;;
|
2022-08-29 23:22:33 +02:00
|
|
|
*-otp) password="$(pass otp "$passname")"; ;;
|
|
|
|
*) password="$(pass show "$passname" | sed '/^$/q')"; ;;
|
|
|
|
esac
|
2024-06-27 12:39:18 +02:00
|
|
|
printf '%s\n' "type $password" | dotoolc
|