How to easily generate QR codes on Linux

A QR code is a type of barcode that stores information and is read by digital devices, including smartphones.

If you have been to convenience stores or coffee shops, you may have seen QR codes there to receive payments or share WiFi passwords, among many other things.

But that's not all. QR codes have other useful uses in today's world. For example, you can use QR codes to share access to your home WiFi with guests or to share your contact information.

Let's follow how to create QR codes on Linux with qrencode through the following article.

Step 1: Install qrencode on Linux

First, you need to install the qrencode program on your computer. Just like any other program, doing this on a Linux machine depends entirely on the Linux distribution you're using. So follow the steps listed below to install qrencode on your system:

On Ubuntu and its derivatives, open Terminal and run the following command to install qrencode:

sudo apt install qrencode

To install qrencode on Fedora use:

sudo dnf install qrencode

On Arch Linux and Manjaro, you can install qrencode with Pacman, like this:

sudo pacman -S qrencode

If you are using openSUSE, run:

sudo zypper install qrencode

Step 2: Use qrencode to generate QR code

As a CLI-based tool, qrencode involves using a series of different options to generate QR codes. Here are all the necessary options (and their properties) that you need to know to generate a basic QR code:

  1. -o filename : Used to specify the output filename of the generated QR code.
  2. -s size : It allows you to specify the module size with dots. By default, its value is set to three, but you can change it based on your requirements.
  3. -l error_correction_level : As the name suggests, this option allows you to set the error correction level for your QR code. It basically decides how a change in the QR code affects its scanability. This option uses low (L) by default.
  4. -t filetype : This option allows you to decide the file type for your QR code. Its default value is PNG, but you can set it to a bunch of other formats.

For more qrencode options, run the following command in a command line window:

qrencode --help

Picture 1 of How to easily generate QR codes on Linux

Now that you're familiar with the basic qrencode options, here's how to stitch them together into one command to generate a QR code that outputs text:

qrencode -s 9 -l H -o "QR-code.png" "This is a test QR code!"

With this command, the example is generating a QR code for the text "This is a test QR code!" . This QR code will be called QR-code.png , which is 9 pixels in size and uses a high level of correction (H). It will be saved to your computer's home directory, so you can use the built-in file manager to access it.

Step 3: Verify the generated QR code

After you have generated a QR code, the next step is to verify that it is properly generated and contains your desired information.

To do this, all you need is a QR code scanner. On iPhone, you get a QR scanner as a built-in widget, which you can access from the Control Center. On the other hand, if you are using Android, you can download Kaspersky's QR Code Reader and Scanner on your device. Or you can download any other QR code scanner from Play Store.

Next, open the QR code image on your Linux desktop. Activate the QR code scanner on your smartphone and point it at the QR code on your computer so that it is exactly inside the specified frame.

After your phone scans this code, it will display the content of the code. Verify that it's the same as what you included during code generation. In case the information is the same, you can use this QR code as you like. If not, try regenerating with qrencode.

First, generating QR codes can be quite a daunting task. However, using the right QR code generator tool can make the process significantly easier, as demonstrated in this qrencode generator user guide.

Now you can generate QR codes to share your contact info, send calendar invites, share WiFi logins, etc. easily. In case you are looking for a permanent solution, you can even create a 3D printed QR code for yourself.

Update 31 May 2022
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile