mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-08-02 17:24:27 +02:00
i3-companion: ensure variables are captured when wrapping event
This commit is contained in:
parent
83ba6b5a23
commit
d56b44114a
1 changed files with 11 additions and 9 deletions
|
@ -456,6 +456,7 @@ async def main(options):
|
||||||
if isinstance(event, DBusSignal):
|
if isinstance(event, DBusSignal):
|
||||||
for bus in {i3.session_bus, i3.system_bus}:
|
for bus in {i3.session_bus, i3.system_bus}:
|
||||||
|
|
||||||
|
def wrapping(fn, event):
|
||||||
@ravel.signal(
|
@ravel.signal(
|
||||||
name=event.member,
|
name=event.member,
|
||||||
in_signature=event.signature,
|
in_signature=event.signature,
|
||||||
|
@ -464,13 +465,14 @@ async def main(options):
|
||||||
)
|
)
|
||||||
async def wrapped(path, args):
|
async def wrapped(path, args):
|
||||||
return await fn(i3, event, path, *args)
|
return await fn(i3, event, path, *args)
|
||||||
|
return wrapped
|
||||||
|
|
||||||
bus.listen_signal(
|
bus.listen_signal(
|
||||||
path=event.path,
|
path=event.path,
|
||||||
fallback=True,
|
fallback=True,
|
||||||
interface=event.interface,
|
interface=event.interface,
|
||||||
name=event.member,
|
name=event.member,
|
||||||
func=wrapped,
|
func=wrapping(fn, event),
|
||||||
)
|
)
|
||||||
|
|
||||||
await i3.main()
|
await i3.main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue