Browse Source

Support OTP in XMonad.Prompt.Pass

update CHANGES.md
master
Ricky Hariady 4 months ago
parent
commit
c3cee11ad6
2 changed files with 17 additions and 0 deletions
  1. 6
    0
      CHANGES.md
  2. 11
    0
      XMonad/Prompt/Pass.hs

+ 6
- 0
CHANGES.md View File

@@ -50,6 +50,12 @@
using tab to wrap around the completion rows would fail when maxComplRows is
restricting the number of rows of output.

* `XMonad.Prompt.Pass`

Added 'passOTPPrompt' to support getting OTP type password. This require
pass-otp (https://github.com/tadfisher/pass-otp) has been setup in the running
machine.

* `XMonad.Actions.DynamicProjects`

Make the input directory read from the prompt in `DynamicProjects`

+ 11
- 0
XMonad/Prompt/Pass.hs View File

@@ -44,6 +44,7 @@ module XMonad.Prompt.Pass (
-- * Usage
-- $usage
passPrompt
, passOTPPrompt
, passGeneratePrompt
, passRemovePrompt
, passEditPrompt
@@ -125,6 +126,11 @@ mkPassPrompt promptLabel passwordFunction xpconfig = do
passPrompt :: XPConfig -> X ()
passPrompt = mkPassPrompt "Select password" selectPassword

-- | A prompt to retrieve a OTP from a given entry.
--
passOTPPrompt :: XPConfig -> X ()
passOTPPrompt = mkPassPrompt "Select OTP" selectOTP

-- | A prompt to generate a password for a given entry.
-- This can be used to override an already stored entry.
-- (Beware that no confirmation is asked)
@@ -155,6 +161,11 @@ passEditPrompt = mkPassPrompt "Edit password" editPassword
selectPassword :: String -> X ()
selectPassword passLabel = spawn $ "pass --clip \"" ++ escapeQuote passLabel ++ "\""

-- | Select a OTP.
--
selectOTP :: String -> X ()
selectOTP passLabel = spawn $ "pass otp --clip \"" ++ escapeQuote passLabel ++ "\""

-- | Generate a 30 characters password for a given entry.
-- If the entry already exists, it is updated with a new password.
--

Loading…
Cancel
Save