If your like me, I have have 2 monitors attached to my Ubuntu workstation. When using Windows you could always get programs like Multimon or Ultramon that allowed with the click of one button to move the currently active window to the other monitor and vice versa, but there has never been anything like that available for Linux. Until now. By utilizing a xdotool and a small bash script and keyboard shortcuts, you can accomplish the exact same thing as those programs do on Windows within your Linux desktop. I will provide the directions on how I accomplished this on my system.
Check for xdo and install if required. To check if you have it from a console or shell type:
xdotool windowmove `xdotool getwindowfocus` 100 100
The shell window should move a bit. If it does not then you need to type:
sudo apt-get install xdotool
Locate your screen information using the Nvidia Display Server settings. From the terminal type:
Click on the right most display and then look at the position data on the right next to the Position section. It will say something like +1680+0
You want to note those numbers.
Fire up your favorite text editor and make the bash script for movement. Use the following code:
if [ $1 -eq 2 ]
/usr/bin/xdotool windowmove `/usr/bin/xdotool getwindowfocus` $POS
Within the second POS field enter the 2 numbers that you made a note of from the position section. In my case it was 1680 0
Enter exactly as 1680 0 without the + symbols
Save the file as a .sh
Make sure you make a note of what you call the file. I called mine movewindow.sh
Make the file executable. Type the following into your shell or terminal window.
sudo chmod +x /home/username/scripts/movewindow.sh
Use whatever the name of the file you saved
Create a keyboard shortcut for the bash file to move the window left and right. Go to System tab, preferences, then Keyboard shortcuts.
Click the add button at the bottom.
Make the name: Move window right
Make the command: /home/userloginname/movewindow.sh 1
The path is going to be the path to where you saved the file. After the name of the file you want to put a number 1 at the end denoting that its the 1 monitor.
Click the add button at the bottom again and call it: Move window left
Make the command: /home/userloginname/movewindow.sh 2
The path is going to be the path to where you saved the file. After the name of the file you want to put a number 2 at the end denoting that its the 2 monitor.
Once both of those are created you can assign the keyboard command to be which ever combination you like. I used the window key and right and left arrow.
Now you can easily move the windows around your desktop.