2

I tried focus_on_window_activation with focus, but it doesn't do anything. I guess it only works on same workspace. Or maybe I am using it wrong?

for_window [class="Chromium"] focus_on_window_activation focus

For example in a Thunderbird when I click on a link, I want Chromium to get focus and switch to its workspace (only Chromium, not all applications). Currently it only gets the urgency flag (I believe its usually visualized by a red background of a workspace "button" in a bar).

3 Answers 3

0

If you add

for_window [urgent="latest"] focus

to your ~/.i3/config, then i3 will automatically focus a window once it becomes urgent.

In your case you could combine criteria if you only want to focus certain applications:

for_window [urgent="latest" class="Chromium"] focus
2
  • After adding switching to Chromium's default workspace, it works fairly well: for_window [urgent="latest" class="Chromium" workspace=$ws1] focus ; workspace number $ws1. Thank you.
    – menfon
    Aug 25, 2022 at 12:34
  • 1
    Unfortunately I spoke too soon. The solution above is unreliable, a lot of times it simply does nothing. :(
    – menfon
    Aug 26, 2022 at 6:25
0

If you don't care about urgent windows at all, you can simply do

focus_on_window_activation focus

From the docs:

focus

The window will always be focused and not be marked urgent.

0

I was able to get it working consistently by modifying both the focus_on_window_activation and for_window settings.

focus_on_window_activation focus
for_window [class="^Firefox$"] focus

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .