Skip to content

Instantly share code, notes, and snippets.

@Arkanic
Created July 10, 2024 02:43
Show Gist options
  • Save Arkanic/30d98c6f66292f96358a9a454bceb330 to your computer and use it in GitHub Desktop.
Save Arkanic/30d98c6f66292f96358a9a454bceb330 to your computer and use it in GitHub Desktop.
On-screen QR code scanner (KDE)
#!/bin/bash
# requires spectacle, xclip, zbar-tools, and dmtx-utils
# creates a spectacle "rectangle select box", highlight area with QR, barcode, or matrix and press enter - if successful the result will be in your clipboard
spectacle --background --region --nonotify --output /tmp/qrscreenshot.png
(zbarimg -q --raw /tmp/qrscreenshot.png || dmtxread /tmp/qrscreenshot.png) | xclip -selection clipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment