- Ubuntu Sharing
- Disable Alt+Click Moving windows in Ubuntu 12.04
- Ubuntu Documentation
- Using the mouse:
- Using the keyboard:
- More Information
- See Also
- How to move all windows to another workspace
- 2 Answers 2
- Move window to another monitor in Ubuntu using keyboard
- 5 Answers 5
- How to move window buttons to right in Ubuntu 16.04 [duplicate]
- 3 Answers 3
Ubuntu Sharing
Ubuntu Tips | Ubuntu Howtos | Ubuntu Tutorials
Disable Alt+Click Moving windows in Ubuntu 12.04
This simple tutorial will explain how to disable or change the Alt+left mouse from moving windows in Ubuntu 12.04 gnome-shell and unity desktop.
There used to be a built-in utility for switching this movement key to an other in Gnome 2.
I don’t know why ‘Move Window’ plugin in CCSM doesn’t work in Ubuntu 12.04. Now I think the best way to disable or change Alt key and left mouse from moving windows is using dconf-editor. This will take effect in both Gnome Shell and Unity while settings in gconf-editor only work for Unity.
Disable/Change Alt+Left Mouse Moving windows in Gnome Shell & Unity:
First you may not installed dconf-tools yet, hit Ctrl+Alt+T to launch terminal and execute this command to install it:
sudo apt-get install dconf-tools
Now, launch dconf-edtior and navigate to org -> gnome -> desktop -> vm -> preferences.
Set value of mouse-button-modifier to:
- none will disable Alt + left/right/middle key at next login
- switch to other keys, such as , , etc.
Holding down the key will not only move windows by left mouse, but also resize window by middle mouse and show window menu by right mouse.
Ubuntu Documentation
Using the mouse:
Open the Activities overview.
Click and drag the window toward the right of the screen.
Drop the window onto an empty workspace. This workspace now contains the window you have dropped, and a new empty workspace appears at the bottom of the workspace selector .
Using the keyboard:
Select the window that you want to move (for example, using the Super + Tab window switcher ).
Press Super + Shift + Page Up to move the window to a workspace which is above the current workspace on the workspace selector .
Press Super + Shift + Page Down to move the window to a workspace which is below the current workspace on the workspace selector .
More Information
See Also
- What is a workspace, and how will it help me? — Workspaces are a way of grouping windows on your desktop.
You can choose the displayed language by adding a language suffix to the web address so it ends with e.g. .html.en or .html.de.
If the web address has no language suffix, the preferred language specified in your web browser’s settings is used. For your convenience:
[ Change to English Language | Change to Browser’s Preferred Language ]
The material in this document is available under a free license, see Legal for details.
For information on contributing see the Ubuntu Documentation Team wiki page. To report errors in this documentation, file a bug.
How to move all windows to another workspace
Is is possible to move all windows (or all not minimized windows) form one workspace to another?
I know I can move one window to other workspace with Shift + Ctrl + Alt + arrow , but it will move only that one focused window.
2 Answers 2
Unity : What are Viewports?
Ubuntu Unity uses viewports — basically a coordinate system (with coordinate 0,0 being top left corner) , where one giant desktop subdivided into chunks that fit your screen resolution. Coordinates grow in value as you move to the right and downwards.
The coordinate system is relative. If my current viewport is top left , everything relative to that viewport will be positive values in increments of width and height. For instance, if my current viewport is top leftmost, the firefox window in top middle workspace you see above is positioned in at x value 1366 and y value 0 relative to the top leftmost viewport. If my active viewport is top middle one, the terminal window in top leftmost viewport is positioned at x value -1327 60. This is the key issue for xdotool , because xdotool does not deal with negative numbers.
Note also that, the top left corner of your current viewport will always be assumed by xdotool as coordinates 0 0 . That means we can only move stuff right and down.
Making xdotool work for Unity
Now we know that xdotool can move windows only relative to our top-left corner ( i.e., you can always move window down and right , but never up and left ). How do we make that work for unity. Well, the basic idea would be to
- Figure out all the windows on current viewport
- Move to a requested viewport momentarily to make the top left corner assume coordinates 0 0 at that viewport
- Move all windows to user-defined viewport coordinates
- Return to the old viewport ( optional , could follow the windows as well )
Scripting Solution
The script below performs exactly the procedure described above. It can be called with either -v flag to manually specify coordinates or you can use -g flag to bring up GUI dialog. -f flag will tell the script to switch viewport too ; if that flag is not used — you’ll remain on the current viewport and only windows will be moved around
Obtaining the script
One can copy the source code from this post directly or through github using the following steps:
- sudo apt-get install git
- cd /opt ; sudo git clone https://github.com/SergKolo/sergrep.git
- sudo chmod -R +x sergrep
The script file will be /opt/sergrep/move_viewport_windows.sh
Note that wmctrl and xdotool are required for this script to work properly. You can install them via sudo apt-get install xdotool and wmctrl
Source Code
Demo
Webm recording of the script in action:
Issues
Due to Unity’s grid plugin that is responsible for window snapping, the script cannot move the maximized , or right/left snapped windows. It will be attempted to add the momentary unset and reset of that plugin to make the script work with all windows, but because unsetting and resetting has a time delay, it might be abandoned as an idea. If you want the script to make working with all windows, install unity-tweak-tool and unset window snapping under Window Manager options.
Move window to another monitor in Ubuntu using keyboard
In Windows 7, you can press Shift +
5 Answers 5
What you need:
- wmctrl ( sudo apt-get install wmctrl )
- The dimensions of each monitor
How to do it:
- From the terminal, run gnome-keybinding-properties and click «Add»
- Name the entry something like «Move to left monitor» and enter this command:
- wmctrl -r «:ACTIVE:» -e 0,0,0,1280,1024
- You can change «:ACTIVE:» to «:SELECT:» and wmctrl will wait until you select a window
- The values for -e are gravity,x-coordinate,y-coord,width,height . I have gravity set to 0, which is default (I don’t actually know what gravity does), x and y-coordinates set to 0 and 0, and the width and height are the dimensions of the left monitor: 1280 and 1024. Change this to match your configuration.
- wmctrl -r «:ACTIVE:» -e 0,0,0,1280,1024
- Click where it says «Disabled» and press the same keyboard shortcut as in windows, i.e. Shift + Super + left
- Make another entry for «move to right monitor»
- wmctrl -r «:ACTIVE:» -e 0,1280,0,1366,768
- Where I have «1280», put the horizontal resolution of your left monitor. The vertical resolution can be more tricky if your monitors have different resolutions, and especially if they aren’t lined up along the top or bottom. Mine are aligned along the top, so the vertical-coordinate value is «0».
- My right monitor is 1366×768, so replace those values with the appropriate ones.
- wmctrl -r «:ACTIVE:» -e 0,1280,0,1366,768
- Map the shortcut-key sequence and you’re finished!
- Name the entry something like «Move to left monitor» and enter this command:
You may have to tweak the coordinates and dimensions to account for the top (usually 24px tall) or side panels.
How to move window buttons to right in Ubuntu 16.04 [duplicate]
I’ve installed Ubuntu 16.04 on my laptop and I’m using gnome-shell 3.18.4. When I’m trying to move the window buttons to the right by using dconf-edit How to switch window controls to the left (Gnome Shell)? I’m unable to move the window buttons to the right.
What can I do to move the buttons to the right?
3 Answers 3
If I understand you correctly and you are on (Vanilla) Ubuntu 16.04 with GNOME Shell installed (version 3.18.4) the following command should move the buttons to the right:
To set them back, the command is:
At the moment there is not much that can be done to shift the window buttons to the right in a standard installation of Ubuntu Xenial Xerus. Since Trusty Tahr the handling of window decorations is no longer accessible from org.gnome.desktop.wm.preferences and is now handled by Unity itself. Alterations with tools such as the Tweak Tool or Dconf Editor in this area are no longer respected and will exasperatingly and silently be ignored.
So until someone can produce a suitable patch for the Unity source code, and I would personally welcome such a patch, we are stuck with buttons to the left.
References:
Hmmm. Interesting. I was thinking. I’m on 16.04. I’m also on gnome-shell 3.18. But my window buttons are on the right.
Lightbulb, when reading the comments: Oh, I’m on Ubuntu GNOME, rather than Ubuntu vanilla.
If you wanted to use Ubuntu as distro and Gnome Shell as the DE (as I also prefer), you’ll have a better Gnome experience by installing the Ubuntu GNOME flavor instead. So why not give it a try? The base distribution will just be the same anyways.