diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-04-30 15:16:53 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-04-30 15:16:53 +0200 |
commit | e15cf54ec9a8760fb656b2656f635e0cfde66387 (patch) | |
tree | 4dd86fa17c33ce11131922dfc857bee120178cdc /config/extra | |
parent | fda7a6c4ded804d8d673a76ecaf2c8e86be49013 (diff) |
moved qrclipo to seperate script
Diffstat (limited to 'config/extra')
-rwxr-xr-x | config/extra/qrclip | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/config/extra/qrclip b/config/extra/qrclip new file mode 100755 index 0000000..2f5da5c --- /dev/null +++ b/config/extra/qrclip @@ -0,0 +1,29 @@ +#!/bin/sh + +if [ "$WAYLAND_DISPLAY" ] +then + which wl-copy > /dev/null || exit 1 + clipp () { + wl-copy + } + clipo () { + wl-paste + } +else + which xclip > /dev/null || exit 1 + clipp () { + xclip -selection clipboard -r + } + clipo () { + xclip -o -selection clipboard -r + } +fi + +case $1 in + '-o') + qrencode -s 16 "$(clipo)" -o - | + imv -w "imv - $(clipo)" - ;; + '-s') + qrencode -s 16 "https://duckduckgo.com/$(clipo)" -o - | + imv -w "imv - search $(clipo)" - ;; +esac |