2

My demand

I often find myself wanting to get the contents of a QR code on a webpage. The ideal workflow I have in mind is as follows:

  1. I hit a hotkey, which triggers this application to launch a screenshot utility
  2. I select an area containing the QR code
  3. The application shows the QR code's content in a popup/notification

Currently I have to first capture the screenshot and save it, then launch a separate QR scanner utility to scan from file. It's a small annoyance once or twice, but it gets infuriatingly tedious when I have to do it a dozen times daily. So this is a workflow I seek to improve.

Personal preferences

I would strongly prefer:

  • Works on Xorg
  • Free and open source
  • Native GUI toolkit (as opposed to things like Electron)

Ideally I would also like (but am willing to forgo):

  • Works on Wayland
  • QT toolkit (I am using KDE)
  • Minimal feature set (do one thing and do it well)
  • Existing ArchLinux or AUR package

I do not care about:

  • Cross platform (I use Linux exclusively for desktop computing nowadays)
  • Doing a little bit of custom setup (e.g. scripts)
  • Number of dependencies
2
  • Have you yried bar code reader apps/ programs Aug 29, 2023 at 8:17
  • Yes, several. They either provide "scan using camera", "scan using file", or both. But I haven't found one that integrates screenshot capturing.
    – cyqsimon
    Aug 29, 2023 at 10:19

1 Answer 1

1

I don't think there's an app that does it in one go. Screenshots apps on Linux are heavily behind e.g. ShareX in terms of functions and that unfortunately is Windows-only and has that feature.

You can however try to combine few apps:

  • some CLI region screenshot grabber like Flameshot
  • some CLI QR code reader like zbarimg
  • something to display the result like notify-send
  • keyboard shortcut to combine everything and run as a command (should be doable in Arch settings from what I see)

Then you can run something along these lines:

flameshot gui --raw | zbarimg --raw - 2>&1 | notify-send -w "QR code output" -
  • 2>&1 is optional and redirects errors to stdout in case you want to know what went wrong, if not, you can use -q switch for that command for cleaner output
  • -w leaves the notification open until manually closed
3
  • I already use flameshot but didn't know it supports piping. That makes it much easier. This will do for now. Thanks.
    – cyqsimon
    Aug 30, 2023 at 7:49
  • 1
    Also, I don't think notify-send acutally supports stdin input IIRC. I can script my way around it, but just for the sake of accuracy you might wish to edit the answer.
    – cyqsimon
    Aug 30, 2023 at 7:51
  • I'll recheck later, I might have had something else in mind, thanks.
    – Destroy666
    Aug 30, 2023 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.