Closed baztian closed 1 year ago
Hey. Thanks for reporting this issue.
Can you run the same command with debug flags activated: move-to-monitor -vvv ...
Please share the command line as well as the output.
I’ll try to add a unit test to check that setup and provide and fix.
$ move-to-monitor -vvv
DEBUG:ewmh_m2m.__main__:Detected screens: {Geometry(320, 1440, 1920, 1080), Geometry(0, 0, 2560, 1440)}
DEBUG:ewmh_m2m.__main__:Containing screen: Geometry(0, 0, 2560, 1440)
Traceback (most recent call last):
File "/tmp/ewmh-m2m/bin/move-to-monitor", line 8, in <module>
sys.exit(main())
File "/tmp/ewmh-m2m/lib/python3.10/site-packages/ewmh_m2m/__main__.py", line 65, in main
move_to_screen(args)
File "/tmp/ewmh-m2m/lib/python3.10/site-packages/ewmh_m2m/__main__.py", line 36, in move_to_screen
raise ValueError("No sibling screen found")
ValueError: No sibling screen found
But I found out that NORTH and SOUTH directions work.
$ move-to-monitor -vvv -d SOUTH
DEBUG:ewmh_m2m.__main__:Detected screens: {Geometry(320, 1440, 1920, 1080), Geometry(0, 0, 2560, 1440)}
DEBUG:ewmh_m2m.__main__:Containing screen: Geometry(0, 0, 2560, 1440)
DEBUG:ewmh_m2m.__main__:New window geometry: Geometry(320, 1440, 810, 372)
The default move direction is EAST
. But you don’t have any screen in the East direction (or west, as direction cycles), so it’s expected that the default call move-to-monitor
fails.
As you found, you must pass a vertical direction (SOUTH
or NORTH
) to make the script consider the bottom or top screen a candidate to move to.
If your screen setup often changes from vertical setup to horizontal one, I suggest you to use 2 calls, as suggested in #20:
move-to-monitor || move-to-monitor -d SOUTH
This way, it tries to move horizontally and fallback on moving vertically if no horizontal screen is found.
I close this issue as you found the right way to fix it. 😉
Even https://github.com/AlexisBRENON/ewmh_m2m/pull/25 doesn't seem to fix the issue