pkkid / x11pygrid

Quickly move windows around the an X11 desktop
GNU General Public License v2.0
324 stars 41 forks source link

Can the order in which the window widths are used be reversed? #34

Open maniaxuk opened 3 years ago

maniaxuk commented 3 years ago

First off I'd like to thank the author for creating PyGrid as it comes very close to replicating features that I've been used to for 15? years in the Windows world that were provided by WinSplit Revolution

Having said that I'm trying to find out if it's possible to tweak the settings of PyGrid to match even better what I'm used to specifically the order in which the window widths are used

At the moment when using PyGrid to move windows around it starts with the narrowest width and increases the width by one step each type the relevant key combination is pressed

For example

Assuming the following changes to the default settings

'maxwidth': 0.75,

'xdivs': 4,  

Which will divide the screen into 4 divisions and allow a window to go to 75% of the screen width

Pressing <CTRL>+<ALT>+<NUMPAD-4> will move the active window to the left of the screen and set it to 25% of the screen width

Pressing <CTRL>+<ALT>+<NUMPAD-4> again will set it to 50%

Pressing <CTRL>+<ALT>+<NUMPAD-4> a third time will set it to 75%

So the display order is 25% > 50% > 75%

What I'd prefer is for the display order to be 75% > 50% > 25%

Looking at the contents of the pygrid.json there's no obvious setting to achieve a reversal of the display order but is there an undocumented method or perhaps a unusual value for a setting that can be used?

If such an option isn't already available can I request one be added to PyGrid at some point

pkkid commented 3 years ago

It's been a while since I looked at this code and I don't have it runnong on this PC right now. However, you might try replacing the return statement in the _generate_sequence_percents() function from return seqs to return seqs[::-1]

maniaxuk commented 3 years ago

Hi

Thanks for the reply, I've not yet tried making the change you suggested but I have noticed an "inconsistency" in the way the window resizing happens which makes me think it'll not have the desired result

The inconsistency I've noticed is as follows

Repeated pressing of <CTRL>+<ALT>+<NUMPAD-4> resizes the window width to 25% > 50% > 75%

Whilst

Repeated pressing of <CTRL>+<ALT>+<NUMPAD-6> resizes the window width to 75% > 50% > 25%

Note that I'm referring to the width of the moved windows with these numbers, it seems the way the script works is to move the edge of the window being moved to the X% position on screen rather than sizing the window so it is X% width

This inconsistency makes me think that even if the suggested change reversed the way <CTRL>+<ALT>+<NUMPAD-4> worked it would also reverse the way <CTRL>+<ALT>+<NUMPAD-6> worked as well as the other left\right alignments which effectively just moves the issue I was trying to get around :)

Ah well, not a problem, it was just a nice to have thought as even with it working differently to what I'm used to\expecting it still achieves what I need even if it means I'll probably end up cycling through window sizes a few times as I miss the size I want :)