Skip to content

Instantly share code, notes, and snippets.

@wwalker
Created January 3, 2020 20:44
Show Gist options
  • Save wwalker/7fa620bfe3e24594ed4a615d0189cea2 to your computer and use it in GitHub Desktop.
Save wwalker/7fa620bfe3e24594ed4a615d0189cea2 to your computer and use it in GitHub Desktop.
i3 swap done right
https://www.reddit.com/r/i3wm/comments/ejjd7w/swap_two_containers/
u/vikarjramun
mode "swap" {
# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
# change focus
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# change focus (without mod)
bindsym Left focus left
bindsym Down focus down
bindsym Up focus up
bindsym Right focus right
bindsym Return swap container with mark "swapee"; unmark "swapee"; mode "default";
bindsym Escape unmark "swapee"; mode "default";
}
bindsym $mod+Shift+i mark --add "swapee"; mode "swap"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment