Metadata-Version: 2.2
Name: i3-swap-focus
Version: 0.4.4
Summary: i3/sway script to toggle between last windows
Author-email: Olivier Le Moal <mail@olivierlemoal.fr>
License: MIT
Project-URL: Homepage, https://github.com/olivierlemoal/i3-swap-focus
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: setuptools
Requires-Dist: i3ipc

# i3-swap-focus

i3/sway script to toggle between last windows. For older Python version (<3.7), use this [branch](https://github.com/olivierlemoal/i3-swap-focus/tree/python-3.6-support).

### Requirements

* [i3ipc](https://github.com/altdesktop/i3ipc-python)

## Install

Recommanded way is to use a Python package installer such as [uv](https://docs.astral.sh/uv/) or [pipx](https://github.com/pypa/pipx)

```
## Using uv
uv tool install git+https://github.com/olivierlemoal/i3-swap-focus

## Using pipx
pipx install i3_swap_focus
```

### i3/sway config example

```
exec i3-swap-focus
bindsym $mod+Tab exec pkill -USR1 -F "${XDG_RUNTIME_DIR}/swap_focus.pid"
```

## Features

### Ignore windows

To ignore some windows (e.g windows that belong to scratchpad), just mark them with ``ignore_focus`` in your config :

```
# Put a term in scratchpad
exec alacritty --class scratchpad_term

# i3 :
for_window [instance="scratchpad_term"] mark "ignore_focus", move scratchpad

# sway :
for_window [app_id="scratchpad_term"] mark "ignore_focus", move scratchpad
```

### Stay in workspace

This script accepts a ``--stay-in-workspace`` flag if you do not wish to focus on a different workspace :
```
exec i3-swap-focus --stay-in-workspace
```
