The i3 FAQ has migrated to All content here is read-only.
Ask Your Question

How do you use IPC (and scripting libraries)?

asked 2012-06-04 20:21:00 +0000

joepd gravatar image

As a satisfied, year-long, full-time user of i3, I did not get much further than playing with the configuration file, and here and there some i3-msg command. In the documentation much attention is given to the IPC interface, and apparently some scripting libraries have been built upon that. Considering the effort that must have gone into this, I am sure I am still missing out on some Real Goodies™.

The question: To what end and how are you using the IPC and/or its implementations?

Thanks for sharing :)

edit retag flag offensive close merge delete


IMHO it would be good if you can provide examples of use cases you are interested in, so the "extent of use" is more concrete.

mloskot gravatar imagemloskot ( 2012-06-07 10:02:57 +0000 )edit

2 answers

Sort by » oldest newest most voted

answered 2012-08-10 12:28:18 +0000

this post is marked as community wiki

This post is a wiki. Anyone with karma >100 is welcome to improve it.

Here’s a script from another answer which restores workspace to output mappings (without having them configured in the i3 config in a static way):

edit flag offensive delete link more

answered 2012-08-11 21:12:49 +0000

ShadowPrince gravatar image

Currenly I am newbie user, and have only 1 program based on this:

import os
import i3
import sys
import time

def wait_for_new_window(windows):
    return i3.get_tree() == windows

if __name__ == '__main__' or True:
    os.system(sys.argv[1] + '&')
    os.system('i3 split h')
    windows = i3.get_tree()
    while wait_for_new_window(windows): time.sleep(0.1)
    os.system('i3 focus left')
    os.system('i3 kill')

Think there wil be more soon.

edit flag offensive delete link more

Question Tools


Asked: 2012-06-04 20:21:00 +0000

Seen: 486 times

Last updated: Aug 11 '12