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

Two different size monitors = windows on both screens #2

Closed
pprw opened this issue Oct 20, 2016 · 5 comments
Closed

Two different size monitors = windows on both screens #2

pprw opened this issue Oct 20, 2016 · 5 comments

Comments

@pprw
Copy link

pprw commented Oct 20, 2016

Hi,

I have two screen with different size. One in my laptop screen (1600x900 16/9) and the other is an external monitor (1280x1024 4/3).

I am using Xfce and was looking for a way to move windows from one screen to the other with a single keystroke. move-to-next-monitor works but some time, the windows is splited between the two monitors. A piece of the window is on the left monitor (laptop) and the rest in on the right monitor (erternal).

I guess this happens because the resolution of the laptop is higher than the one of the external monitor.

Is there a way to customize the script to handle this problem?

Here are some informations about my configuration:

nil4:~$ xdpyinfo | awk '/dimensions:/ { print $2; exit }' | cut -d"x" -f1
2880
pierre@nil4:~$ xdpyinfo | awk '/dimensions:/ { print $2; exit }' | cut -d"x" -f2
1024
pierre@nil4:~$ xdotool getdisplaygeometry | cut -d" " -f1
1280
pierre@nil4:~$ xdotool getdisplaygeometry | cut -d" " -f2
1024

$ xrandr
Screen 0: minimum 8 x 8, current 2880 x 1024, maximum 32767 x 32767
LVDS1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 310mm x 170mm
   1600x900      60.04*+  40.03  
   1440x900      59.89  
   1368x768      60.00  
   1360x768      59.80    59.96  
   1152x864      60.00  
   1280x720      60.00  
   1024x768      60.00  
   1024x576      60.00  
   960x540       60.00  
   800x600       60.32    56.25  
   864x486       60.00  
   800x450       60.00  
   640x480       59.94  
   720x405       60.00  
   640x360       60.00  
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
DVI-I-1 connected primary 1280x1024+1600+0 (normal left inverted right x axis y axis) 376mm x 301mm
   1280x1024     60.02*+  75.02  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32    56.25  
   848x480       60.00  
   640x480       75.00    59.94  
   720x400       70.08  
  1024x768 (0x112) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x115) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  800x600 (0x116) 36.000MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
        v: height  600 start  601 end  603 total  625           clock  56.25Hz
  640x480 (0x119) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz

@jc00ke
Copy link
Owner

jc00ke commented Oct 23, 2016

I'm sure there is a way to fix the script. In fact, I'd say it's a bug that it doesn't work. However, I don't have a way to work on it anymore (I've since switched to plain GNOME) so maybe others could help you figure it out?

@Sylvain303
Copy link

@Sylvain303
Copy link

So I coded some thing here: https://github.com/Sylvain303/move-to-next-monitor/tree/center-screen-offset

Sorry I modified the code a lot, in order to have function calls to test part of the code. It's also only bash compatible for now. I was thinking about centering the window in the screen, but I didn't implement it.

If someone can test it with more than two screens and with different offset.

Also I've a bug with a decoration offset, or something, because it applies a padding on 'y' offset down, if you repeat the move the window end to be at the bottom, on my primary screen.

@jc00ke
Copy link
Owner

jc00ke commented Oct 23, 2020

Hi @Sylvain303,

It's been 4 years... I hope you figured this out. Regardless, I don't use this anymore so I'm going to close this issue. If you've figured it out, let me know.

@jc00ke jc00ke closed this as completed Oct 23, 2020
@Sylvain303
Copy link

Hi @jc00ke, Yes I managed to solve this. I don't use it currently, neither. As I don't have dual screen for now.

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

No branches or pull requests

3 participants