How do I get i3 to switch to a workspace properly when loading Firefox from a script from i3 config? [closed]

asked 2013-11-17 04:57:40 +0000

paramnesioid gravatar image

updated 2013-11-17 05:07:50 +0000

i3config:
bindsym Control+Mod4+s exec ~/script.sh

~/script.sh
i3-msg workspace windowname
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.

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by joepd
close date 2013-11-17 20:16:54.392956

Comments

I agree with this being a duplicate. I also just added a scriptless answer to the other question, that should work for you.

Adaephon gravatar imageAdaephon ( 2013-11-17 15:26:01 +0000 )edit

Well I'm also interested to know why exec in i3config doesn't function like a normal exec in this case.

paramnesioid gravatar imageparamnesioid ( 2013-11-18 01:37:07 +0000 )edit

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.

paramnesioid gravatar imageparamnesioid ( 2013-11-18 01:55:44 +0000 )edit