This AskUbuntu post, from the same user, is aiming to develop the solution further for multiple monitors. Based on this post I'll do my own workaround.
I have two displays. One is 1024x768, the other is 1280x1024 in resolution.
I either put them beside or on top of each other.
I already worked out the usage of the tablet screen as a tablet in similar settings.
I will call displays beside each other "Sided", and displays on top of each other "Topped".
Sided screen is 2304x1024, Topped is 1280x1792 in resolution.
The script as is, puts the active window according to this table:
|Snap||Sided display||Topped display|
|left||left screen||bigger screen left|
|right||right screen||bigger screen right|
|up||bigger screen up||upper screen|
|down||bigger screen down||lower screen|
There are problems with the resized window's sizes, caused by the different screen sizes and the expanded edge panels (top and bottom panel). This is what I would like to fix.
the tool for dynamic screen manipulation is xrandr.
Normal/Default (with only one screen and the expanded edge panels (top+bottom) in place)
Small display maximized window is 1024x692 in position 0:80
Big display maximized window is 1280x948 in position 0:80
Small display (with panels) maximized window is 1024x716 in position 0:1080
Small display maximized window is 1024x740 in position 0:1080
Big display (with panels) maximized window is 1280x972 in position 0:80
Big display maximized window is 1280x996 in position 0:56
As is visible from the altering numbers, either the top or the bottom of the windows are hidden under the edge panels in the Topped view.
This is a problem experienced by different users in AskUbuntu and elsewhere.
It is caused because "panels in between monitors are not supported, and this is a limitation in the freedesktop specification for reserving space for things like panels."
# What is my Desktop Manager? ("dm")
~$ env | grep XDG_CURRENT_DESKTOP
Mine is GNOME.
# What is my Window Manager? ("wm")
~$ wmctrl -m
Mine is Metacity. It's configuration tool is gconftool-2.
It can be set to be a compositing window manager (like compiz but simpler) by opening dconf-editor and navigating to > org > gnome > metacity > compositing-manager > mark checked. It has these features: real window transparency (i.e. terminal window), window shadow, Alt+Tab window selector shows screenshot of the window; it is said to support AWN, and Gnome Do.
#What is EWMH?
EWMH is a standard for window management. For more info visit this site.
# What is the full size of the display?
that is given by
~$ wmctrl -G -l | grep Desktop
~$ xwininfo -root | grep Heightand ~$ xwininfo -root | grep Width
~$ xwininfo -root | egrep '(Height|Depth)'displayed in two rows.
# Is the view topped or sided?
if width>height it is the sided view, else it is the topped view.
# What are the single display sizes?
they are given by
xrandr -q | grep '*'displayed in two rows.
#What are the names of the displays?
they are given in
~$ xrandr -q
my displays are LVDS1 and VGA1 indicating the connection port they use.
# How many displays do I have?
~$ xrandr -q | grep -c -w connected
# What are the positions (coordinates) of the displays?
they are given in
~$ xrandr -qin the form of XxY+W+H where the W and H are the x and y positions
# Which display has the edge panels?
the primary display has them. that is given by
~$ xrandr -q | grep -w primary
#What do I need?
- I need the edge panes handled so they would not hide any portion of the maximized windows. --> partially done.
- I need new scripts for moving a windows to either one of the displays.
- I need the snap-to-sides scripts to work within the screen where the window actually is.
- A next step would be if this whole thing would work by dragging the windows to the side of the screen, like on Microsoft Windows.
- this article shows how a bash script can grab monitor properties
- some coding hints with wmctrl
- some more hints for using wmctrl
- an article on virtual screens generally
- a stackoverflow post on partial struts on multiple displays