<?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/2921/" rel="self"></atom:link><language>en</language><copyright>Copyright i3, 2012</copyright><lastBuildDate>Mon, 18 Nov 2013 01:55:44 +0000</lastBuildDate><item><title>How do I get i3 to switch to a workspace properly when loading Firefox from a script from i3 config?</title><link>https://faq.i3wm.org/question/2921/how-do-i-get-i3-to-switch-to-a-workspace-properly-when-loading-firefox-from-a-script-from-i3-config/</link><description>i3config:&lt;br/&gt;
bindsym Control+Mod4+s exec ~/script.sh&lt;br/&gt;

~/script.sh&lt;br/&gt;
i3-msg workspace windowname&lt;br/&gt;
exec firefox       # (or midori)

When I press the shortcut keys, it'll create a new workspace, but then it'll execute the program in the workspace where I pressed the keys instead of in the new workspace (it does the same thing if I run the script directly from dmenu).

I can get the script to work fine by running the script directly from the cli or from xbindkeys.</description><pubDate>Sun, 17 Nov 2013 04:57:40 +0000</pubDate><guid>https://faq.i3wm.org/question/2921/how-do-i-get-i3-to-switch-to-a-workspace-properly-when-loading-firefox-from-a-script-from-i3-config/</guid></item><item><title>Comment by paramnesioid for &lt;p&gt;i3config:&lt;br/&gt;
bindsym Control+Mod4+s exec ~/script.sh&lt;br/&gt;&lt;/p&gt;

&lt;p&gt;~/script.sh&lt;br/&gt;
i3-msg workspace windowname&lt;br/&gt;
exec firefox       # (or midori)&lt;/p&gt;

&lt;p&gt;When I press the shortcut keys, it'll create a new workspace, but then it'll execute the program in the workspace where I pressed the keys instead of in the new workspace (it does the same thing if I run the script directly from dmenu).&lt;/p&gt;

&lt;p&gt;I can get the script to work fine by running the script directly from the cli or from xbindkeys.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/2921/how-do-i-get-i3-to-switch-to-a-workspace-properly-when-loading-firefox-from-a-script-from-i3-config/?comment=2933#comment-2933</link><description>I copied the line directly from i3config to .xbindkeysrc, and it functions perfectly under xbindkeys. The script will work properly in i3 if I make it so a terminal runs the script, but I'd rather not run a terminal.

I am using a script because I want to check whether a process is already open.</description><pubDate>Mon, 18 Nov 2013 01:55:44 +0000</pubDate><guid>https://faq.i3wm.org/question/2921/how-do-i-get-i3-to-switch-to-a-workspace-properly-when-loading-firefox-from-a-script-from-i3-config/?comment=2933#comment-2933</guid></item><item><title>Comment by Adaephon for &lt;p&gt;i3config:&lt;br/&gt;
bindsym Control+Mod4+s exec ~/script.sh&lt;br/&gt;&lt;/p&gt;

&lt;p&gt;~/script.sh&lt;br/&gt;
i3-msg workspace windowname&lt;br/&gt;
exec firefox       # (or midori)&lt;/p&gt;

&lt;p&gt;When I press the shortcut keys, it'll create a new workspace, but then it'll execute the program in the workspace where I pressed the keys instead of in the new workspace (it does the same thing if I run the script directly from dmenu).&lt;/p&gt;

&lt;p&gt;I can get the script to work fine by running the script directly from the cli or from xbindkeys.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/2921/how-do-i-get-i3-to-switch-to-a-workspace-properly-when-loading-firefox-from-a-script-from-i3-config/?comment=2925#comment-2925</link><description>I agree with this being a duplicate. I also just added a scriptless answer to the other question, that should work for you.</description><pubDate>Sun, 17 Nov 2013 15:26:01 +0000</pubDate><guid>https://faq.i3wm.org/question/2921/how-do-i-get-i3-to-switch-to-a-workspace-properly-when-loading-firefox-from-a-script-from-i3-config/?comment=2925#comment-2925</guid></item><item><title>Comment by mschaefer for &lt;p&gt;i3config:&lt;br/&gt;
bindsym Control+Mod4+s exec ~/script.sh&lt;br/&gt;&lt;/p&gt;

&lt;p&gt;~/script.sh&lt;br/&gt;
i3-msg workspace windowname&lt;br/&gt;
exec firefox       # (or midori)&lt;/p&gt;

&lt;p&gt;When I press the shortcut keys, it'll create a new workspace, but then it'll execute the program in the workspace where I pressed the keys instead of in the new workspace (it does the same thing if I run the script directly from dmenu).&lt;/p&gt;

&lt;p&gt;I can get the script to work fine by running the script directly from the cli or from xbindkeys.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/2921/how-do-i-get-i3-to-switch-to-a-workspace-properly-when-loading-firefox-from-a-script-from-i3-config/?comment=2922#comment-2922</link><description>Possible dublicate of: https://faq.i3wm.org/question/2135/open-new-window-in-specific-workspace-and-focus/</description><pubDate>Sun, 17 Nov 2013 11:10:42 +0000</pubDate><guid>https://faq.i3wm.org/question/2921/how-do-i-get-i3-to-switch-to-a-workspace-properly-when-loading-firefox-from-a-script-from-i3-config/?comment=2922#comment-2922</guid></item><item><title>Comment by paramnesioid for &lt;p&gt;i3config:&lt;br/&gt;
bindsym Control+Mod4+s exec ~/script.sh&lt;br/&gt;&lt;/p&gt;

&lt;p&gt;~/script.sh&lt;br/&gt;
i3-msg workspace windowname&lt;br/&gt;
exec firefox       # (or midori)&lt;/p&gt;

&lt;p&gt;When I press the shortcut keys, it'll create a new workspace, but then it'll execute the program in the workspace where I pressed the keys instead of in the new workspace (it does the same thing if I run the script directly from dmenu).&lt;/p&gt;

&lt;p&gt;I can get the script to work fine by running the script directly from the cli or from xbindkeys.&lt;/p&gt;
</title><link>https://faq.i3wm.org/question/2921/how-do-i-get-i3-to-switch-to-a-workspace-properly-when-loading-firefox-from-a-script-from-i3-config/?comment=2932#comment-2932</link><description>Well I'm also interested to know why exec in i3config doesn't function like a normal exec in this case.</description><pubDate>Mon, 18 Nov 2013 01:37:07 +0000</pubDate><guid>https://faq.i3wm.org/question/2921/how-do-i-get-i3-to-switch-to-a-workspace-properly-when-loading-firefox-from-a-script-from-i3-config/?comment=2932#comment-2932</guid></item></channel></rss>