The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
1

How do you use IPC (and scripting libraries)?

asked Jun 4 '12

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 :)

Comments

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 (Jun 7 '12)edit

2 answers

Sort by » oldest newest most voted
1

answered Aug 10 '12

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): https://gist.github.com/3310561

0

answered Aug 11 '12

ShadowPrince gravatar image

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

#!/usr/bin/python
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)
    time.sleep(0.1)
    os.system('i3 focus left')
    os.system('i3 kill')

Think there wil be more soon.

Question Tools

Stats

Asked: Jun 4 '12

Seen: 486 times

Last updated: Aug 11 '12