mirror of
https://github.com/pigmonkey/spark.git
synced 2026-01-23 02:24:09 +00:00
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
22 lines
543 B
Bash
Executable file
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 -
|