From b103a0d6286c229c025d473d8b3a0fb3aa291349 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 9 Jun 2025 16:13:42 +0200 Subject: [PATCH] i3: when switching workspace, focus tiling instead of last one Otherwise, new floating widgets may get focus. See previous commit. --- bin/i3-companion | 1 + config | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/bin/i3-companion b/bin/i3-companion index 2f64530..7c44117 100755 --- a/bin/i3-companion +++ b/bin/i3-companion @@ -427,6 +427,7 @@ async def previous_workspace(i3, event): return logger.debug("switching to workspace %d on %s", previous, output) await i3.command(f"workspace number {previous}") + await i3.command("focus tiling") @on(CommandEvent("new-workspace"), CommandEvent("move-to-new-workspace")) diff --git a/config b/config index 8ea7765..fec12a6 100644 --- a/config +++ b/config @@ -105,18 +105,18 @@ bindsym $mod+a focus parent workspace_layout tabbed # switch to workspace -bindsym $mod+1 workspace number 1 -bindsym $mod+2 workspace number 2 -bindsym $mod+3 workspace number 3 -bindsym $mod+4 workspace number 4 -bindsym $mod+5 workspace number 5 -bindsym $mod+6 workspace number 6 -bindsym $mod+7 workspace number 7 -bindsym $mod+8 workspace number 8 -bindsym $mod+9 workspace number 9 -bindsym $mod+0 workspace number 10 +bindsym $mod+1 workspace number 1 ; focus tiling +bindsym $mod+2 workspace number 2 ; focus tiling +bindsym $mod+3 workspace number 3 ; focus tiling +bindsym $mod+4 workspace number 4 ; focus tiling +bindsym $mod+5 workspace number 5 ; focus tiling +bindsym $mod+6 workspace number 6 ; focus tiling +bindsym $mod+7 workspace number 7 ; focus tiling +bindsym $mod+8 workspace number 8 ; focus tiling +bindsym $mod+9 workspace number 9 ; focus tiling +bindsym $mod+0 workspace number 10 ; focus tiling bindsym $mod+Tab nop "previous-workspace" -bindsym $mod+Ctrl+o focus output next +bindsym $mod+Ctrl+o focus output next ; focus tiling bindsym $mod+n nop "new-workspace" focus_wrapping no