I recently got a second monitor set up, and I now have a "main" bigger monitor and a second small one. I found that I often work on the main monitor while having things on the second monitor for reference, but I often have to switch between the two. The CompizConfig plugin has a shortcut for "put to next output" which does exactly what I want; it moves the active window to the other monitor. However I often need to swap the windows between monitors, so I was wondering:
Is there a way to move all windows to the other monitor with a single keyboard shortcut?
EDIT: I checked this question, but the script provided by point 1 of the accepted answer fails with this terminal output:
Traceback (most recent call last):
File "./.bin/swap_windows", line 32, in <module>
swap_windows()
File "./.bin/swap_windows", line 18, in swap_windows
shift_r = get_shiftright(xr_output)
File "./.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
IndexError: list index out of range
at line 9. – Riccardo Orlando Jul 17 '17 at 20:33xrandr
somewhere? – Jacob Vlijm Jul 17 '17 at 21:07xrandr
. My monitors are not aligned, so I indeed have no monitor at 0, 0. Having them aligned fixes this issue, and the script works almost as intended, however it misses maximised windows only on the first monitor. (Moving from screen 2 to screen 1 works, but not the other way) – Riccardo Orlando Jul 17 '17 at 22:03