Compare commits

...

3 Commits

3 changed files with 22 additions and 2 deletions

View File

@ -47,6 +47,7 @@ in
brightnessctl
# grimblast
frajul.hyprshot-gui
frajul.wl-ocr
wf-recorder
wl-clipboard
@ -56,8 +57,6 @@ in
enable = true;
};
xdg.mimeApps.enable = true; # TODO: what is that?
home.sessionVariables = {
MOZ_ENABLE_WAYLAND = 1;
QT_QPA_PLATFORM = "wayland";
@ -174,6 +173,7 @@ in
preserve_split = true; # You probably want this
smart_split = false;
smart_resizing = false;
force_split = 2;
# no_gaps_when_only = 2; # with border
};

View File

@ -15,4 +15,5 @@
xwacomcalibrate = pkgs.callPackage ./xwacomcalibrate { };
acer-battery-health-mode = pkgs.callPackage ./acer-battery-health-mode { };
pob2 = pkgs.callPackage ./pob2 { };
wl-ocr = pkgs.callPackage ./wl-ocr { };
}

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)"
''