added clipboard-to-qr.sh
This commit is contained in:
parent
9978badbad
commit
23733e2d2c
1 changed files with 19 additions and 0 deletions
19
.local/bin/clipboard-to-qr.sh
Executable file
19
.local/bin/clipboard-to-qr.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
#! /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
|
Loading…
Reference in a new issue