4 changed files with 45 additions and 40 deletions
@ -1,23 +1,36 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
|
|
||||
# Display a QR code provided as parameter $1 |
# Display a QR code for the string in qr.txt |
||||
|
|
||||
qrcode=$1 |
echo |
||||
|
echo "Please wait. Generating QR-code..." |
||||
|
echo |
||||
|
# make sure qrcode-encode and fbi are installed |
||||
|
sudo apt-get install qrencode fbi -y > /dev/null |
||||
|
|
||||
# make sure qrcode-encoder in installed |
qrencode -l L -o /home/admin/qr.png < /home/admin/qr.txt > /dev/null |
||||
clear |
sudo fbi -a -T 1 -d /dev/fb1 --noverbose /home/admin/qr.png 2> /dev/null |
||||
echo "*** Setup ***" |
|
||||
sudo apt-get install qrencode -y |
echo "************************************" |
||||
|
echo "Scan the QR-Code on the LCD-Display." |
||||
|
echo "************************************" |
||||
|
echo |
||||
|
echo "If you don't have access to the LCD, you can view it here." |
||||
|
echo "Make the this terminal window as big as possible - fullscreen would be best." |
||||
|
echo "Then PRESS ENTER here in the terminal to show QR code." |
||||
|
|
||||
clear |
|
||||
echo "Make the this terminal as big as possible - fullscreen would be best." |
|
||||
echo "Then PRESS ENTER here in the terminal to generare the QR code and scan it with the app." |
|
||||
read key |
read key |
||||
|
|
||||
clear |
clear |
||||
echo -e "$1" | qrencode -t ANSI256 |
qrencode -t ANSI256 < /home/admin/qr.txt |
||||
echo -e "$1" |
shred /home/admin/qr.txt |
||||
echo "(To shrink QR code: OSX->CMD- / LINUX-> CTRL-) Press ENTER when finished." |
rm -f /home/admin/qr.txt |
||||
|
echo "(To shrink QR code: macOS press CMD- / LINUX press CTRL-) Press ENTER when finished." |
||||
read key |
read key |
||||
|
|
||||
clear |
clear |
||||
|
|
||||
|
# remove the QR picture on the raspi LCD |
||||
|
sudo killall -3 fbi |
||||
|
shred /home/admin/qr.png |
||||
|
rm -f /home/admin/qr.png |
||||
|
Loading…
Reference in new issue