spark/roles/media/files/qcode.sh
Pig Monkey 9e9f078483 add qcode script
To make this script particularly useful, configure a keyboard shortcut
for it and tell i3 to float the feh window.

Example:
4f7c1c9ea6

Original script source:
https://raw.githubusercontent.com/lathan/dotfiles/master/scripts/clipqr.sh
2016-02-05 18:09:57 -08:00

22 lines
543 B
Bash
Executable file

#!/bin/sh
#
# Generate a QR Code and display the resulting image.
#
# Data to encode may be provided either through standard input or as an
# argument. If no data is provided, the clipboard content will be used.
#
###############################################################################
IMG_VIEWER="feh -x --title qcode -"
read -t 0 stdin
if [ -n "$stdin" ]; then
source="$stdin"
elif [ -n "$1" ]; then
source="$1"
else
source=$(xclip -o -selection clipboard)
fi
echo "$source" | qrencode --size=10 -o - | $IMG_VIEWER -