First commit
This commit is contained in:
commit
24b609214f
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
keys
|
27
pythonTOTP-dmenu
Executable file
27
pythonTOTP-dmenu
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/python3
|
||||
import dmenu
|
||||
import pyotp
|
||||
import clipboard
|
||||
|
||||
keysfile=open('keys', 'r')
|
||||
keys=[]
|
||||
names=[]
|
||||
alllines=keysfile.readlines()
|
||||
for i in range(0, len(alllines)):
|
||||
if i%2==0:
|
||||
# thisname=alllines[i]
|
||||
# thisname=thisname[:-2]
|
||||
names.append(alllines[i][:-1])
|
||||
# names.append(thisname)
|
||||
else:
|
||||
keys.append(alllines[i][:-1])
|
||||
print(names)
|
||||
chose=dmenu.show(names,case_insensitive=True, prompt='Search:')
|
||||
print(chose)
|
||||
for i in range(0,len(keys)):
|
||||
if chose==names[i]:
|
||||
totp = pyotp.TOTP(keys[i])
|
||||
print(totp.now())
|
||||
clipboard.copy(totp.now())
|
||||
else:
|
||||
continue
|
Loading…
Reference in New Issue
Block a user