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.4.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.4-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: i3_swap_focus-0.4.4.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.4.tar.gz
Algorithm Hash digest
SHA256 6f1101ce3f89b9699ff1d6178a621d9a4c25d1cb283d0b3e391b35818fca938a
MD5 6684e75abc5ef7f6f6e2e713958c6928
BLAKE2b-256 6597b87d1d4b91f7beda65beae33b0c0e641b43926da7e1d0075005403dc22a9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: i3_swap_focus-0.4.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f0a8e094eecf19cdcf844d004ff5dd7231578eceeee0fa101bd9473d863c7b11
MD5 ad3fe533899458674ec3a1d08c14ab0a
BLAKE2b-256 c98c4a7a37bb19603f22e508d48336044e2fe80686ec094edb1d11b6f79ae77f

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