klesh / JigsawWM

JigsawWM is a dynamic window manager for Windows10/11 just like the suckless dwm for the X
GNU Lesser General Public License v3.0
140 stars 5 forks source link

set fixed sequence of application windows #6

Closed nnako closed 11 months ago

nnako commented 11 months ago

the tilers / layouts depend on a given sequence of application windows. so, the startup sequence of applications seems to determine the initial window configuration. e.g. when I want to realize the following window configuration on a big screen, I would first have to arrange my applications into the fitting sequence, then start the desired pyw example, before the screen would look as expected:

+----------+----------+----------+----------+
|          |          |          |          |
|          |          |          |          |
|     6    |     7    |     8    |          |
|          |          |          |          |
|          |          |          |          |
+----------+--+-----+-+----------+          |
|             |     |            |          |
|             |     |            |          |
|             |     |            |          |
|             |     |            |     4    |
|             |  3  |      1     |          |
|     5       |     |            |          |
|             |     |            |          |
|             |     |            |          |
|             +-----+------------|          |
|             |                  |          |
|             |         2        |          |
+-------------+------------------+----------+

I would want the following applications to fill the respective locations within my big screen:

1    NEOVIM
2    CMD
3    NOTEPAD++
4    FREEPLANE
5    CHROME
6    OUTLOOK
7    TOTAL COMMANDER
8    EXCEL PLAN

normally, the initial application sequence is far from the desired one. thus leading to first having to use the appropriate key combinations to shift the applications onto their expected sequence within the application list.

Is there a way to start up the applications in the correct order so that JigsawWM displays the application windows in the desired way? without having to "correct" their order?

here is the code I use in layouts.py:

def static_bigscreen_8(n: int) -> Iterator[FloatRect]:
    """layout for a big screen (like a television) of
    55 inches or more. here, the 'eve line' should
    define the main horizontal segregation. due to
    an attempt to stay below it for main actions on
    the screen. the screen will be optimal for 8
    application windows.

    .. code-block:: text

 ...

    :param n: total number of currently active windows
    :rtype: Iterator[FloatRect]
    """

...
    if n==8:
        yield 0.45, 0.37, 0.75, 0.80
        yield 0.30, 0.80, 0.75, 1.00
        yield 0.30, 0.37, 0.45, 0.80
        yield 0.75, 0.00, 1.00, 1.00
        yield 0.00, 0.37, 0.30, 1.00
        yield 0.00, 0.00, 0.25, 0.37
        yield 0.25, 0.00, 0.50, 0.37
        yield 0.50, 0.00, 0.75, 0.37
klesh commented 11 months ago

No existing support at this point. I believe it is doable, here demonstrates the way to determine if a window is a New Unmanaged Window, and they will be appended/prepended to the list in here .

Maybe you can pass down the desired order as a list all the way down to the MonitorState and use it to determine the index for a new Window.

nnako commented 11 months ago

ok. thanks. I'll have a look at it and send you a pull request when it is done :-) .

nnako commented 11 months ago

thanks for the approval. There are some issues, though, which I'd like to fix in the near future. e.g. placeholders in case certain applications have not been started, yet, as soon as the window manager does it's static job.

klesh commented 11 months ago

@nnako no problem, take your time.