Skip to content
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

How to move window to divs #23

Open
rsuzano opened this issue May 27, 2020 · 3 comments
Open

How to move window to divs #23

rsuzano opened this issue May 27, 2020 · 3 comments

Comments

@rsuzano
Copy link

rsuzano commented May 27, 2020

Hi,
I have an doubt, if in my pygrid.json I configure xdivs:4 ...
So I think when I press Ctrl Alt 1 de window is size to 25% and its moved do bottom left of my screen (and seems to be what it does).
When I focus another window, and press Ctrl Alt 1 the another window is resized to 25% of my screen,but goes to bottom left to, overlaying the first window.

If I configured xdivs=4, so, how can I put the second window just after the first?

like the picture attached, when I focus on Sublime Text editor and press Ctrl Alt 1 the window is resized and goes to bottom left corner, when I focus on Gnome Terminal and press Ctrl Alt 1 I want do send the window at the "next" screen division, next to sublime text window.

Screenshot from 2020-05-26 22-56-32

@pkkid
Copy link
Owner

pkkid commented May 27, 2020

I never programmed that in. When using the corners, I always have that corner of the window touching the corner of the screen. It's been so long that I don't actually remember this code much anymore. However, if you're feeling adventurous, take a look at the function _generate_sequence_percents(); It returns a list of window positions to iterate through.

@rsuzano
Copy link
Author

rsuzano commented May 27, 2020

Ok, so, can you please give me more details about what's the idea of the config "xdivs" and "ydivs"??

@pkkid
Copy link
Owner

pkkid commented May 28, 2020

You have the idea of xdivs and ydivs correct in your statements above. They are used to help determine how to cycle windows when repeatedly pressing the corner hotkeys. The function _generate_sequence_percents() mentioned above builds a list of the window areas to cycle through. This function needs to be updated to cycle through additional areas if you want to include the area mentioned your question.

For example: If I add print(seqp) just above line 188 and have xdivs=4 and ydivs=2 in the config. I get the below output when moving the window to the bottom left corner (ctrl+alt+1).

Seq(x1=0.0, x2=0.25, y1=0.5, y2=1.0, w=0.25, h=0.5)
Seq(x1=0.0, x2=0.5, y1=0.5, y2=1.0, w=0.5, h=0.5)

This is showing the two positions that would be cycled through when repeatedly pressing this key combination (values represented as percentages of the screen width and height). If this function is updated to return more positions in the list, it will cycle those positions as well. You would want it to include an entry for Seq(x1=0.25, x2=0.5, y1=0.5, y2=1.0, w=0.25, h=0.5).

Hope that helps, ask as many questions as you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants