Spectacle in KDE Plasma has 2 “hidden” features
- it can extract text from images if
tesseractis installed, language packs are installed and the languages are detected by the application - it can scan QR and Barcodes (somehow) if the package
kdePackages.prisonis installed
For OCR, there is a long existing issue
Spectacle does not detect the languagepacks of nixpkgs tesseract, an override can fix this
nixpkgs.overlays = [
(final: prev: {
kdePackages = prev.kdePackages.overrideScope (
kdeFinal: kdePrev: {
spectacle = kdePrev.spectacle.override {
# language shortcodes: https://github.com/tesseract-ocr/tessdoc/blob/f0e2e52803c3ebf281bee2fda8a6d2e168dff266/Data-Files-in-different-versions.md
tesseractLanguages = [
"eng" # english
"deu" # german
"rus" # russian
"ukr" # ukrainian
"chi_sim" # chinese simplified
"chi_tra" # chinese traditional
"ara" # arabic
];
};
}
);
})
];
now this causes Spectacle to be recompiled on every nixos-rebuild, apparently even if there is no change?
Is there a simple way to cache that override somehow to avoid rebuilding it every time? On a weak system this causes big problems and makes quick system changes basically impossible.