ignore for_window
asked 2014-05-15 14:33:25 +0000
Anonymous
I have for_window to put certain apps in some certain workspace, but sometime I need to ignore this rule and open the app in the current workspace. How do I do this? Thanks.
asked 2014-05-15 14:33:25 +0000
Anonymous
I have for_window to put certain apps in some certain workspace, but sometime I need to ignore this rule and open the app in the current workspace. How do I do this? Thanks.
There are two ways to do that - that I can think of:
Depending on the application and criteria you are using, it may be possible to start the application in a way that does not trigger the rule. GTK applications for example have the --class=CLASS
option, which allows changing the WM_CLASS
. Titles can be changed, too, in many applications.
You could keep a set of two configuration files, one with for_window
statements and a copy without them, with ~/.i3/config
being a link to the one currently used. For starting you then could use the following wrapper script (then use wrapper application --options
instead of application --options
)
#!/bin/sh
CFG="${HOME}/.i3/config"
CFGFOR="${CFG}-withfor"
CFGNOFOR="${CFG}-nofor"
# switch to configuration without for_window
ln -sf "$CFGNOFOR" "$CFG"
i3-msg reload
# start anything passed as arguments to this script
"$@" &
# wait one second for the window to be initialized
# this may need to be longer for some applications
sleep 1
# switch back configuration
ln -sf "$CFGFOR" "$CFG"
i3-msg reload
Both ways have their pros and cons. The first one does not work for every application, but if it works it does so with minimal hassle. The second method works with any application, but it disables all for_window
configurations for a certain time which may not be desirable.
Asked: 2014-05-15 14:33:25 +0000
Seen: 118 times
Last updated: May 19 '14
Maybe duplicate https://faq.i3wm.org/question/243/how-do-i-use-an-exclude-regex-in-i3-config/
@Ikraav: I think my question is different. For e.g.: currently I let chromium at 2: browser by default, but sometime I am in 3: text editor and would like to open a browser in the same workspace, I want to ignore that for_window just for once, any command to do that?