Skip to content

OCR recipes

Piotr Grabowski edited this page Sep 22, 2022 · 2 revisions

Quickly trigger OCR with mouse hot corners (Linux/wlroots)

When not using a manga viewer with Kamite integration, a good alternative to clicking buttons in Kamite or using keyboard shortcuts for issuing OCR commands are hot corners, i.e. screen areas that, when entered with the mouse cursor, launch a supplied executable. This executable can be a script that sends a specified OCR command to Kamite.

Below is an example of such setup for Linux/wlroots users.

Xorg users who do not have the hot corners feature as a part of their desktop environment might use cornora instead.

  1. Install and build icxes waycorner fork (supports not only screen corners but also edges)

    Requires Rust. Run:

    git clone "https://github.com/icxes/waycorner"
    cd waycorner
    cargo build --release
  2. Create a script that issues the desired OCR command to Kamite, e.g.:

    #!/usr/bin/env bash
    dbus-send --type=method_call --dest=io.github.kamitejp /Receiver io.github.kamitejp.Receiver.command string:'ocr_auto-block'
  3. Create a waycorner config file containing the corner definition

    ~/.config/waycorner/config.toml

    [kamite_ocr_auto_block]
    command = ["/path/to/the/above/script.sh"]
    locations = ["bottom"]
    size_height = 50
    size_width = 1500
    timeout_ms = 30

    See also: waycorner: Configuration.

  4. Verify

    Run:

    path/to/waycorner/target/release/waycorner --preview

    and check if the command is executed properly when entering the highlighted area with the mouse cursor. If so, the program can be used normally without the --preview parameter.

Clone this wiki locally