0

I use two monitors: one directly in front of me and one on the right. It happens frequently that I want to move the entire content of the right screen to the center screen and vice versa. The best method I found so far is using the combination (function + shift + left/right). With this method however, I need to do it with every window.

Is there a build in function in Ubuntu or an application to achieve this feature?

If not, what would be an effective approach to implement this on my own?

Thanks for any help on this,

Cheers

1 Answers1

0

Note: I am posting this as an "answer", because of the amount of detail it contains, I cannot post it as a comment. If you comment to my "answer", I may be able to expand it to a real answer.


I do not have two monitors in my environment, however I have defined two workspaces in my GNOME environment:

$ wmctrl -d
0  * DG: 1920x1080  VP: 0,0  WA: 0,0 1920x1046  Workspace 1
1  - DG: 1920x1080  VP: N/A  WA: 0,0 1920x1046  Workspace 2

I created the following script to move all windows from one workspace to the other:

#!/bin/bash
wmctrl -l | while read win desk rest ; do
  let ndesk=1-desk
  echo $win $desk →  $ndesk
  wmctrl -i -r $win -t $ndesk
done

I do not know whether this also applies to monitors. Can you first try the command wmctrl -d and comment? Note: You can install the wmctrl command using sudo apt install wmctrl.

FedKad
  • 13,420