0

I work on a laptop connected to an additional monitor. Sometimes I just want to move windows that I have on the laptop screen to the big screen, and windows from the big screen to a laptop. Is it possible to do it with a key combination?

I don't want to move each window to another monitor one by one. I would like to have a shortcut key, that just swaps windows from one screen to another and vice-versa.

Here is xrandr output:

Screen 0: minimum 320 x 200, current 3520 x 1080, maximum 16384 x 16384
LVDS-1 connected 1600x900+0+180 (normal left inverted right x axis y axis) 344mm x 194mm
   1600x900      60.00*+
   1152x864      59.96  
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   720x400       59.55  
   640x400       59.95  
   640x350       59.77  
VGA-1 connected primary 1920x1080+1600+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+
   1680x1050     59.95  
   1280x1024     75.02    60.02  
   1440x900      59.89  
   1280x960      60.00  
   1280x720      60.00  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   640x480       75.00    72.81    66.67    59.94  
   720x400       70.08  
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
RB_
  • 101
  • Not exactly the same, but very related: https://askubuntu.com/questions/597884/move-windows-between-screens-in-dual-screen-mode – Jacob Vlijm May 13 '17 at 19:23
  • @JacobVlijm Thanks. Yes, I want to achieve the same result as the person who asked that question, but solutions posted there do not work. – RB_ May 14 '17 at 16:53
  • I beg your pardon, did you even try? Just tested it again, it works fine. – Jacob Vlijm May 14 '17 at 17:37
  • Yes, I tried the first version. The only thing I did differently - I put the script into /usr/bin, not in ~/.bin, because that way command was not working. However, when Im running command, it gives me this error: Traceback (most recent call last): File "/usr/bin/swap_windows", line 32, in swap_windows() File "/usr/bin/swap_windows", line 18, in swap_windows shift_r = get_shiftright(xr_output) File "/usr/bin/swap_windows", line 9, in get_shiftright lines = [l for l in xr_output.splitlines() if "+0+0" in l][0].split() IndexError: list index out of range – RB_ May 14 '17 at 17:56
  • Can it have something to do with the resolution difference = my laptop screen is 1600900(16:9) and monitor is 19201080(16:9) – RB_ May 14 '17 at 18:01
  • No, but if the output of xrandr does not show a screen located at +0+0, your screen setup is weird. please post the output of xrandr to your question. – Jacob Vlijm May 14 '17 at 19:18
  • Please first run xrandr --output LVDS-1 --pos 0x0 && xrandr --output VGA-1 --pos 1600+0, then please try again the script(s). Normally I would position the first screen in the origin. The script counts on it, hence the error. – Jacob Vlijm May 14 '17 at 20:23
  • It works now. Thank you very much ! However, windows are not automatically resized to fit the screen. – RB_ May 15 '17 at 09:15

0 Answers0