<?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/5528/" rel="self"></atom:link><language>en</language><copyright>Copyright i3, 2012</copyright><lastBuildDate>Wed, 04 Mar 2015 11:16:21 +0000</lastBuildDate><item><title>Exec unfocuses current window</title><link>https://faq.i3wm.org/question/5528/exec-unfocuses-current-window/</link><description>I've set up a basic "vim" mode that allows me to use hjkl as arrow keys in any application (by using xdotool). This is my config so far:

    mode "vim" {
        bindsym h exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Left
        bindsym j exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Down 
        bindsym k exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Up 
        bindsym l exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Right
    
        #back to normal: Enter or Escape or q or ^[
        bindsym Return mode "default"
        bindsym q mode "default"
        bindsym Escape mode "default"
        bindcode Control+34 mode "default"
        bindsym $mod+Shift+v mode "default"
    }
    bindsym $mod+Shift+v mode "vim"

Unfortunately, it seems that when using exec, i3 unfocuses (not quite, the window bar is still highlighted for example. But surely the window doesn't catch the key events) the current window for a moment, that's why I have to get the window ID, otherwise it's not seeing the command. I should say this works, but many windows like my terminal do some animation on this kind of "loose focus" and it gets weird looking at. 

Is there a way I can tell i3 to keep the window focused and execute the command in the background? </description><pubDate>Tue, 24 Feb 2015 10:04:36 +0000</pubDate><guid>https://faq.i3wm.org/question/5528/exec-unfocuses-current-window/</guid></item><item><title>Comment by Adaephon for &lt;p&gt;I've set up a basic "vim" mode that allows me to use hjkl as arrow keys in any application (by using xdotool). This is my config so far:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;mode "vim" {
    bindsym h exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Left
    bindsym j exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Down 
    bindsym k exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Up 
    bindsym l exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Right

    #back to normal: Enter or Escape or q or ^[
    bindsym Return mode "default"
    bindsym q mode "default"
    bindsym Escape mode "default"
    bindcode Control+34 mode "default"
    bindsym $mod+Shift+v mode "default"
}
bindsym $mod+Shift+v mode "vim"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Unfortunately, it seems that when using exec, i3 unfocuses (not quite, the window bar is still highlighted for example. But surely the window doesn't catch the key events) the current window for a moment, that's why I have to get the window ID, otherwise it's not seeing the command. I should say this works, but many windows like my terminal do some animation on this kind of "loose focus" and it gets weird looking at. &lt;/p&gt;

&lt;p&gt;Is there a way I can tell i3 to keep the window focused and execute the command in the background? &lt;/p&gt;
</title><link>https://faq.i3wm.org/question/5528/exec-unfocuses-current-window/?comment=5534#comment-5534</link><description>This has to do with the key bindings and is not specific to the `exec` command. In order to grab the binding *i3* takes the input focus. **If** that can be changed, it needs to be done in *i3's* code. [You may want to open a bug report / feature request for that](https://github.com/i3/i3/issues).</description><pubDate>Wed, 25 Feb 2015 09:35:57 +0000</pubDate><guid>https://faq.i3wm.org/question/5528/exec-unfocuses-current-window/?comment=5534#comment-5534</guid></item><item><title>Comment by Adaephon for &lt;p&gt;I've set up a basic "vim" mode that allows me to use hjkl as arrow keys in any application (by using xdotool). This is my config so far:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;mode "vim" {
    bindsym h exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Left
    bindsym j exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Down 
    bindsym k exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Up 
    bindsym l exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Right

    #back to normal: Enter or Escape or q or ^[
    bindsym Return mode "default"
    bindsym q mode "default"
    bindsym Escape mode "default"
    bindcode Control+34 mode "default"
    bindsym $mod+Shift+v mode "default"
}
bindsym $mod+Shift+v mode "vim"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Unfortunately, it seems that when using exec, i3 unfocuses (not quite, the window bar is still highlighted for example. But surely the window doesn't catch the key events) the current window for a moment, that's why I have to get the window ID, otherwise it's not seeing the command. I should say this works, but many windows like my terminal do some animation on this kind of "loose focus" and it gets weird looking at. &lt;/p&gt;

&lt;p&gt;Is there a way I can tell i3 to keep the window focused and execute the command in the background? &lt;/p&gt;
</title><link>https://faq.i3wm.org/question/5528/exec-unfocuses-current-window/?comment=5570#comment-5570</link><description>It is [issue #1490 on i3's issue tracker on github](https://github.com/i3/i3/issues/1490).</description><pubDate>Wed, 04 Mar 2015 11:16:21 +0000</pubDate><guid>https://faq.i3wm.org/question/5528/exec-unfocuses-current-window/?comment=5570#comment-5570</guid></item><item><title>Comment by setzer22 for &lt;p&gt;I've set up a basic "vim" mode that allows me to use hjkl as arrow keys in any application (by using xdotool). This is my config so far:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;mode "vim" {
    bindsym h exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Left
    bindsym j exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Down 
    bindsym k exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Up 
    bindsym l exec --no-startup-id xdotool key --window $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') Right

    #back to normal: Enter or Escape or q or ^[
    bindsym Return mode "default"
    bindsym q mode "default"
    bindsym Escape mode "default"
    bindcode Control+34 mode "default"
    bindsym $mod+Shift+v mode "default"
}
bindsym $mod+Shift+v mode "vim"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Unfortunately, it seems that when using exec, i3 unfocuses (not quite, the window bar is still highlighted for example. But surely the window doesn't catch the key events) the current window for a moment, that's why I have to get the window ID, otherwise it's not seeing the command. I should say this works, but many windows like my terminal do some animation on this kind of "loose focus" and it gets weird looking at. &lt;/p&gt;

&lt;p&gt;Is there a way I can tell i3 to keep the window focused and execute the command in the background? &lt;/p&gt;
</title><link>https://faq.i3wm.org/question/5528/exec-unfocuses-current-window/?comment=5538#comment-5538</link><description>Thanks! I opened an issue just as you suggested. I think that's a feature worth having, as I also had encountered it in many of my hotkeys, like volume Up/Down, which is a lot less hacker-ish than that "vim-like" mode and also causes the unfocus animations to happen.</description><pubDate>Wed, 25 Feb 2015 22:09:20 +0000</pubDate><guid>https://faq.i3wm.org/question/5528/exec-unfocuses-current-window/?comment=5538#comment-5538</guid></item></channel></rss>