AeroSnap lets you quickly snap a window to any of the 4 screen edges, resizing it to half of screen size. This makes it easy to display 2 windows side-by-side.
The following steps will add 4 keyboard shortcuts Ctrl+Alt+Left/Top/Right/Down to JWM's configuration. The code requires wmctrl to be installed. Please note that the windows will be horizontally or vertically maximized. This allows to restore them (approximately!) to their previous size.
Step 1: Open file /root/.jwm/jwmrc-personal with an editor
Step 2: Insert following 4 shortcuts (If your browser shows more than 4 lines: copy the whole code section to your editor. This will eliminate any confusing line wraps and you should end up with only 4 lines)
Step 3: Save jwmrc-personal
Step 4: Restart JWM (Menu: Shutdown > Restart JWM or from Terminal: jwm -restart)
Code: Select all
<Key mask="AC" key="Left"> exec:SW=$(($(cat /tmp/pup_event_frontend_scrn_x)/2));wmctrl -r :ACTIVE: -e 0,0,-1,$SW,-1; wmctrl -r :ACTIVE: -b add,maximized_vert</Key>
<Key mask="AC" key="Right">exec:SW=$(($(cat /tmp/pup_event_frontend_scrn_x)/2));wmctrl -r :ACTIVE: -e 0,$SW,-1,$SW,-1;wmctrl -r :ACTIVE: -b add,maximized_vert</Key>
<Key mask="AC" key="Up"> exec:SH=$(($(cat /tmp/pup_event_frontend_scrn_y)/2));wmctrl -r :ACTIVE: -e 0,-1,0,-1,$SH; wmctrl -r :ACTIVE: -b add,maximized_horz</Key>
<Key mask="AC" key="Down"> exec:SH=$(($(cat /tmp/pup_event_frontend_scrn_y)/2));wmctrl -r :ACTIVE: -e 0,-1,$SH,-1,$SH;wmctrl -r :ACTIVE: -b add,maximized_horz</Key>
IMPORTANT UPDATE 2015-05-16
JWM v.2.3 adds new configuration options and key bindings: maxh, maxv, maxtop, maxbottom, maxleft and maxright.
This not only makes above wmctrl work around obsolete, it provides much faster and reliable tiling. Above shortcuts would look like this:
Code: Select all
<Key mask="AC" key="Left">maxleft</Key>
<Key mask="AC" key="Right">maxright</Key>
<Key mask="AC" key="Up">maxtop</Key>
<Key mask="AC" key="Down">maxbottom</Key>