diff --git a/pass.cpp b/pass.cpp index c597853..f1d33a9 100644 --- a/pass.cpp +++ b/pass.cpp @@ -125,7 +125,13 @@ void Pass::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &m { Q_UNUSED(context); - auto ret = match.text().contains("totp-", Qt::CaseInsensitive) ? + this->passOtpIdentifier = "totp::"; + auto passOtpIdentifier = getenv("PASSWORD_STORE_OTP_IDENTIFIER"); + if (passOtpIdentifier != nullptr) { + this->passOtpIdentifier = passOtpIdentifier; + } + + auto ret = match.text().contains(this->passOtpIdentifier, Qt::CaseInsensitive) ? QProcess::execute(QString("pass otp -c ") + match.text()) : QProcess::execute(QString("pass -c ") + match.text()); if (ret == 0) { diff --git a/pass.h b/pass.h index ea641eb..34d58b5 100644 --- a/pass.h +++ b/pass.h @@ -44,6 +44,7 @@ protected: private: QDir baseDir; + QString passOtpIdentifier; int timeout; QReadWriteLock lock; QList passwords;