[i3king] add option to apply rules for currently running windows #90

Closed
opened 2021-08-05 12:47:39 +00:00 by gmardom · 4 comments
gmardom commented 2021-08-05 12:47:39 +00:00 (Migrated from github.com)

When i3 is restarted all existing windows loses their containers.
This option (--apply mb) would loop through all windows and apply their corresponding rules.

When i3 is restarted all existing windows loses their containers. This option (`--apply` mb) would loop through all windows and apply their corresponding rules.
budRich commented 2021-08-05 16:34:41 +00:00 (Migrated from github.com)

I think i see what you mean. But i3-msg restart is awkward. I just tried it here now on my computer, and I have lots of windows in tabs and on the scratchpad. I expected everything to, you know, get messed up i thought i would see all windows in the same vertically split container or something. but nothing happened. all the windows where left as in place.

But one annoying thing is that the marks dissapear, and for me (and maybe you) that means that i3fyra has no idea about the layout. hmm.

There are four ways to tackle this problem:

  1. As i mention in the known issues section of the Readme, don't use restart, use reload instead.
  2. Don't tackle this issue
  3. Add the --apply option as you suggest
  4. I think we can subscribe for the restart event, and automatically apply when it happens, this would also have the benefit of us being able to restore the subscription (because it is broken on restart).

I think i will experiment with both 3 and 4, but will always recommend 1. I have a feeling that even if we add 3 and/or 4, a smooth restart will not happen anyways.


Thank you very much for this issue, i am glad you tried the scrip, these kind of issues prove that you really tried it, this is also something i had not thought about at all, and it is good to keep this scenario in mind for future updates.

I think i see what you mean. But `i3-msg restart` is awkward. I just tried it here now on my computer, and I have lots of windows in tabs and on the scratchpad. I expected everything to, you know, get messed up i thought i would see all windows in the same vertically split container or something. but nothing happened. all the windows where left as in place. But one annoying thing is that the marks dissapear, and for me (and maybe you) that means that i3fyra has no idea about the layout. hmm. There are four ways to tackle this problem: 1. As i mention in the known issues section of the Readme, **don't** use restart, use reload instead. 2. Don't tackle this issue 3. Add the `--apply` option as you suggest 4. I think we can subscribe for the restart event, and automatically apply when it happens, this would also have the benefit of us being able to restore the subscription (because it is broken on restart). I think i will experiment with both 3 and 4, but will always recommend 1. I have a feeling that even if we add 3 and/or 4, a smooth restart will not happen anyways. --- Thank you very much for this issue, i am glad you tried the scrip, these kind of issues prove that you really tried it, this is also something i had not thought about at all, and it is good to keep this scenario in mind for future updates.
gmardom commented 2021-08-05 17:15:01 +00:00 (Migrated from github.com)

It is as you say, windows stay in same layout but they lose their marks and new windows apper in weird places.
Sorry for not explaining much.

As i mention in the known issues section of the Readme, don't use restart, use reload instead.

I don't tipically use restart but reload simply didn't recover me from mess I've managed to do while migrating to new version of i3ass and updating i3 to 4.19.2 😋.


Unrelated question...
How do you make i3, i3king, lxde, info output go under monitor tabbed container?
Is it manual or automatic proces or do you have key binding for that?
I'd love to see debug output like this but I'm not i3 wizzard like you.

It is as you say, windows stay in same layout but they lose their marks and new windows apper in weird places. Sorry for not explaining much. > As i mention in the known issues section of the Readme, don't use restart, use reload instead. I don't tipically use `restart` but `reload` simply didn't recover me from mess I've managed to do while migrating to new version of `i3ass` and updating i3 to `4.19.2` 😋. --- Unrelated question... How do you make `i3`, `i3king`, `lxde`, `info` output go under `monitor` tabbed container? Is it manual or automatic proces or do you have key binding for that? I'd love to see debug output like this but I'm not i3 wizzard like you.
budRich commented 2021-08-05 23:13:01 +00:00 (Migrated from github.com)

I added --apply option now to i3king. It will test all windows against the rules (this also means windows on the scratchpad and all workspaces).

This is also done automatically when the restart event is sent to the IPC (which happens when we restart i3 with f.i. i3-msg-restart). Another thing that happens with restart is that it closes all IPC sockets, meaning that i need to "re-subscribe" to the IPC, this is also done now, by simply restarting i3king. I also added --no-restart option, in case this behaviour causes issues for someone.

Also, the --apply option will not start any subscription, it will just test and apply the rules, then exit. So if you want full control, you could have a restart script looking something like this (assuming you started i3king with --no-restart option):

#!/bin/bash
i3-msg restart
# do stuff ...
i3king --apply
# do other things
i3king --no-restart

Regarding the question about the monitor tab, lets take it to the discussion forums!

I added `--apply` option now to **i3king**. It will test all windows against the rules (this also means windows on the scratchpad and all workspaces). This is also done automatically when the `restart` event is sent to the IPC (which happens when we restart i3 with f.i. `i3-msg-restart`). Another thing that happens with restart is that it closes all IPC sockets, meaning that i need to "*re-subscribe*" to the IPC, this is also done now, by simply restarting i3king. I also added `--no-restart` option, in case this behaviour causes issues for someone. Also, the `--apply` option will not start any subscription, it will just test and apply the rules, then exit. So if you want full control, you could have a restart script looking something like this (assuming you started i3king with `--no-restart` option): ``` shell #!/bin/bash i3-msg restart # do stuff ... i3king --apply # do other things i3king --no-restart ``` Regarding the question about the monitor tab, lets take it to the discussion forums!
budRich commented 2021-08-05 23:54:30 +00:00 (Migrated from github.com)

i created a new thread regarding the monitor tab thing: #94

i created a new thread regarding the monitor tab thing: #94
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bud/i3ass#90
No description provided.