Make the pass otp identifier an environment variable

master
msmol 9 years ago
parent 76a26e010b
commit a468f0bebc
  1. 8
      pass.cpp
  2. 1
      pass.h

@ -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) {

@ -44,6 +44,7 @@ protected:
private:
QDir baseDir;
QString passOtpIdentifier;
int timeout;
QReadWriteLock lock;
QList<QString> passwords;

Loading…
Cancel
Save