vlevit / notify-send.sh

drop-in replacement for notify-send with more features
GNU General Public License v3.0
282 stars 40 forks source link

Enhancement: Show QR Codes generated in /tmp #27

Open duracell80 opened 2 years ago

duracell80 commented 2 years ago

It would be great to add a python generated QR Code just big enough to be readable in the main body of the message.

$ sudo pip3 install pyqrcode
$ sudo pip3 install pypng
import pyqrcode
import png
from pyqrcode import QRCode

url = "http://www.example.com"
qrl = pyqrcode.create(url)
irl = "/tmp/qr_" + url.replace("://", "-") + ".png"

qrl.png(irl, scale =8, module_color=[0, 0, 0, 255], background=[0xff, 0xff, 0xff])

https://www.geeksforgeeks.org/python-generate-qr-code-using-pyqrcode-module/ https://github.com/phuhl/notify-send.py