20 lines
419 B
Bash
20 lines
419 B
Bash
|
#! /bin/bash
|
||
|
|
||
|
if [ "$XDG_SESSION_TYPE" = "wayland" ];
|
||
|
then
|
||
|
CLIPBOARD_STRING=$(wl-paste)
|
||
|
elif [ "$XDG_SESSION_TYPE" = "x11" ];
|
||
|
then
|
||
|
CLIPBOARD_STRING=$(xclip -s c -o)
|
||
|
else
|
||
|
echo "This script needs *either* wayland *or* X11 running." >&2
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
if [ "$1" = "-console" ];
|
||
|
then
|
||
|
qrencode -8 -l M -t ANSI256UTF8 "$CLIPBOARD_STRING"
|
||
|
else
|
||
|
qrencode -d 96 -8 -l M -o - "$CLIPBOARD_STRING" | feh -ZF --force-aliasing -
|
||
|
fi
|