Added russian OCR screenshot
parent
40b43f940c
commit
5dca4a76b4
|
@ -20,13 +20,24 @@ return {
|
|||
}
|
||||
),
|
||||
|
||||
awful.key( {"Control"}, "Print",
|
||||
awful.key( {"Control", "Shift"}, "Print",
|
||||
function ()
|
||||
screenshot_action("ocr")
|
||||
screenshot_action("ocr-rus")
|
||||
end,
|
||||
|
||||
{
|
||||
description = "OCR Capture",
|
||||
description = "OCR Capture (Russian)",
|
||||
group = "Screenshot"
|
||||
}
|
||||
),
|
||||
|
||||
awful.key( {"Control"}, "Print",
|
||||
function ()
|
||||
screenshot_action("ocr-eng")
|
||||
end,
|
||||
|
||||
{
|
||||
description = "OCR Capture (English)",
|
||||
group = "Screenshot"
|
||||
}
|
||||
),
|
||||
|
|
|
@ -23,7 +23,7 @@ function capture
|
|||
case pin
|
||||
flameshot gui --accept-on-select --pin
|
||||
|
||||
case ocr
|
||||
case ocr-eng
|
||||
flameshot gui --accept-on-select --path $tmp_file
|
||||
|
||||
# Recognize text
|
||||
|
@ -33,6 +33,16 @@ function capture
|
|||
echo $ocr | sed -e "s/^[ \t]*//" | xclip -i -rmlastnl -selection clipboard
|
||||
rm $tmp_file
|
||||
|
||||
case ocr-rus
|
||||
flameshot gui --accept-on-select --path $tmp_file
|
||||
|
||||
# Recognize text
|
||||
set ocr (tesseract --dpi 96 -l rus $tmp_file stdout)
|
||||
|
||||
# Trim whitespace and copy to clipboard
|
||||
echo $ocr | sed -e "s/^[ \t]*//" | xclip -i -rmlastnl -selection clipboard
|
||||
rm $tmp_file
|
||||
|
||||
|
||||
case "*"
|
||||
echo "Unknown action \"$argv[1]\""
|
||||
|
|
Loading…
Reference in New Issue