maximbaz/dotfiles

Question: How to create margin between opened windows?

mordax7 opened this issue ยท 5 comments

From the README screenshot of your desktop, I noticed that it is possible to have margins between the opened windows. I did not find any configuration which would point out this setting. Not sure what I am missing.

Yours:
image

Mine:
image

Where can I find it?

Hello!

In general gaps are provided by sway, so look inside ~/.config/sway/config and there is a "Gaps" section on top.

Two additional pointers:

  1. The smart_gaps feature allows to only have gaps when necessary, when there are more than one window on the screen, otherwise it removes the gaps to have a more "integrated" experience - I like it, but you may want to try with that setting set to "no".

  2. On your screenshot you seem to have white lines between kitty, I think it's because you use kitty's windows (opened with Ctrl+Shift+Enter) - I dont use them, I always use "real" kitty OS windows (i.e. I open new kitty instances every time, using hyper+Enter, or Ctrl+Shift+n inside kitty to "clone" kitty and have a new terminal in the same directory). Because I use kitty OS windows, it's again sway that controls gaps, but if you use kitty windows, you might need to configure this inside kitty somehow.

Ah yes, my bad, I thought you used only one window there.

But if I open a new window of kitty with Ctrl + Shift + n, for example, it opens as a separate window and not beside it:
image

After opening a new window, to get the spaced layout, I have to use ctrl + h/j/k/l to move it next to it. Is there a way to open a new window in this layout by default?

Also, is there a way to move a spaced window back to the tabbed view?

I could answer myself the question regarding moving a window back to the tabbed view, just have to use ctrl + k to put it back up. But I am closing this one since my initial question got answered.

Thank you! :)

Apologies, I was sure I answered, but I guess I forgot to click "Send" ๐Ÿ˜…

You can play with workspace_layout option in sway config, I have it set to tabbed (what you see on screenshot) simply because I found it the most useful for me. With different values you can get this default placement changed.

There are also see shortcuts for container layout manipulation below, they are also useful to control the exact behavior of new window placement:

# Container layout: split
$hyper+e layout toggle split
# Container layout: tabbed
$hyper+w layout tabbed
# Split
$hyper+s split toggle
# Focus the parent container
$hyper+u focus parent
# Focus the child container
$hyper+i focus child

The best resource I know of how to learn to use all these shortcuts is i3wm docs ๐Ÿ˜„ I suggest you to dedicate some time and try to follow it to experiment with available options.

https://i3wm.org/docs/userguide.html

Finally there are also some interesting scripts out there, for example check out this script, it builds on top of available layout to provide an automatically alternating layout: https://github.com/nwg-piotr/autotiling. I believe though it might conflict with some of the hotkeys above, but try to experiment!

@maximbaz Sweet! ๐ŸŽ‰ You really do have some crazy possibilities.