If you've got a Yubikey, you can use the Yubico Authenticator to store your 2FA codes. It's able to scan the screen for QRCodes, so you can use it as easily as you can an app on your mobile.
What can make it even faster to use though is to install the CLI (ykman
), which can be used to output just the code you need at that moment. If you're on a Mac and create an Automator workflow with the CLI and a bit of AppleScript, you can then use a simple Spotlight search to enter a given code into an app which needs it.
On OSX 10.15 onwards, the first time you run the workflow you'll have give it Accessibility permissions.