totp

Simple cli tool for storing TOTP secrets and generating tokens
git clone https://git.inz.fi/totp/
Log | Files | Refs | Submodules

dtotp (347B)


      1 #!/bin/sh
      2 
      3 KEY=$(dmenu -p 'Enter passphrase: ' -sb '#000000' -sf '#c6f24b' -nb '#000000' -nf '#000000' </dev/null)
      4 ID=
      5 if [ "$1" ]; then
      6 	ID="*$1*"
      7 else
      8 	ID=$(totp -K - -l <<FOO | dmenu -sb '#000000' -sf '#c6f24b' -nb '#000000' -nf '#c0c0c0'
      9 $KEY
     10 FOO
     11 	)
     12 fi
     13 totp -K - -t "$ID" << FOO | head -n1 | tr -d '\r\n' | xclip -selection clipboard
     14 $KEY
     15 FOO