Skip to main content

i3/sway script to toggle between last windows

Project description

i3-swap-focus

i3/sway script to toggle between last windows. For older Python version (<3.7), use this branch.

Requirements

Install

Recommanded way is to use a Python package installer such as uv or 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

i3_swap_focus-0.4.5.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

i3_swap_focus-0.4.5-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file i3_swap_focus-0.4.5.tar.gz.

File metadata

  • Download URL: i3_swap_focus-0.4.5.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for i3_swap_focus-0.4.5.tar.gz
Algorithm Hash digest
SHA256 f8f65c0e2be63978e54378cceaeba349515be0b5c28cdf3243737e356f6220a0
MD5 fb5c8e9f7445e89c148d920a212d3a55
BLAKE2b-256 148170bbb7b637f1b8f9fc70c27c2808c5c00f4ac6bb60a660919c9fb3cd14c4

See more details on using hashes here.

File details

Details for the file i3_swap_focus-0.4.5-py3-none-any.whl.

File metadata

  • Download URL: i3_swap_focus-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for i3_swap_focus-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b3a494e370ef9e7fe70ba232459093c1b012b0994f6188de493444a016ecb5b9
MD5 92a54aaec7f53d3f02b498b301c5190e
BLAKE2b-256 6d8d8c3135bb5c7fc03264e7f008aa2a7f79387fd6b2197d2f83d178e90a251e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page