Initial commit: Hyprland 0.57 rice for Fedora 44
Dark minimalist setup for a sysadmin workstation: rounded blur windows with the DMS pink accent, keyboard-driven SSH hub (Mod+S), run-or-raise app binds, Alt+Tab window switching, OCR of screen regions, hotkey cheatsheet, DMS network-editor plugin and the systemd session target for portals. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
# Select a screen region, OCR it (English + Russian) and put the text in the clipboard.
|
||||
if ! command -v tesseract >/dev/null; then
|
||||
notify-send -a ocr "OCR" "tesseract is not installed:\nsudo dnf install tesseract tesseract-langpack-eng tesseract-langpack-rus"
|
||||
exit 1
|
||||
fi
|
||||
geom=$(slurp -b 00000066 -c e91e63ff -w 2) || exit 0
|
||||
img() { grim -g "$geom" -; }
|
||||
if command -v magick >/dev/null; then img() { grim -g "$geom" - | magick png:- -resize 200% -colorspace Gray png:-; }; fi
|
||||
text=$(img | tesseract stdin stdout -l eng+rus --psm 6 2>/dev/null | sed 's/[[:space:]]*$//')
|
||||
[ -z "$text" ] && { notify-send -a ocr "OCR" "nothing recognised"; exit 1; }
|
||||
printf '%s' "$text" | wl-copy
|
||||
notify-send -a ocr "Copied $(printf '%s\n' "$text" | wc -l) line(s)" "$(printf '%s\n' "$text" | head -2)"
|
||||
Reference in New Issue
Block a user