I recently acquired a couple of monitors second hand, so I've set up my laptop with a second monitor, with the external display logically to the right of the display in my laptop. However, my current window manager of choice, evilwm, doesn't quite manage multiple monitors in the way I expected, especially as my laptop's display and the external display are of different sizes.
Instead of having two virtual displays placed, like so:
+------------------++------------------------+
| || |
| || |
| laptop || |
| || other display |
| || |
+------------------+| |
| |
+------------------------+
evilwm gives me one large logical space instead:
+--------------------------------------------+
| xx |
| xx |
| laptop xx |
| xx other display |
| xx |
|xxxxxxxxxxxxxxxxxxxx |
| dead space x |
+--------------------------------------------+
What I expect is that when I maximise a window such as Firefox it fills the entirety of the monitor the window is in. What I get is the window fills the entire logical display, which means the window is stretched across both monitors and the lower left portion (marked "dead space" above) is not accessible without window resizing.
My usual approach is to break out a text editor and a compiler and patch the living daylights out of whatever is getting in my way... but I know zero about X11 programming (nor am I sure that that's really knowledge that I want to have). So instead, I've configured openbox (which I just so happened to have lying around) to feel as much like evilwm as possible.
First of all, I disabled window decorations by adding the following snippet to the <applications>
section of my rc.xml
file:
<application class="*">
<decor>no</decor>
<position force="no"></position>
</application>
I then replaced the default keybinding for closing applications (Alt-F4) with the default that evilwm uses (Control-Alt-Escape). I then added the following list of keybindings to make myself feel more at home (indented in case of copypasting):
<keybind key="C-A-Return">
<!-- I use lxterminal, but substitute your own terminal emulator here if necessary -->
<action name="Execute"><command>lxterminal</command></action>
</keybind>
<keybind key="C-A-x">
<action name="ToggleMaximize"/>
</keybind>
<keybind key="C-A-l">
<action name="MoveRelative">
<x>15</x>
<y>0</y>
</action>
</keybind>
<keybind key="C-A-h">
<action name="MoveRelative">
<x>-15</x>
<y>0</y>
</action>
</keybind>
<keybind key="C-A-k">
<action name="MoveRelative">
<x>0</x>
<y>-15</y>
</action>
</keybind>
<keybind key="C-A-j">
<action name="MoveRelative">
<x>0</x>
<y>15</y>
</action>
</keybind>
<keybind key="C-A-S-l">
<action name="ResizeRelative">
<right>10</right>
</action>
</keybind>
<keybind key="C-A-S-h">
<action name="ResizeRelative">
<right>-10</right>
</action>
</keybind>
<keybind key="C-A-S-k">
<action name="ResizeRelative">
<bottom>-10</bottom>
</action>
</keybind>
<keybind key="C-A-S-j">
<action name="ResizeRelative">
<bottom>10</bottom>
</action>
</keybind>
I didn't add evilwm's "fix window" keybinding, Control-Alt-F, as I use it mostly for moving windows across virtual desktops (by first fixing a window, changing to another desktop and then unfixing it) and openbox's default keybindings to move a window between desktops (Alt-Shift and arrow keys) are slightly nicer to me. openbox's default bindings for moving between desktops are also the same as evilwm's.
I added some additional keybindings to move windows between monitors within a virtual desktop. This means I don't have to sit for ages with Control-Alt and vi keys to arrange my windows. It's also quite useful seeing as openbox opens new windows on the first monitor, which is my laptop screen and not as big as the external display.
<keybind key="W-1">
<action name="MoveResizeTo">
<!-- move the window to the first monitor -->
<monitor>1</monitor>
</action>
</keybind>
<keybind key="W-2">
<action name="MoveResizeTo">
<!-- move the window to the second monitor -->
<monitor>2</monitor>
</action>
</keybind>