scripts

Utilitity scripts
git clone git://gtms.dev:scripts
Log | Files | Refs

commit b8976ffabba19684c70d265172f79e9773b49e5b
parent 27a665a8c5f3ba2ccc57e7c62a87f86d05d2abc8
Author: Tomas Nemec <owl@gtms.dev>
Date:   Mon, 24 Apr 2023 17:06:43 +0200

qr update

Diffstat:
Aqrfoto | 20++++++++++++++++++++
Aqrfotocopy | 6++++++
Aqrshot | 3+++
Aqrshotcopy | 6++++++
4 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/qrfoto b/qrfoto @@ -0,0 +1,20 @@ +#!/usr/bin/env zsh + +file=$(mktemp --suffix=.png) +while :; do + ffmpeg \ + -f video4linux2 \ + -i /dev/v4l/by-id/usb-OmniVision_Technologies__Inc._USB_Camera-B4.09.24.1-video-index0 \ + -vframes 1 \ + -loglevel quiet \ + -y \ + $file + scan=$(zbarimg $file -q --raw) + if [[ $? -eq 0 ]]; then + echo $scan + rm $file + break + else + sleep 1 + fi +done diff --git a/qrfotocopy b/qrfotocopy @@ -0,0 +1,6 @@ +#!/usr/bin/env zsh + +pkill -f "qrfoto$" && exit 0 +text="$(qrfoto)" +notify-send "QR CODE" "$text" +echo "$text" | xclip -sel c diff --git a/qrshot b/qrshot @@ -0,0 +1,3 @@ +#!/usr/bin/env zsh + +import -window root -crop "$(slop -o)" bmp:- | zbarimg -q --raw - diff --git a/qrshotcopy b/qrshotcopy @@ -0,0 +1,6 @@ +#!/usr/bin/env zsh + +pkill -f "qrshot$" && exit 0 +text="$(qrshot)" +notify-send "QR CODE" "$text" +echo "$text" | xclip -sel c