Commit graph

20 commits

Author SHA1 Message Date
George Kiagiadakis
b100bdda4a event-hook: remove the exec type property & enumeration
With the latest changes, we can implement the "after-events" type
with external code that pushes a very low priority event that is
the "rescan" event.
2023-04-17 07:48:18 -04:00
George Kiagiadakis
bcb4e80723 m-std-event-source: use type-specific event names and multiple object managers
It is better to have type-specific event names to minimize the amount
of constraint string matches we do on hooks, as most hooks (if not all)
are interested on specific types of objects only.

Similarly, use a different object manager for each object type to
minimize the performance impact of iterations and lookups, as all
such actions are interested in only 1 object type every time.

Port all existing hooks to the new event names and the get-object-manager API.
2023-04-17 07:48:18 -04:00
George Kiagiadakis
6668b40941 scripts: simplify policy-device-profile.lua 2023-04-17 07:48:18 -04:00
George Kiagiadakis
c2c95bf726 scripts: port misc hooks to use the new priority enumerations 2023-04-17 07:48:18 -04:00
Julian Bouzas
6afca096e8 policy-device-profile.lua: use default rules if none are defined 2023-04-17 07:48:18 -04:00
Julian Bouzas
42fc17b234 config: clean and comment all configuration that is not needed by default
Most of the configuration settings have a default value when they are loaded by
the Lua scripts if they are not present, so we leave them commented in the
configuration. This will make the configuration smaller when supporting layered
configuration, as all the commented sections will be part of the override files.
2023-04-17 07:48:16 -04:00
Ashok Sidipotu
6762de3990 policy-{bluetooth|device-profile|device-routes}.lua: Optimize for Event stack
- Sharpen the hooks.
- Make settings live, apply them when they are changed.
- Move some of the common functions to common_utils.lua
2023-04-17 07:47:09 -04:00
Julian Bouzas
a76e780b4b docs: update new configuration file names 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
d57e387f75 event-hooks: give unique names to event hooks 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
82a8bc5673 event-hooks: remove the unwanted second arg in simple hooks 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
695b99f0e8 device-profiles: Port to event-stack 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
78c2e3167a device-profiles: Add summary 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
9197dac94d policy-device-profile.lua: Adjust style 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
e180ff2f94 device-settings: Switch device settings to wpsettings
- move all the device based settings and scripts to JSON config and
  remove config/lua references.
2023-04-17 07:44:19 -04:00
Julian Bouzas
7a70b04237 policy-device-profile: set best profile even if it has not changed
We want to set the best profile even if it has not changed, because it can be
different than the active profile.

Fixes #329
2022-07-31 10:09:32 -04:00
George Kiagiadakis
d7f17104bf policy-device-profile: always consider the stored default profile when re-evaluating
Fixes: #179
2022-06-28 08:30:10 +00:00
Pauli Virtanen
da5d25acbe scripts: policy-device-profile: clear tables when devices removed
When device ids are invalidated, clear all local tables about them,
because the id may be reused by different object, or the same object
reappearing.
2022-04-04 09:44:43 +00:00
Julian Bouzas
6133d85392 policy-device-profile: Don't restore if active profile is persistent and default
Fixes #204
2022-02-25 16:11:40 +00:00
Julian Bouzas
2d303cf6a9 policy-device-profile: add option to set persistent profiles
Persistent profiles will never change. This can be useful if we want to keep
a specific device profile even if a new one with higher priority becomes
available. For example, keep the 'off' profile instead of switching to best
profile when monitor screens is resumed.

See #138
2022-02-16 13:37:40 -05:00
Julian Bouzas
b3446efa16 config: port device-activation module to policy-device.profile.lua
Because all wireplumber policies are in Lua.
2022-02-16 13:37:40 -05:00