Sway floating window management

Moving windows off the grid
Author

Sjoerd de Haan

Published

Invalid Date

Introduction

Sway is the window manager on my development systems. Sway makes it easy to split windows into left and right, or top and bottom, and nested containers such as grids.

With nested windows + rectangular grids, there is little need for meticulously dragging windows on top of each other. That works great until I want a window to leave the rectangular grid. For example, when I open a picture in picture movie.

In that case, floating windows come in handy.

Floating window short keys

Here are the default short keys for floating windows in Sway:

Sway Floating Window Workflows

Action Default Keybinding Description
Toggle Floating $mod+Shift+Space Toggle current window between floating and tiled
Move Left $mod+Shift+Left Move floating window left
Move Right $mod+Shift+Right Move floating window right
Move Up $mod+Shift+Up Move floating window up
Move Down $mod+Shift+Down Move floating window down
Resize Mode $mod+r Enter resize mode
Focus Floating $mod+Space Change focus between tiling and floating windows
Move with Mouse $mod+Left Click Drag floating window with mouse
Resize with Mouse $mod+Right Click Resize floating window with mouse
Center Window $mod+Shift+c Center floating window (if configured)
Sticky Toggle $mod+Shift+s Make window stick to all workspaces (if configured)

Resize Mode Commands

After pressing $mod+r to enter resize mode:

Key Action
Left or h Shrink width
Down or j Grow height
Up or k Shrink height
Right or l Grow width
Shift+Left Shrink width (larger steps)
Shift+Right Grow width (larger steps)
Shift+Up Shrink height (larger steps)
Shift+Down Grow height (larger steps)
Enter or Escape Exit resize mode

Mouse Actions

Action Command
Drag to Move Hold $mod + Left Click + Drag
Resize Hold $mod + Right Click + Drag

Note: $mod is typically the Super (Windows) key by default in Sway.