Compare commits

...

5 Commits

4 changed files with 27 additions and 4 deletions

2
bash/.gitignore vendored
View File

@ -1,2 +1,4 @@
# wifiqr.bash output
*.png
*.jpg
*.jpeg

View File

@ -17,6 +17,22 @@ iwctl station $WIFIDEVICE get-networks
# The manpage says: iwctl --passphrase=PASSPHRASE station DEVICE connect SSID
# but considering it says -P is shorthand for passphrase, I think this should
# work too while being more logical in my opinion.
echo "% sudo iwctl station $WIFIDEVICE connect \$SSID -P \$KEY"
echo "To connect:
% iwctl station $WIFIDEVICE connect \$SSID -P \$KEY
"
# For permanent connections https://gitea.blesmrt.net/mikaela/shell-things/src/branch/master/var/lib/iwd
# Device Provisioning Protocol https://iwd.wiki.kernel.org/device_provisioning
# requires qrencode, so let's check it exists
if hash qrencode needrestart 2>/dev/null; then
# Remind of command to share
echo "To share credentials:
% iwctl dpp $WIFIDEVICE start-configurator
"
# It needs to be stopped too
echo "To stop sharing credentials:
% iwctl dpp $WIFIDEVICE stop"
# Remind me that this part exists if qrencode is not found.
else
echo "WARNING! qrencode not found."
fi

View File

@ -3,14 +3,16 @@
# Arguments: Name & content
# -l H uses the highest error correction in case 30 % gets damaged (or artistried upon)
# -s 6 doubles the dot/pixel size
# Outputs QR code to terminal
# ${@:2} takes all arguments except not the first one
qrencode -l H -t utf8 "${@:2}"
# Stores QR code as $1.png (first argument)
qrencode -l H -o "$1".png "${@:2}"
qrencode -s 6 -l H -o "$1".png "${@:2}"
# My stepfather wants jpg
convert "$1".png "$1".jpg
# Prints details
echo "Name: $1.png"
echo "Content: ${@:2}"

View File

@ -8,6 +8,9 @@
qrencode -l H -t utf8 "WIFI:T:WPA;S:$1;P:$2;;"
# Stores QR code as SSID.png, -s doubles pixel size from default 3
qrencode -l H -s 6 -o $1.png "WIFI:T:WPA;S:$1;P:$2;;"
# Might as well jpg this too
convert "$1".png "$1".jpg
# Prints details
echo "SSID: $1"