add new-output handler

This commit is contained in:
Leon Henrik Plickat
2024-03-21 03:40:46 +01:00
parent a5b129d637
commit 744ce4b1eb
8 changed files with 116 additions and 2 deletions

View File

@@ -201,10 +201,35 @@ As of now, river only supports a single seat anyway.
.RE
.
.P
\fBnew-output\fR
.RE
.RS
A handler installed under this key will be called everytime a new output appears.
On binding, it is also called for all outputs that already exist at that time.
.P
Installing a new-output handler will cause riverguile to run continously.
.P
The handler procderure must accept a single argument, the global name of the
output (integer).
.P
Here is an example of a simple new-output handler which merely logs new outputs:
.P
.RS
.EX
(\fBinstall-handler\fR 'new-output
(\fBlambda\fR (output)
(\fBdisplay\fR "New output: ")
(\fBdisplay\fR output)
(\fBnewline\fR)))
.EE
.RE
.RE
.
.P
\fBexit\fR
.RE
.RS
This key allows you to installs a handler which is called when riverguile exits.
This key allows you to install a handler which is called when riverguile exits.
.P
The procedure takes no arguments.
.P