Commit graph

11 commits

Author SHA1 Message Date
Guido Günther
c095ae5254 role-based-policy: Allow to set target sink for media role loopbacks
There are streams that should go to a speaker rather than a headphone
or earpiece by default. Examples are alarms and emergency alerts on
phones. Allow to set a preference via
`policy.role-based.preferred-target` which then looks up the target
via `node.name` and `node.nick`.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-10-25 16:12:01 +03:00
George Kiagiadakis
abc299c1d3 linking: redefine script dependencies
This way of definining dependencies ensures that if we remove one
of the find-* hooks from the config, the rest of them will continue
to work in the expected order. Previously, removing one of them
would break the entire chain.
2024-06-28 10:21:02 +03:00
George Kiagiadakis
42727fcbc6 linking: move find-media-role-target hook to run later in the chain
A defined target should have priority over a role-based target
2024-06-26 15:50:20 +03:00
George Kiagiadakis
5d41ef2311 scripts: s/putils/lutils/g ("policy" utils -> "linking" utils) 2024-01-03 11:10:56 +02:00
George Kiagiadakis
1e40108d94 linking-utils: rename unwrap_find_target_event -> unwrap_select_target_event 2023-09-30 12:06:40 +03:00
George Kiagiadakis
43aa2d4952 scripts: don't use 'local' for file-wide scoped variables
Since all scripts run in a sandbox with their own global environment,
it means that they don't interfere with each other's global variables.
Therefore, all file-wide variables can be declared global without
any change in behavior. In my understanding, it is better to do so
because this means that any code accessing those variables is going
to access them directly from the global environment table with a simple
lookup rather than having each variable referenced in the local closure
of each function separately.
2023-09-29 23:13:28 +03:00
Ashok Sidipotu
0dcd28e50f Lua scripts: replace "policy" with "linking" 2023-09-26 10:09:03 +03:00
Julian Bouzas
56017fdbe6 scripts: use filter-utils to implement smart filter policy 2023-09-03 14:33:34 +00:00
George Kiagiadakis
982bebe5aa scripts: use log topics 2023-05-19 20:12:08 +03:00
George Kiagiadakis
258d9f32e1 scripts: rename all hooks to follow a nicer naming scheme
Use the directory name and file name to construct the hook's name,
like a path. This way, when you see a hook name, it is clear where
to find that hook in the source code.
2023-04-17 07:48:18 -04:00
George Kiagiadakis
652a6a6698 scripts: rename directories to follow the new naming scheme
* client: Logic that deals with configuring clients (basically, permissions)
* device: Anyhing that that deals with configuring devices (profiles, routes, ...)
* node: Anything that deals with node objects: configuring nodes, changing
  their state, their properties and also creating new nodes (but NOT linking them)
* linking: All the logic for creating links between nodes (and obviously,
  deciding which links to create)
* monitors: Scripts that deal with hardware subsystems, mainly monitoring
  hardware changes and reflecting them on pipewire
* default-nodes: All the logic for selecting the default sinks and sources
2023-04-17 07:48:18 -04:00
Renamed from src/scripts/policy-desktop/find-default-target.lua (Browse further)