File: custom_scripts.rst

package info (click to toggle)
wireplumber 0.5.12-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,244 kB
  • sloc: ansic: 41,043; python: 391; sh: 62; makefile: 57; xml: 23
file content (41 lines) | stat: -rw-r--r-- 1,017 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.. _scripting_custom_scripts:

Custom Scripts
==============

The locations where WirePlumber searches for scripts is explained in
:ref:`config_locations_scripts`.

Scripts are not loaded automatically; a component muse be defined for them, and
this component must be included in a profile. See
:ref:`config_components_and_profiles`.

Full example
------------

Let's assume that ``~/.local/share/wireplumber/scripts/90-hello-world.lua``
contains the following script:

.. code-block:: lua

   log = Log.open_topic("hello-world")
   log.info("Hello world")

In order for it to run, we'll define a component and include it in the default
profile by including the following configuration (for example, in
``~/.config/wireplumber/wireplumber.conf.d/90-hello-world.conf``):

.. code-block::

    wireplumber.components = [
      {
        name = "90-hello-world.lua", type = script/lua
        provides = hello-world
      }
    ]

    wireplumber.profiles = {
      main = {
        hello-world = required
      }
    }