r/swaywm

▲ 64 r/swaywm

I got tired of manually tiling on sway, so I made per-workspace auto layouts

Hey everyone,

I love sway, but after a while I got tired of arranging every window by hand. Split here, resize there, repeat on every workspace. I wanted automatic layouts so I built swaytiles. It gives each workspace its own tiling layout, and you can switch between them whenever you want.

Layouts so far: master and stack, centred master, dwindle, spiral, grid, tabs and floating.

The part I care about most: anything you arrange by hand wins over the layout. If you resize or move a window yourself, it won't fight you. It also leaves fullscreen windows and dialogs alone.

  • Written in Python, talks to sway over IPC
  • Runs as a systemd user service, so it starts with your session
  • A layout menu works with fuzzel, rofi, wofi, tofi, bemenu, wmenu or dmenu
  • A swap-with-master keybind
  • MIT licensed

Setup is just copying a few files and adding two lines to your sway config. The README has the steps and a demo video and there are docs for every layout.

Repo: https://github.com/sertacartun/swaytiles

It's still young (1 star, and that's me 😄), so I'd love feedback, bug reports or layout ideas, especially if you use multiple outputs or odd setups. Thanks for reading!

u/sertacartun — 7 days ago
▲ 29 r/swaywm

I replaced KDE Plasma's KWin with (a) Sway (fork).

Whenever someone asks about this on a forum the response always seems to be 'KDE uses its own custom protocols, it's not possible'. I wondered how many of the protocols are actually needed. Turns out that properly implementing two functions(set_position, set_role) gets you 95% of the way there.

Other things I did:

  • Advertise a separate entry in the login manager called 'Sway Plasma'. The startup script switches out KWin's systemd unit with a Sway replacement, and everything else in Plasma's startup is untouched.
  • Add stub implementations for some DBus services
    • Makes screen dimming inhibition and session logout work properly
  • Write a panel widget for showing Sway Workspaces

Some known issues:

  • Screen locking doesn't work. Swaylock probably still functions, but good luck integrating that with Plasma's screen dimming / sleep.
  • You can floating-modifier-drag notifications.
  • Focus-follows-mouse doesn't play well with floating applets. Turns out standard Plasma has the same issue.

Why?

I chose Sway because I wanted productivity and configurability. I didn't want:

  • My laptop unexpectedly dying multiple times because I didn't set up a script that warns me about low battery
  • Being paranoid that I may be missing other critical notifications of the above sort
  • Installing / learning about a thousand million programs to configure
    • Wifi
    • Bluetooth
    • Printers
    • ...
  • Debugging swayidle and learning about flaws with Wayland's idle-inhibit protocol

A real desktop environment would be real nice, but I don't want to rely on tiling scripts that lack features and seem to go out of maintenance every 3 months.

https://github.com/quadratech188/sway-plasma
AI use: Debugging, Learning QML

u/QuadraTech — 9 days ago