Gauth desktop shortcut
-
If you don't have 2 factor authentication set up with google yet, log in and enable 2 factor authentication. When you are presented with the QR code click the link that says you can't scan the code. This will display the the sectet in base32, copy the code we'll need that. You can scan the code into your phone if you want as well. Go to step 3.
-
If you already have google authenticator set up you can download a free app from the Play Store called "SQLite Debugger" (root required) and read the secret from the Google Authenticator database.
-
The secret will have spaces and will be in lower case. Remove the spaces and change all the letters to upper case.
-
If you have oathtool installed and your time on your computer is set correctly, running the following command should produce the exact same token as your phone. Replace "BASE32SECRET" with the one you got from google
oathtool -b --totp BASE32SECRET
- Here's a script I created that will generate the token and copy it to the clipboard using xsel. Of course replace "BASE32SECRET" with the one you got from Google. Then all you have to do is bind a keyboard shortcut to the the script and your token will be copied to the clipboard whenever you press the shortcut.
#!/bin/bash key=BASE32SECRET token=`oathtool -b --totp ${key}` echo -n $token | xsel -ib