Orca Plugin System

With the Simple Orca Plugin System (SOPS) you can extend the functionality of the Orca screen reader. It offers the possibility to add plug-ins in nearly any programming language in an easy way. The settings for the plug-ins are controlled via the filename.

Setup

To setup the plug-in system for the current user, run:

/usr/share/SOPS/install-for-current-user.sh

This will create the directory ~/.config/SOPS and its subdirectories and enable three plugins: plugin_manager, workspacenumber and clipboard.

To open the plug-in manager use orca+ctrl+p while Orca is running. It can be used to activate, deactivate, install or configure plug-ins. Orca gets re-started automatically after closing the plug-in manager.

Administration

Basics

~/.config/SOPS/plugins-available/

~/.config/SOPS/plugins-enabled/

Administration tools

The tools are located in the "tools" folder beneath the installation directory. The following command enables/activates a plug-in, but you have to rename the filename to create a shortcut and pass a command to the plug-in:

$ /usr/share/SOPS/tools/enssop <pluginname>

The command to disable and unload a plug-in is:

$  /usr/share/SOPS/tools/dissop <pluginname>

Both commands basically just create or delete links in ~./.config/SOPSP/plugins-enabled and make the plug-ins executable. You have to configure the plug-ins manually. Restart Orca to reload the plug-ins after changes.

Plug-ins

You can find some fully predefined example plugins in: /usr/share/SOPS/examples and others in: /usr/share/SOPS/plugins

Structure of the filename

The shortcut, plug-in type and preference of a plug-in are controlled by its filename. The descriptive part of the filename has to be separated from the preferences part with __-__. The commands, modifier and the key has to be separated by __+__.

<description>__-__[<command>__+__command...][__+__<modifier>__+__<modifier>__+__key_<key>].ext

Run a plug-in

There are two different ways to run a plug-in:

If none of those are present. the plug-in won't load. There are some more #Commands to control the behavior of a plug-in.

Modifiers/ Shortcuts

With modifiers you can set different shortcut combinations for a key. You always have to press the Orca-modifier. The order of the three modifier keys do not matter:

Valid shortcuts

Only a few combinations of modifiers are valid. Those are predefined by Orca. Valid combinations are:

As key_<key> you can use any alphanumerical key.

Commands/ Preferences

Preferences for plug-ins are called commands. A command defines the action to pass to the plug-in. With commands you control the behaviour of the plug-ins. You may add more than one command. The order of the commands do not matter. You can use them for all kinds of plug-ins.

Examples

Types of plug-ins

Basically there are two different types of plug-ins.

Sub process plug-ins

Sub process plug-ins are simple plug-ins of a default type. They may be any type of application or script that writes to STDOUT or STDERR. Orca executes the plug-in, reads from STDOUT/ STDERR and announces the result to the user, when the defined shortcut is pressed or the plug-in is executed via exec while starting the screen reader.

Requirements
Example

Say "Hello World when pressing orca+y: Filename:Hello_world__-__key_y.sh

#!/bin/sh
echo "Hello World"

Advanced plug-ins

Those type of plug-ins are loaded with the spec.loader.exec_module. you can load them by using loadmodule in the filename. They are fully integrated into Orca as soon as it starts. Advanced plug-ins are more powerful, because you are able to work in the Orca context. They are mostly similar to the orca-customizations.py.

Requirements
Example

Configure Orca to speak/braille the word "bang" instead of the "!" while loading the plug-in. Filename:replace_chnames__-__loadmodule__+__exec.py

#!/bin/python
import orca.orca
orca.chnames.chnames["!"] = "bang"

Plug-in hosting

You can also host plug-ins, making them available for installation via the plug-in manager. If you want to Host plug-ins, read:

/usr/share/SOPS/tools/hosting.txt

The default online resource is: https://wiki.archlinux.org/title/Simple_Orca_Plugin_System