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

how to define a command to kill all terminals in current workspace

asked 2014-10-21 01:28:01 +0000

sylecn gravatar image

Sometimes I want to kill all terminals in one workspace. When there are only terminals in the workspace, I keep pressing kill windows's hotkey repeatly.

Is there a programmable interface to define such command myself? Find windows matching some condition (class/title/on-workspace), then run some action on them (e.g. kill them).

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-10-21 02:56:24 +0000

TonyC gravatar image

You could write a script, such as with i3ipc-glib, like this:

from gi.repository import i3ipc

i3 = i3ipc.Connection()

for con in i3.get_tree().find_focused().workspace().find_classed('URxvt'):
edit flag offensive delete link more


That's the kind of information I was looking for. Thanks.

sylecn gravatar imagesylecn ( 2014-10-21 09:50:51 +0000 )edit

Question Tools


Asked: 2014-10-21 01:28:01 +0000

Seen: 181 times

Last updated: Oct 21 '14