Skip to content

A simple script to share your computer's WiFi connection via QR code

Notifications You must be signed in to change notification settings

dlenski/wifi2qr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

wifi2qr

License: GPL v3

A simple bash script to share your computer's WiFi connection settings via QR code.

Requires the command-line utility nmcli from NetworkManager—plus qrencode and ImageMagick's display in order to actually display the barcode.

Installation and usage

$ curl https://raw.githubusercontent.com/dlenski/wifi2qr/HEAD/wifi2qr > ~/bin/wifi2qr
$ chmod +x !$
$ wifi2qr

… which will display a barcode that you can read with your smartphone to connect to the network. Tested with Android's zxing-based Barcode Scanner, the somewhat more modern QR & Barcode Scanner, and the iPhone Camera app.

WIFI:S:ExampleWPA;T:WPA;P:ExamplePassword;;

You can also share a specific connection, by its NetworkManager connection name or UUID with wifi2qr CONNECTION.

You can list known WiFi connections with wifi2qr -l.

Note: only zxing-based apps appear to support the E/A/I/PH2 fields which are needed to configure WPA-EAP ("Enterprise") WiFi networks; those fields are not present in the official-ish WPA3 specification for WiFi URIs.

Complete options

wifi2qr [-h] [-l] [-u | -a] [connection]

Displays a QR code that can be scanned to connect to a WiFi network
known to NetworkManager.

Options:
  connection    Show QR code for specific connection (if not
                specified, currently-enabled WiFi connection)
  -h            Show this help message
  -l            List WiFi connections known to NetworkManager
  -a | -i       Show QR code using ANSI characters or with ImageMagick
     | -o FILE  or save to a file (e.g. qrcode.png)
                (default is to show using UTF8 characters)
  -q            Quiet mode (default is to print barcode in text
                form to stderr as well; this suppresses it)

About

A simple script to share your computer's WiFi connection via QR code

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages