Replies: 1 comment
-
#!/usr/bin/sh
# qrdecode: decode screenshot qrcode
niri msg action screenshot &
event=$(timeout 10 niri msg event-stream | grep -m 1 "Screenshot captured")
if [[ -n "$event" ]]; then
wl-paste | zbarimg --raw - | tr -d '\r\n' | wl-copy
else
exit 1
fiThis way works great for me |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When I try to use
zbarimgto decode a QR code, I notice that if I pressEscto cancel during the screenshot interface, the script keeps running in the background.I’ve tried using
niri msg action screenshot || exit 1, but it seems that when I cancel the screenshot withEsc,niristill returns exit code0.How can I terminate the script when the screenshot is canceled?
Here is my code
Beta Was this translation helpful? Give feedback.
All reactions