Safe Eyes is available in Ubuntu PPA, Arch AUR and Python PyPI. You can choose any installation source and install on any Linux system with Python 3. To see how to install Safe Eyes, visit [Getting Started](http://slgobinath.github.io/SafeEyes/#introduction)
A plugin is a combination of two files: `plugin.py` and `config.json`. These two files must be placed in a directory: `~/.config/safeeyes/plugins/<plugin-id>`. Optionally a plugin also can have an image file `icon.png` which is used to represent the plugin in the Settings dialog.
For example, a Weather plugin may have the following file structure:
The `icon.png` must be `24x24` pixels size. If `icon.png` is not available, the default gear icon <imgsrc="https://github.com/slgobinath/SafeEyes/raw/master/safeeyes/resource/ic_plugin.png"width="16"height="16"/> will be shown in the Settings dialog.
"description": "Show the current weather on break screen",
"version": "0.0.1"
},
"dependencies": {
"python_modules": ["pyowm"],
"shell_commands": [],
"operating_systems": [],
"desktop_environments": [],
"resources": []
},
"settings": [
{
"id": "api",
"label": "OpenWeatherMap API Key",
"type": "TEXT",
"default": ""
},
{
"id": "location",
"label": "Location",
"type": "TEXT",
"default": ""
}
],
"break_override_allowed": true
}
```
The `meta` properties must provide the name of the plugin, a short description and the current version of the plugin.
The `dependencies` property defines various dependency constraints of the plugin. The dependencies can be Python modules, commandline tools, desktop environments or Safe Eyes resources. The `operating_systems` property is reserved for operating system dependency but not checked for at the moment.
If a dependency is not available, the Safe Eyes will not load the plugin. The Settings dialog will show a warning symbol <imgsrc="https://github.com/slgobinath/SafeEyes/raw/master/safeeyes/resource/ic_warning.png"width="16"height="16"> and a message to install/check the missing dependencies. Dependencies are checked in the order of *Desktop Environment*, *Python Modules*, *Commandline Tools* and *Resources*. If a dependency is not available, Safe Eyes will stop looking for the rest.
The configurations related to the plugin must be defined in `settings`. Each setting must have an `id`, `label`, `type` and a default value matching the `type`. Safe Eyes 2.0.0 supports only the following types: `INT`, `TEXT` and `BOOL`. According to the types, Settings dialog will show a *Spin*, *Text Field* or *Switch Button* as the input field.
All the above functions are optional and it is the developer's choice to choose the functions to implement. The `pre_break` and `start_break` methods can return `True` if they want to skip the specific break. If a plugin skips the break by returning `True`, the corresponding lifecycle method will not be invoked from the upcoming plugins. The execution order of plugins is not predefined so the plugins should not make any assumption about other plugins.
Plugins willing to show an entry in the break screen must implement both `get_widget_title` and `get_widget_content`. They should return a single line string as the output. If either the title or content is an empty string, the message will not be displayed in the break screen. It is added as an option to skip selective breaks depending on the domain.
A sample `plugin.py` is shown below to disaplay the current weather information: