# Scratchpad (https://mangowm.github.io/docs/v0.19.4/window-management/scratchpad)

mangowm supports two types of scratchpads: the standard pool (Sway-like) and named scratchpads.

## Standard Scratchpad [#standard-scratchpad]

Any window can be sent to the "scratchpad" pile, which hides it. You can then cycle through them.

**Keybindings:**

```ini
# Send current window to scratchpad
bind=SUPER,i,minimized

# Toggle (show/hide) the scratchpad
bind=ALT,z,toggle_scratchpad

# Retrieve window from scratchpad (restore)
bind=SUPER+SHIFT,i,restore_minimized
```

---

## Named Scratchpad [#named-scratchpad]

Named scratchpads are bound to specific keys and applications. When triggered, mangowm will either launch the app (if not running) or toggle its visibility.

**1. Define the Window Rule**

You must identify the app using a unique `app_id` or `title` and mark it as a named scratchpad. The application must support setting a custom app_id or title at launch. Common examples:

- `st -c my-appid` — sets the app_id
- `kitty -T my-title` — sets the window title
- `foot --app-id my-appid` — sets the app_id

Use `none` as a placeholder when you only want to match by one field.

```ini
# Match by app_id
window_rule=is_named_scratchpad:1,width:1280,height:800,app_id:st-yazi

# Match by title
window_rule=is_named_scratchpad:1,width:1000,height:700,title:kitty-scratch
```

**2. Bind the Toggle Key**

Format: `bind=MOD,KEY,toggle_named_scratchpad,app_id,title,command`

Use `none` for whichever field you are not matching on.

```ini
# Match by app_id: launch 'st' with class 'st-yazi' running 'yazi'
bind=alt,h,toggle_named_scratchpad,st-yazi,none,st -c st-yazi -e yazi

# Match by title: launch 'kitty' with window title 'kitty-scratch'
bind=alt,k,toggle_named_scratchpad,none,kitty-scratch,kitty -T kitty-scratch
```

---

## Appearance [#appearance]

You can customize the size of scratchpad windows relative to the screen.
When a named scratchpad rule does not specify `width` or `height`, its floating
window uses these ratios. An explicit `width` or `height` in the rule takes
precedence.

Setting either ratio to `0` disables forcing that dimension: the window keeps
whatever width or height the application requested (or the size it had before
being sent to the scratchpad). Setting both to `0` leaves the scratchpad size
entirely untouched.

```ini
scratchpad_width_ratio=0.8
scratchpad_height_ratio=0.9
scratchpad_color=0x516c93ff

# Uses the ratios above because no width or height is set
window_rule=is_named_scratchpad:1,app_id:st-yazi
```

---

## Special Workspace (Tag 0) [#special-workspace-tag-0]

The special workspace (Tag 0) provides an overlay workspace of windows that can be summoned anywhere with full layout support (Scroller, Master/Stack, Dwindle, etc.). When Tag 0 is active, windows from the underlying workspace remain visible in the background, and all windows on the special workspace are displayed above them.

### Keybindings [#keybindings]

```ini
# Toggle the special workspace overlay (Tag 0)
bind=SUPER,s,toggle_special_tag

# Move focused window to/from the special workspace
bind=SUPER+SHIFT,s,tag_special_tag

# Silently send active window to the special workspace without switching
bind=SUPER+CTRL,s,tag_special_silent
```

### Window Rules for Special Workspace [#window-rules-for-special-workspace]

You can automatically assign applications to launch directly on the special workspace using `tags:0`:

```ini
# Automatically open Spotify and Discord in the special workspace
window_rule=tags:0,app_id:spotify
window_rule=tags:0,app_id:discord
```

### Configuration Options [#configuration-options]

You can configure background dimming and custom layout gaps for the special workspace:

```ini
# Background dim level when special workspace is active (0.0 to 1.0, default 0.5)
special_dim=0.5

# Inner and outer gaps for windows on the special workspace
special_gap_inner_horizontal=10
special_gap_inner_vertical=10
special_gap_outer_horizontal=20
special_gap_outer_vertical=20

# Gather special tag windows from all monitors on the active monitor
special_tag_cross_monitor=0
```

With `special_tag_cross_monitor=1`, opening the special workspace or moving a
window into it also migrates special-tag windows from other monitors and copies
their special-tag layout. Floating windows are rescaled and centered for the
target monitor.