-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to limit to outputs #42
Conversation
To enable different limits on different outputs, you can start two processes and limit them to the outputs you want.
Thanks! I'll test as soon as I'm at my own desk. |
At least on sway output = e.ipc_data.get("container", {}).get("output", "") returns nothing. No "output" in |
I couldn't take a look into in yet. Hm, maybe there is a more reliable way to get the focused output. |
I used some recursion in nwg-autotiling. |
It's so easy with the workspace... With this, I think I found another way. Iterate over outputs and check if the current workspace is active on it. def output_name(i3):
focused_container = i3.get_tree().find_focused()
for output in i3.get_outputs():
if focused_container.workspace().name == output.current_workspace:
return output.name
return None I measured both approaches and scanning the parents is a lot faster than collectin information about the outputs. |
Apparently there are differences in the returned ipc_data for sway and we cannot use the ipc_data of the event that triggered the handler. To accommodate this, we look at the currently focused container and check its parents recursively until we find the output.
I changed how the output is being detected. Could you give it another try? |
It seems to work well. Some minor suggestions: parser.add_argument("-o",
"--outputs",
help="restricts autotiling to certain output; "
"example: autotiling --output DP-1 HDMI-0",
nargs="*",
type=str,
default=[], ) This only affects a single output. Shouldn't it be help='limit how often autotiling will split a container; "How often" sounds misleading to me. Maybe just "how deep"? |
No, outputs is correct. It works very similar to
I am a bit confused the patch does not contain this. I think you are referring to the |
I must've made a mistake, sorry. |
Feel free to rephrase the help though! I was struggling with finding a good way to describe it. |
So was I. I wouldn't be easy to a native English speaker, I bet. |
To enable different limits on different outputs, you can start two processes and limit them to the outputs you want.
Like suggested in #41.
I did not implement anything for nwg-panel to not break anything.