Last active
January 11, 2021 09:39
-
-
Save eyJhb/b3b19f865aa6c3a67e1a35510117eacd to your computer and use it in GitHub Desktop.
OCR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 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