Skip to content

Instantly share code, notes, and snippets.

@eyJhb
Last active January 11, 2021 09:39
Show Gist options
  • Save eyJhb/b3b19f865aa6c3a67e1a35510117eacd to your computer and use it in GitHub Desktop.
Save eyJhb/b3b19f865aa6c3a67e1a35510117eacd to your computer and use it in GitHub Desktop.
OCR
{ pkgs ? import <nixpkgs> }:
let
scriptScreenOCR = pkgs.writeScript "screenocr" ''#!/bin/sh
${pkgs.maim}/bin/maim -s | ${pkgs.tesseract4}/bin/tesseract stdin stdout -l "eng+equ" --psm 1 --oem 3 | ${pkgs.xsel}/bin/xsel -i -b
${pkgs.libnotify}/bin/notify-send "OCR ready!"
'';
scriptScreenOCRWayland = pkgs.writeScript "screenocr" ''#!/bin/sh
${pkgs.grim}/bin/grim -t png -g "$(slurp)" - | ${pkgs.tesseract4}/bin/tesseract tesseract stdin stdout -l "eng+equ" --psm 1 --oem 3 | ${pkgs.wl-clipboard}/bin/wl-copy
${pkgs.libnotify}/bin/notify-send "OCR ready!"
'';
in {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment