Simple QR Code Command

less than 1 minute read

Sometimes you need to open a URL on your phone that you found on your company laptop but theres no simple way to send it between the two devices. This simple command allow you to turn a URL into a QR code you can scan on your phone.

For this to work you will need to install qrencode:

brew install qrencode

Place the following in your ~/.bashrc file:

function qr() {
  qrencode "$1" -o /tmp/qr.png; open /tmp/qr.png
}

Now you can run the following which will open a new QR code in Preview:

qr https://thega.me.uk

Tags:

Categories:

Updated: