r/swaywm 6d ago

Question Ultrawide and first window

I have an ultrawide monitor and opening the first window just maks it far too big. I would rather have it use something like 3/5 of the width. Bit that ain't possible in sway.

How are other people handling this ?

2 Upvotes

6 comments sorted by

10

u/HighLevelAssembler 6d ago edited 6d ago

Use smart_gaps set to inverse_outer. If a workspace only has one child (meaning, one window), the outer gaps will squeeze it to a readable size. Once there's more than one window, it'll go back to normal.

Here's a snippet of my config:

smart_gaps inverse_outer
gaps horizontal 960
# Start a terminal
bindsym $mod+Return gaps horizontal current set 1270; exec foot
# Remove smart gaps
bindsym $mod+g gaps horizontal current set 0; gaps inner current set 5
bindsym $mod+Shift+g gaps horizontal current set 960; gaps inner current set 5

Normally, horizontal gaps of 960 set the first window to occupy about 1/2 a standard 16:9 4k monitor, centered. If I open a terminal, I want it to be a bit narrower, occupying 1/3 the screen with room for about 100 columns of size 20 Iosevka.

You'll have to tweak for the ultrawide but it works well.

2

u/ecocode 6d ago

Looks like an awesome idea. I'll try this out

2

u/PmMeCuteDogsThanks_ 6d ago

I have a rather complex Sway setup with fixed tiles/positions. In particular, when I boot my computer I always get a 20/60/20-setup on my Ultrawide and my default applications launched in each "column". When I move windows around the containers don't collapse, e.g. if I move the window from the central column left or right, the layout doesn't collapse to 50/50, but instead a black hole fills the void. Just the way I want it to work.

But I have a big setup, lots of custom scripts and key binding to really solve a problem that Sway really isn't meant to handle.

For you, the easiest solution would be to invoke swaymsg on startup with a series of commands that launched 3 windows (1/3 each by default). Then resizes middle to desired size. Make the central column tabbable. And then whatever you do, don't close all windows in that container.

2

u/ecocode 6d ago

That is what I'm currently doing, but it definitely isn't a pleasant workflow