Skip to content

2. Setting Up Your Environment

After you have come up with an idea, all you have to do is put it into practice.

To develop StreamController plugins you need the source code of StreamController itself.
This allows you to deeply integrate your plugin into the application.

Note

Should your plugin require modification of the code of StreamController, you will need to open a pull request. Just make sure that all requested changes outside of your plugin are generic ones and not specific to your plugin.

1. Clone StreamController:

Clone StreamController from GitHub by typing:

git clone https://github.com/StreamController/StreamController

2. Enter the StreamController directory:

cd StreamController

3. Create a virtual environment:

python -m venv .venv

4. Activate the virtual environment:

source .venv/bin/activate

5. Install pip requirements:

pip install -r requirements.txt

6. Change the data path

StreamController normally stores data in the .var/app/com.core447.StreamController/data directory. However, for development it is useful to change the path to a directory inside the cloned repository. I recommend using creating a data directory in the root of the repository.

Create the directory:

mkdir -p data

You can then use the the --data argument to override the data path on launch. For example: --data data. Depending on your IDE you can also add this to your project configuration.

Note

If you have installed StreamController for your personal use as a Flatpak, this will not affect the data path of your Flatpak.

6 Enter the plugins directory:

cd data/plugins

7. Create a plugin repository by using the Plugin Template:

Head over to GitHub and click on the green Use this template button. Follow the instructions.

The next step is to clone the newly created repository:

git clone https://github.com/username/plugin-template
This will create a new directory called plugin-template in the plugins directory with a bunch of files. But no worry, I will explain each of them in the next section.

8. Rename the PluginTemplate directory:

mv PluginTemplate com_example_plugin

Note

The plugin name should be in reverse domain notation, but with underscores instead of periods. For example, com_example_plugin. You have to use underscores because python cannot handle periods in file and directory names.