Skip to content

[Feature request] Support Super-Shift-Arrow #19

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

Closed
KaKi87 opened this issue Sep 9, 2023 · 14 comments
Closed

[Feature request] Support Super-Shift-Arrow #19

KaKi87 opened this issue Sep 9, 2023 · 14 comments
Assignees
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@KaKi87
Copy link

KaKi87 commented Sep 9, 2023

Hello,

When moving a window across from one monitor to another using this shortcut, the window preserves its position, instead of being repositioned relatively to existing windows, like when moving it via mouse.

It would be nice to support that use case.

Thanks

@leukipp leukipp self-assigned this Sep 11, 2023
@leukipp leukipp added bug Something isn't working enhancement New feature or request labels Sep 11, 2023
@KaKi87
Copy link
Author

KaKi87 commented Dec 28, 2023

Hello,
Any news on this ?
Thanks

@leukipp leukipp removed the bug Something isn't working label Jan 16, 2024
@leukipp
Copy link
Owner

leukipp commented Jan 16, 2024

Window movements caused by external applications (or from build-in OS functionality) are hard to be handled properly, especially across all the different distro versions. Quoting from #31 (comment):

Since cortile sets min/max window dimension values, caches and reloads window positions, tracks mouse movements and windows across multiple screens, etc. it is not recommended to be used beside other tiling solutions at the same time.

It would be easier and more reliable to implement additional functionality (e.g. move window to top/right/monitor1/monitor2/etc...) directly into cortile, but this would be part of a bigger project.

If you often need this functionality you can create a custom script which uses wmctrl or xdotool to trigger X events. Something like minimize (untrack window), move to another screen, maximize (track window) should trigger proper X events that cortile is aware of.

active=$(xdotool getactivewindow) && xdotool windowminimize $active && xdotool windowmove $active $(xdotool getdisplaygeometry | awk '{print $1}') 0 && xdotool windowactivate $active

@KaKi87
Copy link
Author

KaKi87 commented Jan 16, 2024

Window movements caused by external applications (or from build-in OS functionality) are hard to be handled properly [...] It would be easier and more reliable to implement additional functionality [...] directly into cortile

Do you mean assigning the Super-Shift-Arrow shortcuts to Cortile instead of the desktop environment ? I'm all for it.

@leukipp
Copy link
Owner

leukipp commented Jan 16, 2024

You can already bind keys to external commands. So Super-Shift-Arrow registered in config.toml could execute a custom command (see #43 (comment)) to move the current active window via script using xdotool.

@KaKi87
Copy link
Author

KaKi87 commented Jan 16, 2024

But what's the difference between your script and desktop environment features ?

Does your script move windows in a way that allows cortile to keep tiling while the desktop environment's window movement doesn't ?

@leukipp
Copy link
Owner

leukipp commented Jan 16, 2024

Does your script move windows in a way that allows cortile to keep tiling while the desktop environment's window movement doesn't ?

Yes, cortile tracks mouse clicks, drag events and drop events.
So it doesn't know what to do with suddenly jumping windows.

It could be caused by the application themself (like firefox, spotify are reloading the last position after been added to the window stack) or it could be caused by other external applications, or some other crazy things GNOME does (like re-rendering client side decorations).

@KaKi87
Copy link
Author

KaKi87 commented Jan 16, 2024

I'm sorry I don't see how I can make Ctrl-Shift-Left move the active window to the previous monitor and make Ctrl-Shift-Right move the active window to the next monitor using the configuration file or your script 🤔

@KaKi87
Copy link
Author

KaKi87 commented Feb 22, 2024

Hello ?

@leukipp leukipp added the wontfix This will not be worked on label Mar 1, 2024
@leukipp
Copy link
Owner

leukipp commented Mar 1, 2024

ATM it's not planned that cortile supports move events (e.g. between monitors) caused by some external process.

@leukipp leukipp closed this as completed Mar 1, 2024
@KaKi87
Copy link
Author

KaKi87 commented Mar 1, 2024

How about having Cortile itself listen to Ctrl-Shift-Arrow and move the windows itself ?

@leukipp
Copy link
Owner

leukipp commented Aug 16, 2024

Please review cortile-addons and #65.

@KaKi87
Copy link
Author

KaKi87 commented Aug 16, 2024

How about something for end users ?
Thanks

@leukipp
Copy link
Owner

leukipp commented Aug 16, 2024

Please invest at least a little bit of time looking into the resources I provided:
https://github.com/leukipp/cortile-addons/blob/main/examples/move_app_to_screen.py

@KaKi87
Copy link
Author

KaKi87 commented Aug 16, 2024

This requires installing Python's package manager and setting up the script to execute at startup.

What would at least be more user-friendly would be to automatically create the addons directory and having the main Cortile app itself execute everything it contains, so that all the user would have to do is download the file into the specified directory.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants