Add wol-ocr script

This commit is contained in:
2025-04-25 15:04:07 +02:00
parent 34084e45aa
commit 08d3844778
3 changed files with 21 additions and 0 deletions

19
pkgs/wl-ocr/default.nix Normal file
View File

@ -0,0 +1,19 @@
# from fufexan
{
writeShellScriptBin,
lib,
grim,
libnotify,
slurp,
tesseract5,
wl-clipboard,
langs ? "eng+hun+fra+jpn+jpn_vert+kor+kor_vert+pol+ron+spa",
}:
let
_ = lib.getExe;
in
writeShellScriptBin "wl-ocr" ''
${_ grim} -g "$(${_ slurp})" -t ppm - | ${_ tesseract5} -l ${langs} - - | ${wl-clipboard}/bin/wl-copy
echo "$(${wl-clipboard}/bin/wl-paste)"
${_ libnotify} -- "$(${wl-clipboard}/bin/wl-paste)"
''