Script to generate a QR code image for you wifi.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-11-21 22:57:05 +01:00
LICENSE Initial commit 2024-11-21 22:45:04 +01:00
README.md Check that qrencode is installed 2024-11-21 22:57:05 +01:00
wifi-qr-gen.sh Check that qrencode is installed 2024-11-21 22:57:05 +01:00

WIFI QR Code Generator

Script to generate a QR code for WiFi.

Installation

  1. Clone this repository
git clone https://codeberg.org/lingling/wifi-qr-gen

Requirements

  • The command qrencode. Install it with the package manager of your distribution.

    • Arch Linux:

      sudo pacman -Sy qrencode
      
    • Debian/Ubuntu:

      sudo apt update && sudo apt install qrencode
      

Usage

This script can be used either by exporting environment variables or using user input after the script is executed.

Read at Runtime

This is the recommended way. Note that the bash function read is used. This does interpret the input, especially it does word splitting. So be careful with whitespaces. See bash(1) . If your password contains special characters you may want to use environment variables.

  1. Execute the script:

    ./wifi-qr-gen.sh
    
  2. Answer the prompts and confirm with <CR>. Note that you won't get visual feedback on the password prompt.

Environment Variables

Use this way if your password contains special characters and didn't worked with the first approach. You may want to set HISTCONTROL=ignoreboth and prefixing your commands with a whitespace to prevent having your password in the command history. See bash(1) for more information.

  1. Set and export WLAN_SSID:

    WLAN_SSID="My cool WLAN name"
    export WLAN_SSID
    
  2. Set and export WLAN_PASS:

     WLAN_SSID="My cool WLAN name"
    export WLAN_SSID
    
  3. Execute the script:

    ./wifi-qr-gen.sh
    

License

The Unlicense

Author Information

lingling (Codeberg, GitHub)