Skip to content

atril

This directory provides Talon integration for Atril, the default document viewer for the MATE desktop environment on Linux. It enables standard document navigation controls, allowing hands-free reading and PDF navigation.

The integration is lightweight and consists of two primary files:

  • atril.py: Defines the application context and overrides standard page-navigation actions.
  • atril.talon: Activates the necessary voice commands when Atril is focused.

How It Works

The integration relies on Talon's global user.pages tag, which defines standard voice commands for document navigation (e.g., jumping to a page, moving to the next or previous page, or going to the end of the document).

  1. Application Identification: atril.py registers a Linux-specific application definition matching the application name "Atril".
  2. Enabling Voice Commands: When Atril is the active window, atril.talon activates the user.pages tag, making standard page-navigation voice commands available.
  3. Action Implementation: atril.py overrides the underlying actions that the user.pages tag uses, mapping them to Atril's specific keyboard shortcuts:

    • Next/Previous Page: Uses ctrl-pagedown and ctrl-pageup.
    • Final Page: Sends ctrl-end to jump to the end of the document.
    • Page Jumping: Uses ctrl-l to focus the page number input field, inserts the target page number, and presses enter.
    • Current Page Detection: Uses ctrl-l to select the current page number text, copies it to read the value, and safely restores focus back to the document view.