Skip to content

loganswartz/sway-antigrav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sway-antigrav

Let your tiling windows fly free.

About

Tiling windows in Sway/i3 can't be sticky, so they're normally always stuck to a single workspace. sway-antigrav fixes this by allowing windows to automatically follow your focus as you switch workspaces. It does this by swapping the chosen window with some specially tagged placeholder windows on any workspaces that you want the window to follow you to.

This is a sort of natural compliment to one of my other projects, sway-gravity. This program allows tiling windows to move a little more freely than they typically would, and sway-gravity constrains the placement of floating windows to make them a bit easier to use effectively.

Installation

cargo install --git https://github.com/loganswartz/sway-antigrav

Usage

Currently, this program is very much a POC, so there's not any CLI logic set up yet. Run the daemon with sway-antigrav and leave it running.

In order for sway-antigrav to manage windows, they need to have certain marks applied to them. There are 2 types of windows: "main", and "placeholder". When you set up the window marks, you'll essentially assign windows to "groups", where a group is just a number of your choosing. Each group should have exactly 1 main window, and any number of placeholders. When you switch to a workspace that has a placeholder in it, the main window of that group will be swapped with the placeholder.

Main windows get a mark in the format of antigrav-<group number>, and placeholder windows get a mark in the format of antigrav-<group number>-<placeholder number>. The placeholder number is just something to make the placeholder mark unique, as Sway/i3 doesn't allow you to assign duplicate marks to multiple windows.

Once you have your windows properly marked and the daemon is running, it should automatically start swapping the main window around as you switch workspaces.

Currently, it'll also automatically resize all managed windows to their supposed "natural" aspect ratio (as reported by their geometry rect), but eventually this will be optional via a CLI toggle. I mainly built this for managing video windows created by Firefox's PiP mode, which is why it currently happens automatically.

Inspiration

This started as a 1-to-1 Rust port of i3-sticky. This is mainly because I have increasingly little patience for Python dependency management (and I say that as someone who's done a fair amount of projects in Python). As a Rust project, it's much easier to build and install as a single binary that will just work.

sway-antigrav doesn't currently implement all features of i3-sticky, and I also have some plans for future features, beyond what i3-sticky offers.

About

Let your tiling windows fly free

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages