i3-back

An i3/Sway utility to switch focus to your last focused window. Allows for behavior similar to Alt+Tab on other desktop environments.

Features:

Demo

https://user-images.githubusercontent.com/2672503/221384419-3d62413d-8987-4147-82bc-5e87cea8bb90.mp4

Installation

i3-back requires i3/Sway. It is written in Rust. It can be installed through many method:

Setup

In your i3/Sway configuration (~/.config/i3/config/~/.config/sway/config):

```

Start the daemon which listens to focus changes and sets _back mark

exec --no-startup-id ~/.cargo/bin/i3-back

Bind a switch key, which focuses the previously focused window

bindsym $mod+Tab [conmark=back] focus ```

Replace ~/.cargo/bin with wherever the i3-back binary is placed if not installed through Cargo.

How it works

The daemon (i3-back) listen for i3 window events. When a window event is received, i3-back records the previously focused window ID. When the previous focus has changed, it sets the _back mark.

When the switch bind is called, it focuses the mark set by the daemon.

Prior work