i3pyblocks.blocks.i3ipc
Blocks based on i3ipc.
This module contains WindowTitleBlock, that uses i3ipc to show the current
window title in i3pyblocks.
Since it uses a publish/subscribe mechanism, it should be highly efficient, only updating when it is actually needed.
Module Contents
Classes
Block that shows the current window title. |
- class i3pyblocks.blocks.i3ipc.WindowTitleBlock(format: str = '{window_title:.81s}', **kwargs)
Bases:
i3pyblocks.blocks.BlockBlock that shows the current window title.
- Parameters
format – Format string to shown. Supports
{window_title}placeholder.**kwargs – Extra arguments to be passed to
Blockclass.
- async clear_title(self, *_)
- async update_title(self, connection, *_)
- async start(self) None
Starts a Block.
This is an abstract method, so it should be overriden.
This method is where you generally wants to put your main loop to update the state of the Block. This loop can either be triggered by events or can be an infinity loop. It can even be a single call to
update(), but in this case your Block will only be updated once.