Skip to content
This repository has been archived by the owner on Jun 14, 2019. It is now read-only.
/ i3ipc-d Public archive

D library for communicating with the i3 window manager

License

Notifications You must be signed in to change notification settings

MoritzMaxeiner/i3ipc-d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
}

About

D library for communicating with the i3 window manager

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages