Skip to content

Instantly share code, notes, and snippets.

@thedod
Last active May 18, 2022 04:53
Show Gist options
  • Save thedod/39ede4273e24cb1a22fa to your computer and use it in GitHub Desktop.
Save thedod/39ede4273e24cb1a22fa to your computer and use it in GitHub Desktop.
WiFi QR code generation shell script

#Shelter1001's interactive [zenity] shell script for wifi qr-code generation.

Supports WPA [recommended] and open [sometimes useful] networks [no WEP support because duh].

Based on this [WPA only] commandlinefu.

party on, Garth

#!/bin/sh
if ( zenity --question --title="Network type" --text="Does your wifi network have a WPA password?" --ok-label="Yes" --cancel-label="No" ); then
qrencode -s 13 -o qr-wifi.png "WIFI:S:$(zenity --entry --text="Network name (SSID)" --title="Create WPA WiFi QR");T:WPA;P:$(zenity --password --title="WPA Password");;"
else
qrencode -s 13 -o qr-wifi.png "WIFI:S:$(zenity --entry --text="Network name (SSID)" --title="Create nopass WiFi QR");T:nopass;;"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment