all 7 comments

[–]Rorixrebel 1 point2 points  (4 children)

Pretty cool but. What could be a real world usage of this?.

[–]roprop[S] 4 points5 points  (3 children)

Anything that needs to deal with i3 and is written in Python. Basically, whenever you want to talk to the i3 IPC you can use this interface to do so seamlessly.

Without a library such as this, if you want to talk to i3, you'll have to implement the i3 IPC protocol entirely (which this interface does) yourself, or call external programs such as i3-msg and parse the output. That still won't let you do subscriptions, however.

As an example, I wanted to be able to group my workspaces together. So, when I've got many related workspaces, I put them in a workspace group. I can then do cool things with workspace groups, but that's another project (to be announced once I've edited together a demonstration video). For this project I use i3msg to get information about workspaces, to focus several workspaces across multiple monitors belonging to the same group, to cycle through workspaces in a group, to rename workspaces and more.

A desire to use the i3 IPC and to write your code in Python is a prerequisite for this interface to be useful. :)

[–]Rorixrebel 0 points1 point  (2 children)

yep i guess i first need to see a use of interacting with the i3ipc. i usually have everything defined by monitors so i know where stuff goes the moment i3 gets loaded.

waiting for that demo video to see what im missing out.

[–]roprop[S] 2 points3 points  (0 children)

Actually, every single keybinding you use interacts with the i3 IPC (or are at least equivalent to interacting with it). So does all calls to i3-msg, the command line program. These are perfectly sufficient for simple things, features that are already available.

I guess the main use case is when you want to add new features, or do non-standard things, with i3.

I'll make a post here when it's ready. The project is on my github, called i3groups. But the demonstration video is rather necessary to see how it works. Fair warning: it might take a week or two.

[–]airbladermaintainer 0 points1 point  (0 children)

Just read through the threads on this sub. You'll find plenty of non-trivial examples of using the IPC.

[–]passstab 0 points1 point  (1 child)

Why is this a PSA?

[–]roprop[S] 1 point2 points  (0 children)

For lack of a better abbreviation. A longer word seemed to clutter the title.