<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>i3 FAQ - Individual question feed</title><link>https://faq.i3wm.org/questions/</link><description>Frequently asked questions and answers about the i3 window manager</description><atom:link href="http://faq.i3wm.org/feeds/question/5106/" rel="self"></atom:link><language>en</language><copyright>Copyright i3, 2012</copyright><lastBuildDate>Sat, 06 Dec 2014 22:33:39 +0000</lastBuildDate><item><title>i3 "empty" event: is there a way to get the workspace which is emptied?</title><link>https://faq.i3wm.org/question/5106/i3-empty-event-is-there-a-way-to-get-the-workspace-which-is-emptied/</link><description>"empty" event is an event which notifies subscribers that a workspace has its last window closed. However, it does not tell which workspace is closed. Is there a way to know it?

I know a partially useful solution is to always remember the last focused workspace, as in many cases the last focused workspace is new empty workspace. But this is not reliable, since a window can be killed in a workspace that users don't touch.</description><pubDate>Sat, 06 Dec 2014 07:14:23 +0000</pubDate><guid>https://faq.i3wm.org/question/5106/i3-empty-event-is-there-a-way-to-get-the-workspace-which-is-emptied/</guid></item><item><title>Answer by Michael for &lt;p&gt;"empty" event is an event which notifies subscribers that a workspace has its last window closed. However, it does not tell which workspace is closed. Is there a way to know it?&lt;/p&gt;

&lt;p&gt;I know a partially useful solution is to always remember the last focused workspace, as in many cases the last focused workspace is new empty workspace. But this is not reliable, since a window can be killed in a workspace that users don't touch.&lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/5106/i3-empty-event-is-there-a-way-to-get-the-workspace-which-is-emptied/?answer=5117#post-id-5117</link><description>Send a patch to http://cr.i3wm.org/ which modifies i3 to include it. src/con.c:1376 is where the event is generated currently, but you’ll need to switch from a hard-coded string to actually JSON-encoding the workspace title — see the other events.

I think a reasonable workaround is to store a list of workspaces, refresh that list of workspaces after getting a “"change": "empty"” workspace event and taking the difference between the two lists.</description><pubDate>Sat, 06 Dec 2014 22:21:09 +0000</pubDate><guid>https://faq.i3wm.org/question/5106/i3-empty-event-is-there-a-way-to-get-the-workspace-which-is-emptied/?answer=5117#post-id-5117</guid></item><item><title>Comment by xuhdev for &lt;p&gt;Send a patch to &lt;a href="http://cr.i3wm.org/"&gt;http://cr.i3wm.org/&lt;/a&gt; which modifies i3 to include it. src/con.c:1376 is where the event is generated currently, but you’ll need to switch from a hard-coded string to actually JSON-encoding the workspace title — see the other events.&lt;/p&gt;

&lt;p&gt;I think a reasonable workaround is to store a list of workspaces, refresh that list of workspaces after getting a “"change": "empty"” workspace event and taking the difference between the two lists.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/5106/i3-empty-event-is-there-a-way-to-get-the-workspace-which-is-emptied/?comment=5122#comment-5122</link><description>I actually checked the focus event (which gives additional information), but I don't see the JSON way you mentioned...</description><pubDate>Sat, 06 Dec 2014 22:33:39 +0000</pubDate><guid>https://faq.i3wm.org/question/5106/i3-empty-event-is-there-a-way-to-get-the-workspace-which-is-emptied/?comment=5122#comment-5122</guid></item></channel></rss>