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
Improvements for static windows #3243
Comments
We may be able to actually drop the |
Thinking on this some more, there are two use cases for
It might be worth thinking about what to name these two things, so that we don't have to refer to both as 'static' which will be confusing. e.g. we could rename If anybody has any feedback or comments on this, I'd love to hear it. |
Definitely worth distinguishing those two use cases. I'm not sure I totally follow that you're saying in the last sentence of your second bullet though. As for names, I prefer |
I do want to get our website done but would be happy to take a look at this if you haven't already started by then. |
Awesome, I haven't started on this beyond the thoughts above. |
Hi there, setting a Window to 'static' mode has helped me to have an awesome way to stick windows, but I'm having trouble when trying to disable static mode. The window gets buggy and the only way to fix it is restarting Qtile. Any updates on this? |
I've not got round to looking at this yet... |
Would love to see sticky windows added to Qtile as in option two described above. This would be really useful for when I for example have mpv open at a set size / location and and floating. Being able to pin it ( sticky ) to an output would be perfect. |
After reading the discussion #3221 and seen that there is no way of making a Static window a (normal) Window again. I tried to add it to a group and it seems to be missing some parts. In the following code I search for static windows under the mouse. If there are no static windows, I make the qtile.current_window static. When there is a static window I try to make it normal again: @lazy.function
def toggle_window_static(qtile: Qtile) -> None:
def _window_contains_mouse(window: WindowType, mouse_position: Tuple[int, int]) -> bool:
return (
window.x <= mouse_position[0]
and mouse_position[0] <= window.x + window.height
and window.y <= mouse_position[1]
and mouse_position[1] <= window.y + window.width
)
current_mouse_position = qtile.core.get_mouse_position()
static_windows: List[Static] = [
window
for window in qtile.windows_map.values()
if isinstance(window, Static) and _window_contains_mouse(window, current_mouse_position)
]
if not static_windows:
send_notification(
f"The window {qtile.current_window.name} is now sticky to the screen", ""
)
qtile.current_window.static()
return
selected_static_window: Static
if len(static_windows) > 1:
# Select the static window to make normal
pass
selected_static_window = static_windows[0]
send_notification(f"The window {selected_static_window.name} is back to normal", "")
qtile.current_group.add(selected_static_window) Error: Is there any way of creating a Maybe as a workaround I might be able to use the To finish this comment, I'm loving Qtile, great work team! |
The
Static
class is a bit half baked and could do with some love. Here are some improvements that would be good to have:qtile.current_window
: allows for exposingStatic
commands, simpler focus logic.cmd_static
on a window before theclient_managed
hook, still let it grab focus.cmd_static
?Any other improvements that would make these more usable?
If anybody wants to work on these then that's amazing, if not, I will get round to it at some point.
The text was updated successfully, but these errors were encountered: