<?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/1773/" rel="self"></atom:link><language>en</language><copyright>Copyright i3, 2012</copyright><lastBuildDate>Tue, 18 Aug 2015 22:35:33 +0000</lastBuildDate><item><title>How can I configure i3wm to make Alt+Tab action just like in Windows?</title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/</link><description>sometiems it would be convinent to enable that function. but how? 

thanks</description><pubDate>Thu, 09 May 2013 08:57:37 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/</guid></item><item><title>Comment by joepd for &lt;p&gt;sometiems it would be convinent to enable that function. but how? &lt;/p&gt;

&lt;p&gt;thanks&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=1810#comment-1810</link><description>+1 for question because of the number of good reactions</description><pubDate>Tue, 14 May 2013 22:39:46 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=1810#comment-1810</guid></item><item><title>Answer by joepd for &lt;p&gt;sometiems it would be convinent to enable that function. but how? &lt;/p&gt;

&lt;p&gt;thanks&lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?answer=1804#post-id-1804</link><description>It has been asked for multiple times, but [won't be implemented](http://bugs.i3wm.org/query/ticket/840#comment:1). 

Maybe it will be more easily findable if quoted here: 

&gt; 1. Cycling through windows in focus order (like alt-tab) is something we don’t want to implement:
The order in which alt+tab switches through windows is not easily predictable (due to our internal tree layout), thus either not doing what you want or making a separate visual element necessary (like a window list).
&gt; 2. Having such a visual element as discussed in 1 would need hand-eye coordination: you press a key (hand), then look at the screen, figure out what you want, then press another key.
&gt; 3. Direction focus is quicker. Instead of having one shortcut to go through all windows, you have 4.
Maybe slowpoke’s window switching script (ask him on IRC) is what you are looking for.
&gt; 
&gt; If it’s not, maybe you can build your idea with the IPC interface. It’s not going to be in core i3, though. </description><pubDate>Mon, 13 May 2013 21:40:57 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?answer=1804#post-id-1804</guid></item><item><title>Comment by Michael Rose for &lt;p&gt;It has been asked for multiple times, but &lt;a href="http://bugs.i3wm.org/query/ticket/840#comment:1"&gt;won't be implemented&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Maybe it will be more easily findable if quoted here: &lt;/p&gt;

&lt;blockquote&gt;
  &lt;ol&gt;
  &lt;li&gt;Cycling through windows in focus order (like alt-tab) is something we don’t want to implement:
  The order in which alt+tab switches through windows is not easily predictable (due to our internal tree layout), thus either not doing what you want or making a separate visual element necessary (like a window list).&lt;/li&gt;
  &lt;li&gt;Having such a visual element as discussed in 1 would need hand-eye coordination: you press a key (hand), then look at the screen, figure out what you want, then press another key.&lt;/li&gt;
  &lt;li&gt;Direction focus is quicker. Instead of having one shortcut to go through all windows, you have 4.
  Maybe slowpoke’s window switching script (ask him on IRC) is what you are looking for.&lt;/li&gt;
  &lt;/ol&gt;
  
  &lt;p&gt;If it’s not, maybe you can build your idea with the IPC interface. It’s not going to be in core i3, though. &lt;/p&gt;
&lt;/blockquote&gt;
</title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=6459#comment-6459</link><description>Ex. move mouse to bottom of screen, move mouse to right application, if multiple instances exist select from and click vs alt+tab tab or $mod+direction or at worst $mod+num + $mod+direction</description><pubDate>Tue, 18 Aug 2015 22:35:33 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=6459#comment-6459</guid></item><item><title>Comment by Michael Rose for &lt;p&gt;It has been asked for multiple times, but &lt;a href="http://bugs.i3wm.org/query/ticket/840#comment:1"&gt;won't be implemented&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Maybe it will be more easily findable if quoted here: &lt;/p&gt;

&lt;blockquote&gt;
  &lt;ol&gt;
  &lt;li&gt;Cycling through windows in focus order (like alt-tab) is something we don’t want to implement:
  The order in which alt+tab switches through windows is not easily predictable (due to our internal tree layout), thus either not doing what you want or making a separate visual element necessary (like a window list).&lt;/li&gt;
  &lt;li&gt;Having such a visual element as discussed in 1 would need hand-eye coordination: you press a key (hand), then look at the screen, figure out what you want, then press another key.&lt;/li&gt;
  &lt;li&gt;Direction focus is quicker. Instead of having one shortcut to go through all windows, you have 4.
  Maybe slowpoke’s window switching script (ask him on IRC) is what you are looking for.&lt;/li&gt;
  &lt;/ol&gt;
  
  &lt;p&gt;If it’s not, maybe you can build your idea with the IPC interface. It’s not going to be in core i3, though. &lt;/p&gt;
&lt;/blockquote&gt;
</title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=6458#comment-6458</link><description>In floating arrangements especially without virtual desktops its tedious to focus the right window if you have lots and therefore much easier to use alt tab shift alt tab to go back and forth between recent ones.  Virtual desktops and having all windows on a desktop shown make it $mod+dir better</description><pubDate>Tue, 18 Aug 2015 22:33:43 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=6458#comment-6458</guid></item><item><title>Comment by faust for &lt;p&gt;It has been asked for multiple times, but &lt;a href="http://bugs.i3wm.org/query/ticket/840#comment:1"&gt;won't be implemented&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Maybe it will be more easily findable if quoted here: &lt;/p&gt;

&lt;blockquote&gt;
  &lt;ol&gt;
  &lt;li&gt;Cycling through windows in focus order (like alt-tab) is something we don’t want to implement:
  The order in which alt+tab switches through windows is not easily predictable (due to our internal tree layout), thus either not doing what you want or making a separate visual element necessary (like a window list).&lt;/li&gt;
  &lt;li&gt;Having such a visual element as discussed in 1 would need hand-eye coordination: you press a key (hand), then look at the screen, figure out what you want, then press another key.&lt;/li&gt;
  &lt;li&gt;Direction focus is quicker. Instead of having one shortcut to go through all windows, you have 4.
  Maybe slowpoke’s window switching script (ask him on IRC) is what you are looking for.&lt;/li&gt;
  &lt;/ol&gt;
  
  &lt;p&gt;If it’s not, maybe you can build your idea with the IPC interface. It’s not going to be in core i3, though. &lt;/p&gt;
&lt;/blockquote&gt;
</title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=5703#comment-5703</link><description>It should be implemented - there's a reason why it's been implemented and used in other desktop environments. </description><pubDate>Tue, 31 Mar 2015 08:13:57 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=5703#comment-5703</guid></item><item><title>Answer by mschaefer for &lt;p&gt;sometiems it would be convinent to enable that function. but how? &lt;/p&gt;

&lt;p&gt;thanks&lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?answer=1807#post-id-1807</link><description>This is maybe not the most elegant way but just a first quick-and-dirty Python/Bash implementation. I have written a python script that extracts all window id's from the layout tree and prints the one after the currently focused window. The script's output is then used by a bash script to go to this window via i3-msg (could be done in the python script as well I think...) You can then configure your i3 such that you can walk over all windows (with exceptions, see "Drawbacks" below) using e.g. Alt+Tab.

Here is the code for id_list.py:
&lt;pre&gt;
import json
import subprocess


"""
Execute the given command and return the 
output as a list of lines
"""
def command_output(cmd):
    output = []
    if (cmd):
        p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, \
                                 stderr=subprocess.STDOUT)
        for line in p.stdout.readlines():
            output.append(line.rstrip())
    return output


def output_to_dict(output_list):
    output_string = ""
    for line in output_list:
        output_string += line
    return json.loads(output_string)


def find_windows(tree_dict, window_list):
    if (tree_dict.has_key("nodes") and len(tree_dict["nodes"]) &gt; 0):
        for node in tree_dict["nodes"]:
            find_windows(node, window_list)
    else:
        if (tree_dict["layout"] != "dockarea" and not tree_dict["name"].startswith("i3bar for output") and not tree_dict["window"] == None):
            window_list.append(tree_dict)

    return window_list        


def main():
    output = command_output("i3-msg -t get_tree")
    tree = output_to_dict(output)
    window_list = find_windows(tree, [])
    
    next_index = -1
    for i in range(len(window_list)):
        if (window_list[i]["focused"] == True):
            next_index = i+1
            break

#    next_index = len(window_list)
#    for i in range(len(window_list)-1, -1, -1):
#        if (window_list[i]["focused"] == True):
#            next_index = i-1
#            break
    
    next_id = 0;
    if next_index == -1 or next_index == len(window_list):
        next_id = window_list[0]["window"]
    else:        
        next_id = window_list[next_index]["window"]

    print next_id

main()
&lt;/pre&gt;

and the bash script tab_windows.sh:
&lt;pre&gt;
#!/bin/bash

id=`python ~/.i3/id_list.py`
i3-msg [id="$id"] focus &gt; /dev/null
&lt;/pre&gt;

Suppose these scripts lay in ~/.i3/ insert the following line into your i3 config:
&lt;code&gt;bindsym Mod1+Tab exec ~/.i3/tab_windows.sh&lt;/code&gt;

**Drawbacks:**

 - the script uses the hard-coded string "i3bar on output" to get rid of the i3bars which do not seem to be focusable; didn't find another method to exclude them from the tree
 - windows on a scratchpad cannot be reached with these scripts; I don't see these windows in the layout tree !?
 - script traverses the entire layout tree on every call. Maybe a solution with an id buffer is possible !?</description><pubDate>Tue, 14 May 2013 10:29:51 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?answer=1807#post-id-1807</guid></item><item><title>Comment by msx for &lt;p&gt;This is maybe not the most elegant way but just a first quick-and-dirty Python/Bash implementation. I have written a python script that extracts all window id's from the layout tree and prints the one after the currently focused window. The script's output is then used by a bash script to go to this window via i3-msg (could be done in the python script as well I think...) You can then configure your i3 such that you can walk over all windows (with exceptions, see "Drawbacks" below) using e.g. Alt+Tab.&lt;/p&gt;

&lt;p&gt;Here is the code for id_list.py:&lt;/p&gt;

&lt;pre&gt;import json
import subprocess


"""
Execute the given command and return the 
output as a list of lines
"""
def command_output(cmd):
    output = []
    if (cmd):
        p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, \
                                 stderr=subprocess.STDOUT)
        for line in p.stdout.readlines():
            output.append(line.rstrip())
    return output


def output_to_dict(output_list):
    output_string = ""
    for line in output_list:
        output_string += line
    return json.loads(output_string)


def find_windows(tree_dict, window_list):
    if (tree_dict.has_key("nodes") and len(tree_dict["nodes"]) &amp;gt; 0):
        for node in tree_dict["nodes"]:
            find_windows(node, window_list)
    else:
        if (tree_dict["layout"] != "dockarea" and not tree_dict["name"].startswith("i3bar for output") and not tree_dict["window"] == None):
            window_list.append(tree_dict)

    return window_list        


def main():
    output = command_output("i3-msg -t get_tree")
    tree = output_to_dict(output)
    window_list = find_windows(tree, [])

    next_index = -1
    for i in range(len(window_list)):
        if (window_list[i]["focused"] == True):
            next_index = i+1
            break

#    next_index = len(window_list)
#    for i in range(len(window_list)-1, -1, -1):
#        if (window_list[i]["focused"] == True):
#            next_index = i-1
#            break

    next_id = 0;
    if next_index == -1 or next_index == len(window_list):
        next_id = window_list[0]["window"]
    else:        
        next_id = window_list[next_index]["window"]

    print next_id

main()
&lt;/pre&gt;

&lt;p&gt;and the bash script tab_windows.sh:&lt;/p&gt;

&lt;pre&gt;#!/bin/bash

id=`python ~/.i3/id_list.py`
i3-msg [id="$id"] focus &amp;gt; /dev/null
&lt;/pre&gt;

&lt;p&gt;Suppose these scripts lay in ~/.i3/ insert the following line into your i3 config:
&lt;code&gt;bindsym Mod1+Tab exec ~/.i3/tab_windows.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Drawbacks:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the script uses the hard-coded string "i3bar on output" to get rid of the i3bars which do not seem to be focusable; didn't find another method to exclude them from the tree&lt;/li&gt;
&lt;li&gt;windows on a scratchpad cannot be reached with these scripts; I don't see these windows in the layout tree !?&lt;/li&gt;
&lt;li&gt;script traverses the entire layout tree on every call. Maybe a solution with an id buffer is possible !?&lt;/li&gt;
&lt;/ul&gt;
</title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=5427#comment-5427</link><description>Ferpect, I was dying for this feature :D</description><pubDate>Wed, 04 Feb 2015 21:32:38 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=5427#comment-5427</guid></item><item><title>Comment by mschaefer for &lt;p&gt;This is maybe not the most elegant way but just a first quick-and-dirty Python/Bash implementation. I have written a python script that extracts all window id's from the layout tree and prints the one after the currently focused window. The script's output is then used by a bash script to go to this window via i3-msg (could be done in the python script as well I think...) You can then configure your i3 such that you can walk over all windows (with exceptions, see "Drawbacks" below) using e.g. Alt+Tab.&lt;/p&gt;

&lt;p&gt;Here is the code for id_list.py:&lt;/p&gt;

&lt;pre&gt;import json
import subprocess


"""
Execute the given command and return the 
output as a list of lines
"""
def command_output(cmd):
    output = []
    if (cmd):
        p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, \
                                 stderr=subprocess.STDOUT)
        for line in p.stdout.readlines():
            output.append(line.rstrip())
    return output


def output_to_dict(output_list):
    output_string = ""
    for line in output_list:
        output_string += line
    return json.loads(output_string)


def find_windows(tree_dict, window_list):
    if (tree_dict.has_key("nodes") and len(tree_dict["nodes"]) &amp;gt; 0):
        for node in tree_dict["nodes"]:
            find_windows(node, window_list)
    else:
        if (tree_dict["layout"] != "dockarea" and not tree_dict["name"].startswith("i3bar for output") and not tree_dict["window"] == None):
            window_list.append(tree_dict)

    return window_list        


def main():
    output = command_output("i3-msg -t get_tree")
    tree = output_to_dict(output)
    window_list = find_windows(tree, [])

    next_index = -1
    for i in range(len(window_list)):
        if (window_list[i]["focused"] == True):
            next_index = i+1
            break

#    next_index = len(window_list)
#    for i in range(len(window_list)-1, -1, -1):
#        if (window_list[i]["focused"] == True):
#            next_index = i-1
#            break

    next_id = 0;
    if next_index == -1 or next_index == len(window_list):
        next_id = window_list[0]["window"]
    else:        
        next_id = window_list[next_index]["window"]

    print next_id

main()
&lt;/pre&gt;

&lt;p&gt;and the bash script tab_windows.sh:&lt;/p&gt;

&lt;pre&gt;#!/bin/bash

id=`python ~/.i3/id_list.py`
i3-msg [id="$id"] focus &amp;gt; /dev/null
&lt;/pre&gt;

&lt;p&gt;Suppose these scripts lay in ~/.i3/ insert the following line into your i3 config:
&lt;code&gt;bindsym Mod1+Tab exec ~/.i3/tab_windows.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Drawbacks:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the script uses the hard-coded string "i3bar on output" to get rid of the i3bars which do not seem to be focusable; didn't find another method to exclude them from the tree&lt;/li&gt;
&lt;li&gt;windows on a scratchpad cannot be reached with these scripts; I don't see these windows in the layout tree !?&lt;/li&gt;
&lt;li&gt;script traverses the entire layout tree on every call. Maybe a solution with an id buffer is possible !?&lt;/li&gt;
&lt;/ul&gt;
</title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=2901#comment-2901</link><description>Just exchange the second code block inside of "def main():" with the five lines beginning with "#" just below it. Should work. Edit: Yep, works.</description><pubDate>Wed, 13 Nov 2013 12:36:19 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=2901#comment-2901</guid></item><item><title>Comment by paramnesioid for &lt;p&gt;This is maybe not the most elegant way but just a first quick-and-dirty Python/Bash implementation. I have written a python script that extracts all window id's from the layout tree and prints the one after the currently focused window. The script's output is then used by a bash script to go to this window via i3-msg (could be done in the python script as well I think...) You can then configure your i3 such that you can walk over all windows (with exceptions, see "Drawbacks" below) using e.g. Alt+Tab.&lt;/p&gt;

&lt;p&gt;Here is the code for id_list.py:&lt;/p&gt;

&lt;pre&gt;import json
import subprocess


"""
Execute the given command and return the 
output as a list of lines
"""
def command_output(cmd):
    output = []
    if (cmd):
        p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, \
                                 stderr=subprocess.STDOUT)
        for line in p.stdout.readlines():
            output.append(line.rstrip())
    return output


def output_to_dict(output_list):
    output_string = ""
    for line in output_list:
        output_string += line
    return json.loads(output_string)


def find_windows(tree_dict, window_list):
    if (tree_dict.has_key("nodes") and len(tree_dict["nodes"]) &amp;gt; 0):
        for node in tree_dict["nodes"]:
            find_windows(node, window_list)
    else:
        if (tree_dict["layout"] != "dockarea" and not tree_dict["name"].startswith("i3bar for output") and not tree_dict["window"] == None):
            window_list.append(tree_dict)

    return window_list        


def main():
    output = command_output("i3-msg -t get_tree")
    tree = output_to_dict(output)
    window_list = find_windows(tree, [])

    next_index = -1
    for i in range(len(window_list)):
        if (window_list[i]["focused"] == True):
            next_index = i+1
            break

#    next_index = len(window_list)
#    for i in range(len(window_list)-1, -1, -1):
#        if (window_list[i]["focused"] == True):
#            next_index = i-1
#            break

    next_id = 0;
    if next_index == -1 or next_index == len(window_list):
        next_id = window_list[0]["window"]
    else:        
        next_id = window_list[next_index]["window"]

    print next_id

main()
&lt;/pre&gt;

&lt;p&gt;and the bash script tab_windows.sh:&lt;/p&gt;

&lt;pre&gt;#!/bin/bash

id=`python ~/.i3/id_list.py`
i3-msg [id="$id"] focus &amp;gt; /dev/null
&lt;/pre&gt;

&lt;p&gt;Suppose these scripts lay in ~/.i3/ insert the following line into your i3 config:
&lt;code&gt;bindsym Mod1+Tab exec ~/.i3/tab_windows.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Drawbacks:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the script uses the hard-coded string "i3bar on output" to get rid of the i3bars which do not seem to be focusable; didn't find another method to exclude them from the tree&lt;/li&gt;
&lt;li&gt;windows on a scratchpad cannot be reached with these scripts; I don't see these windows in the layout tree !?&lt;/li&gt;
&lt;li&gt;script traverses the entire layout tree on every call. Maybe a solution with an id buffer is possible !?&lt;/li&gt;
&lt;/ul&gt;
</title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=2883#comment-2883</link><description>Thanks a lot! Which bits do I change to make it go backwards?</description><pubDate>Tue, 12 Nov 2013 05:19:51 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=2883#comment-2883</guid></item><item><title>Comment by paramnesioid for &lt;p&gt;This is maybe not the most elegant way but just a first quick-and-dirty Python/Bash implementation. I have written a python script that extracts all window id's from the layout tree and prints the one after the currently focused window. The script's output is then used by a bash script to go to this window via i3-msg (could be done in the python script as well I think...) You can then configure your i3 such that you can walk over all windows (with exceptions, see "Drawbacks" below) using e.g. Alt+Tab.&lt;/p&gt;

&lt;p&gt;Here is the code for id_list.py:&lt;/p&gt;

&lt;pre&gt;import json
import subprocess


"""
Execute the given command and return the 
output as a list of lines
"""
def command_output(cmd):
    output = []
    if (cmd):
        p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, \
                                 stderr=subprocess.STDOUT)
        for line in p.stdout.readlines():
            output.append(line.rstrip())
    return output


def output_to_dict(output_list):
    output_string = ""
    for line in output_list:
        output_string += line
    return json.loads(output_string)


def find_windows(tree_dict, window_list):
    if (tree_dict.has_key("nodes") and len(tree_dict["nodes"]) &amp;gt; 0):
        for node in tree_dict["nodes"]:
            find_windows(node, window_list)
    else:
        if (tree_dict["layout"] != "dockarea" and not tree_dict["name"].startswith("i3bar for output") and not tree_dict["window"] == None):
            window_list.append(tree_dict)

    return window_list        


def main():
    output = command_output("i3-msg -t get_tree")
    tree = output_to_dict(output)
    window_list = find_windows(tree, [])

    next_index = -1
    for i in range(len(window_list)):
        if (window_list[i]["focused"] == True):
            next_index = i+1
            break

#    next_index = len(window_list)
#    for i in range(len(window_list)-1, -1, -1):
#        if (window_list[i]["focused"] == True):
#            next_index = i-1
#            break

    next_id = 0;
    if next_index == -1 or next_index == len(window_list):
        next_id = window_list[0]["window"]
    else:        
        next_id = window_list[next_index]["window"]

    print next_id

main()
&lt;/pre&gt;

&lt;p&gt;and the bash script tab_windows.sh:&lt;/p&gt;

&lt;pre&gt;#!/bin/bash

id=`python ~/.i3/id_list.py`
i3-msg [id="$id"] focus &amp;gt; /dev/null
&lt;/pre&gt;

&lt;p&gt;Suppose these scripts lay in ~/.i3/ insert the following line into your i3 config:
&lt;code&gt;bindsym Mod1+Tab exec ~/.i3/tab_windows.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Drawbacks:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the script uses the hard-coded string "i3bar on output" to get rid of the i3bars which do not seem to be focusable; didn't find another method to exclude them from the tree&lt;/li&gt;
&lt;li&gt;windows on a scratchpad cannot be reached with these scripts; I don't see these windows in the layout tree !?&lt;/li&gt;
&lt;li&gt;script traverses the entire layout tree on every call. Maybe a solution with an id buffer is possible !?&lt;/li&gt;
&lt;/ul&gt;
</title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=2907#comment-2907</link><description>Haha nice work.</description><pubDate>Thu, 14 Nov 2013 00:48:57 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=2907#comment-2907</guid></item><item><title>Comment by mschaefer for &lt;p&gt;This is maybe not the most elegant way but just a first quick-and-dirty Python/Bash implementation. I have written a python script that extracts all window id's from the layout tree and prints the one after the currently focused window. The script's output is then used by a bash script to go to this window via i3-msg (could be done in the python script as well I think...) You can then configure your i3 such that you can walk over all windows (with exceptions, see "Drawbacks" below) using e.g. Alt+Tab.&lt;/p&gt;

&lt;p&gt;Here is the code for id_list.py:&lt;/p&gt;

&lt;pre&gt;import json
import subprocess


"""
Execute the given command and return the 
output as a list of lines
"""
def command_output(cmd):
    output = []
    if (cmd):
        p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, \
                                 stderr=subprocess.STDOUT)
        for line in p.stdout.readlines():
            output.append(line.rstrip())
    return output


def output_to_dict(output_list):
    output_string = ""
    for line in output_list:
        output_string += line
    return json.loads(output_string)


def find_windows(tree_dict, window_list):
    if (tree_dict.has_key("nodes") and len(tree_dict["nodes"]) &amp;gt; 0):
        for node in tree_dict["nodes"]:
            find_windows(node, window_list)
    else:
        if (tree_dict["layout"] != "dockarea" and not tree_dict["name"].startswith("i3bar for output") and not tree_dict["window"] == None):
            window_list.append(tree_dict)

    return window_list        


def main():
    output = command_output("i3-msg -t get_tree")
    tree = output_to_dict(output)
    window_list = find_windows(tree, [])

    next_index = -1
    for i in range(len(window_list)):
        if (window_list[i]["focused"] == True):
            next_index = i+1
            break

#    next_index = len(window_list)
#    for i in range(len(window_list)-1, -1, -1):
#        if (window_list[i]["focused"] == True):
#            next_index = i-1
#            break

    next_id = 0;
    if next_index == -1 or next_index == len(window_list):
        next_id = window_list[0]["window"]
    else:        
        next_id = window_list[next_index]["window"]

    print next_id

main()
&lt;/pre&gt;

&lt;p&gt;and the bash script tab_windows.sh:&lt;/p&gt;

&lt;pre&gt;#!/bin/bash

id=`python ~/.i3/id_list.py`
i3-msg [id="$id"] focus &amp;gt; /dev/null
&lt;/pre&gt;

&lt;p&gt;Suppose these scripts lay in ~/.i3/ insert the following line into your i3 config:
&lt;code&gt;bindsym Mod1+Tab exec ~/.i3/tab_windows.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Drawbacks:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the script uses the hard-coded string "i3bar on output" to get rid of the i3bars which do not seem to be focusable; didn't find another method to exclude them from the tree&lt;/li&gt;
&lt;li&gt;windows on a scratchpad cannot be reached with these scripts; I don't see these windows in the layout tree !?&lt;/li&gt;
&lt;li&gt;script traverses the entire layout tree on every call. Maybe a solution with an id buffer is possible !?&lt;/li&gt;
&lt;/ul&gt;
</title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=2905#comment-2905</link><description>You didn't miss anything, I just added these lines ;-)</description><pubDate>Wed, 13 Nov 2013 18:27:39 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=2905#comment-2905</guid></item><item><title>Comment by paramnesioid for &lt;p&gt;This is maybe not the most elegant way but just a first quick-and-dirty Python/Bash implementation. I have written a python script that extracts all window id's from the layout tree and prints the one after the currently focused window. The script's output is then used by a bash script to go to this window via i3-msg (could be done in the python script as well I think...) You can then configure your i3 such that you can walk over all windows (with exceptions, see "Drawbacks" below) using e.g. Alt+Tab.&lt;/p&gt;

&lt;p&gt;Here is the code for id_list.py:&lt;/p&gt;

&lt;pre&gt;import json
import subprocess


"""
Execute the given command and return the 
output as a list of lines
"""
def command_output(cmd):
    output = []
    if (cmd):
        p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, \
                                 stderr=subprocess.STDOUT)
        for line in p.stdout.readlines():
            output.append(line.rstrip())
    return output


def output_to_dict(output_list):
    output_string = ""
    for line in output_list:
        output_string += line
    return json.loads(output_string)


def find_windows(tree_dict, window_list):
    if (tree_dict.has_key("nodes") and len(tree_dict["nodes"]) &amp;gt; 0):
        for node in tree_dict["nodes"]:
            find_windows(node, window_list)
    else:
        if (tree_dict["layout"] != "dockarea" and not tree_dict["name"].startswith("i3bar for output") and not tree_dict["window"] == None):
            window_list.append(tree_dict)

    return window_list        


def main():
    output = command_output("i3-msg -t get_tree")
    tree = output_to_dict(output)
    window_list = find_windows(tree, [])

    next_index = -1
    for i in range(len(window_list)):
        if (window_list[i]["focused"] == True):
            next_index = i+1
            break

#    next_index = len(window_list)
#    for i in range(len(window_list)-1, -1, -1):
#        if (window_list[i]["focused"] == True):
#            next_index = i-1
#            break

    next_id = 0;
    if next_index == -1 or next_index == len(window_list):
        next_id = window_list[0]["window"]
    else:        
        next_id = window_list[next_index]["window"]

    print next_id

main()
&lt;/pre&gt;

&lt;p&gt;and the bash script tab_windows.sh:&lt;/p&gt;

&lt;pre&gt;#!/bin/bash

id=`python ~/.i3/id_list.py`
i3-msg [id="$id"] focus &amp;gt; /dev/null
&lt;/pre&gt;

&lt;p&gt;Suppose these scripts lay in ~/.i3/ insert the following line into your i3 config:
&lt;code&gt;bindsym Mod1+Tab exec ~/.i3/tab_windows.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Drawbacks:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the script uses the hard-coded string "i3bar on output" to get rid of the i3bars which do not seem to be focusable; didn't find another method to exclude them from the tree&lt;/li&gt;
&lt;li&gt;windows on a scratchpad cannot be reached with these scripts; I don't see these windows in the layout tree !?&lt;/li&gt;
&lt;li&gt;script traverses the entire layout tree on every call. Maybe a solution with an id buffer is possible !?&lt;/li&gt;
&lt;/ul&gt;
</title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=2904#comment-2904</link><description>Oh sorry, I didn't notice that. Thanks.</description><pubDate>Wed, 13 Nov 2013 15:57:49 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=2904#comment-2904</guid></item><item><title>Answer by matma6 for &lt;p&gt;sometiems it would be convinent to enable that function. but how? &lt;/p&gt;

&lt;p&gt;thanks&lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?answer=1775#post-id-1775</link><description>You can use mod+arrows to change focus. What do you mean "alt+tab"? Switching focus inside virtual desktop? Switching focus between all of windows on all of desktops? Changing position?</description><pubDate>Thu, 09 May 2013 13:58:36 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?answer=1775#post-id-1775</guid></item><item><title>Answer by dosimple for &lt;p&gt;sometiems it would be convinent to enable that function. but how? &lt;/p&gt;

&lt;p&gt;thanks&lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?answer=1800#post-id-1800</link><description>Closest you can relatively easily get is to use **VIM-like marks** feature. One may recommend to configure keyboard bindings to mark windows with single letters (see the userguide and `man i3-input`). With those markings, many things are possible, but I think "Alt+Tab" is not one of them.</description><pubDate>Sun, 12 May 2013 22:25:48 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?answer=1800#post-id-1800</guid></item><item><title>Comment by dosimple for &lt;p&gt;Closest you can relatively easily get is to use &lt;strong&gt;VIM-like marks&lt;/strong&gt; feature. One may recommend to configure keyboard bindings to mark windows with single letters (see the userguide and &lt;code&gt;man i3-input&lt;/code&gt;). With those markings, many things are possible, but I think "Alt+Tab" is not one of them.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=1820#comment-1820</link><description>i was shooting for kind of back and forth between only two windows, last and current. it would be much easier to hack something like this, if i3 would allow multiple marks on the same window.</description><pubDate>Wed, 15 May 2013 23:08:31 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?comment=1820#comment-1820</guid></item><item><title>Answer by bakeren for &lt;p&gt;sometiems it would be convinent to enable that function. but how? &lt;/p&gt;

&lt;p&gt;thanks&lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?answer=1791#post-id-1791</link><description>I assume you want to cycle between windows in the order they last had focus, instead of their orientation on the screen. As far as I know there is no such functionality out of the box in i3wm. At least I didn't find any way to do it when I switched to i3wm. You get used to switching using orientation after a while though.
</description><pubDate>Sat, 11 May 2013 23:34:01 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?answer=1791#post-id-1791</guid></item><item><title>Answer by bruno.braga for &lt;p&gt;sometiems it would be convinent to enable that function. but how? &lt;/p&gt;

&lt;p&gt;thanks&lt;/p&gt;
 </title><link>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?answer=1808#post-id-1808</link><description>See here: 

https://faq.i3wm.org/question/1281/application-switcher/</description><pubDate>Tue, 14 May 2013 10:54:03 +0000</pubDate><guid>https://faq.i3wm.org/question/1773/how-can-i-configure-i3wm-to-make-alttab-action-just-like-in-windows/?answer=1808#post-id-1808</guid></item></channel></rss>