Even if you only have the QR code, you can download the image or screenshot it and then extract the secret without ever having to use a smartphone by using zbarimg and then manually extracting the secret from the URI:
sudo apt-get install zbar-tools oathtool
zbarimg qr-2fa-code.png
Output: QR-Code:otpauth://totp/username?secret=ABCDEFSECRET012349BASE32&period=30&digits=6
If you have some 2FA that you need to enter 10 times per day, then you can also add a global shortcut to automatically paste it. Of course, this undermines the "second device" security. Some PC password managers also support 2FA, e.g. https://github.com/paolostivanin/OTPClient ( sudo apt install otpclient )