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.evinceto match when the operating system is Linux and the application name isEvince. - Action Implementations: It overrides the standard
useractions for page manipulation to use Evince's keyboard shortcuts:page_current(): Focuses the page input field viactrl-l, grabs the current page number, and restores focus withescape.page_next(): Sends thenkey.page_previous(): Sends thepkey.page_jump(number): Focuses the page input field viactrl-l, inserts the target page number, and pressesenter.page_final(): Sendsctrl-endto 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
evinceapplication. - Tag Activation: It activates the
user.pagestag. 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.