i3ipc-d ~master
D library for communicating with the i3 window manager
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
i3ipc-d
i3ipc-d provides a high-level D API to the window manager i3's interprocess communication interface.
See here for an example showing all available API methods and here for all examples. A connection in i3ipc-d has always exactly one of the following characteristics:
- threaded (events are automatically dispatched by a dedicated thread),
- fibered (events need to be explicitly dispatched by calling
`connection.dispatch
`), or - eventless (events are not supported at all).
The following shows how to setup a threaded connection:
module threaded;
import core.time : seconds;
import core.thread : Thread, dur;
import std.stdio : writeln;
import i3ipc;
void main(string[] args)
{
auto connection = i3ipc.connect!Thread;
connection.subscribe!"Workspace"((change, current, old) => writeln(change, " ", current, " ", old));
writeln("Connection open for approximately 3 seconds, please generate some i3 workspace events!");
/+ A thread-backed connection automatically dispatches events,
+ this just delays program termination.
+/
Thread.sleep(3.seconds);
}
- Registered by Moritz Maxeiner
- ~master released 8 years ago
- MoritzMaxeiner/i3ipc-d
- github.com/Calrama/i3ipc-d
- MIT
- Copyright © 2016, Moritz Maxeiner
- Authors:
- Dependencies:
- none
- Versions:
-
0.0.1 2016-Mar-29 ~master 2016-May-31 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
55 downloads total
-
- Score:
- 1.0
- Short URL:
- i3ipc-d.dub.pm