Just Make a Qr Code
I often find myself needing to send little pieces of information: urls, passwords, etc. to my phone, and I suddenly thought this was a nice way to do it.
$ put | uvx qr
█████████████████████████████████████
█████████████████████████████████████
████ ▄▄▄▄▄ █ ▄▄▀▄█▀ ▄█▄▄▄█ ▄▄▄▄▄ ████
████ █ █ █▀▀ ▀▄▄▄▄▀▀▄▄▄█ █ █ ████
████ █▄▄▄█ ██▄▀▄▄▄▀██▄ ██ █▄▄▄█ ████
████▄▄▄▄▄▄▄█ █ ▀ ▀ █▄▀▄▀ █▄▄▄▄▄▄▄████
████ ▀▄▄█ ▄ ▀█▄█ ▄▄▀ ▀▀▀▀ █▀▄█▄ ████
████ ▀█▀▄█▄▄▀ ▀█▀▀ ██ █▀▄▄█▀█▄▄▀████
████▄▄█▄▀█▄▀▀ ▀▀▀▀███ ▀ ██▀██▄ ▀▀████
████ █▀▀ ▀▄▄ █▄ ▀▀▄█▄██ █▄▀█▀█▄ ▄████
██████ ▄▄▄▄▀ █ ▄▄▀█▄▀█ █▀ █▀▄ ▀ █████
████▄█▀ ▄ █ █ ███ ▄█▀▄▀ █ ██████
█████▄█▄▄▄▄▄▀ ▀ ▀ ▀▄▄▄ ▄▄▄ ▀▀████
████ ▄▄▄▄▄ █ ▄█▄█▄██▄█▀▄ █▄█ █ ▀████
████ █ █ █▀ ▄ ▄▀ ▀▄█▀▄ ▄▄ ▀▄▄▀████
████ █▄▄▄█ █▄ ▀█ ██▀ ▄▄█ ██▄▀▀▄▀▄████
████▄▄▄▄▄▄▄█▄▄█▄▄▄████▄█▄▄▄▄█▄█▄█████
█████████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
put
1 is a little alias that outputs whatever I've copied to my clipboard, and uvx
2 installs and runs commands from python packages - in this case qr
from qrcode. Then I can open my phone camera, and grab the data onto my phone.
For passwords I found that I needed to remove the newline using tr
. Be careful that no one else can see or scan your screen!
$ pass "<account_name_here>" | tr -d '\n' | uvx qr
If you find this useful, you can also install qr
using uv
to make the process even easier:
uv tool install qr
put | qr
-
alias put='xclip -selection clipboard -o'
↩