Skip to content

evince

This directory provides Talon voice control integration for Evince, the default document viewer for the GNOME desktop environment on Linux.

It implements support for standard document navigation commands by mapping Talon's generic page-navigation actions to Evince's native keyboard shortcuts.

How It Works

The integration consists of two files that work together to detect the application, enable the page-navigation interface, and implement the necessary keystroke actions.

Application Definition and Actions

The evince_linux.py file defines the Evince application context on Linux and implements the user action class for page navigation:

  • Application Detection: It defines apps.evince to match when the operating system is Linux and the application name is Evince.
  • Action Implementations: It overrides the standard user actions for page manipulation to use Evince's keyboard shortcuts:
    • page_current(): Focuses the page input field via ctrl-l, grabs the current page number, and restores focus with escape.
    • page_next(): Sends the n key.
    • page_previous(): Sends the p key.
    • page_jump(number): Focuses the page input field via ctrl-l, inserts the target page number, and presses enter.
    • page_final(): Sends ctrl-end to navigate to the end of the document.

Context and Tag Activation

The evince.talon file activates the integration when Evince is the focused window:

  • Context Matching: It restricts its scope to the evince application.
  • Tag Activation: It activates the user.pages tag. This exposes standard, system-wide voice commands (such as "next page", "page <number>", etc.) defined elsewhere in the Talon community repository, mapping them directly to the implementation details in evince_linux.py.