mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-25 03:08:34 +02:00
i3-companion: document polybar wire-format
This commit is contained in:
parent
9cc40b8755
commit
f128c10012
1 changed files with 5 additions and 1 deletions
|
@ -265,7 +265,11 @@ def polybar(module):
|
||||||
|
|
||||||
# Send it to polybar
|
# Send it to polybar
|
||||||
cmd = bytes(f"#{module}.send.{content}", "utf-8")
|
cmd = bytes(f"#{module}.send.{content}", "utf-8")
|
||||||
data = b"polyipc" + struct.pack("=BIB", 0, len(cmd), 2) + cmd
|
data = (
|
||||||
|
b"polyipc" # magic
|
||||||
|
+ struct.pack("=BIB", 0, len(cmd), 2) # header: version, length, type
|
||||||
|
+ cmd
|
||||||
|
)
|
||||||
for name in glob.glob(f"{os.getenv('XDG_RUNTIME_DIR')}/polybar/*.sock"):
|
for name in glob.glob(f"{os.getenv('XDG_RUNTIME_DIR')}/polybar/*.sock"):
|
||||||
try:
|
try:
|
||||||
reader, writer = await asyncio.open_unix_connection(name)
|
reader, writer = await asyncio.open_unix_connection(name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue