requires wmctrl. worked out on a 2880x900 dual monitor setup (program reads multiple monitors as one continuous screen.) most of what's here should work on a single monitor set up just as well, but some of the entries to position toward the right side do so by counting a number of pixels over from the width's midpoint. it can be fairly easily adjusted, but these instructions are in the beginning stages (most of the comments are still from the original script from
http://unix.stackexchange.com/questions ... 3228#53228.
that i'm adapting to do this) so, an example:
########################################
#!/bin/bash
# upper right midpoint; a fourth (w) and third (h) of screen dimensions
#define the height in px of the top system-bar:
TOPMARGIN=7
#sum in px of all horizontal borders:
RIGHTMARGIN=10
# get width of screen and height of screen
SCREEN_WIDTH=$(xwininfo -root | awk '$1=="Width:" {print $2}')
SCREEN_HEIGHT=$(xwininfo -root | awk '$1=="Height:" {print $2}')
# new width and height
W=$(( $SCREEN_WIDTH / 4 - $RIGHTMARGIN ))
H=$(( $SCREEN_HEIGHT / 3 - $TOPMARGIN ))
# X, change to move left or right:
# moving to the right half of the screen:
X=$(( $SCREEN_WIDTH / 2 ))
#moving to the left:
#X=1444;
Y=$TOPMARGIN
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz && wmctrl -r :SELECT: -e 0,$X,$Y,$W,$H
# on this machine, half the screen width is pretty much the same as counting across to 1400, but doing it this way is more flexible/is more likely to also work on smaller screens. anyway, you can do things like screen width / 4 - 500 or X=$(( $SCREEN_WIDTH / 2 + 800 )) and Y=$(( $SCREEN_HEIGHT / 2 - 5 )). you can add another margin and play around with all the values. learning as i go but it works. still have the original comments from the original source in most of the scripts...go by the title for a hint as to function. for left side adjustments, the number is the value of X, more or less. for the right side (denoted with a p instead of an x), it's what's added to the half value of the screen width. as with the earlier pack, the larger the number, the smaller the window selection.
#upr4x1444 is the windows placement pack script of this (title goes against suggested convention as illustration/so i would remember which one it was).
######################################
....so, the idea that this can be adjusted and expanded and turned into a community project--everybody, join in!--with somewhat self-descriptive titles and comments that explain precisely how and where...hundreds of items fit in very little space on pipe menus that can snake into one another...
anyway, if you get ten or so you like or find you frequently head back to, you can turn them into keyboard shortcuts, but you may want to change the two :SELECT:'s in the line that reads
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz && wmctrl -r :SELECT: -e 0,$X,$Y,$W,$H
to :ACTIVE: so that it instantly acts on the window you have rather than the one you'd need to reach for and click on/activate.
############### root:1menu or place code in jwmrc-personal, _root_.jwmrc,... etc.. ###########################
<?xml version="1.0"?>
<JWM>
<RootMenu onroot="1">
<Menu label="Window Size and Placement" icon="" height="16">
<Menu label="Larger Sizes" icon="" height="16">
<Program label="Top Half" icon="">tophalf</Program>
<Program label="Half Width and Height, Middle Top" icon="">topmid3</Program>
<Program label="Left Half" icon="">lefthalf</Program>
<Program label="Right Half" icon="">righthalf</Program>
<Program label="Bottom Half" icon="">bottomhalf</Program>
<Program label="Half Width and Height, Middle Bottom" icon="">botmid3</Program>
<Separator/>
<Program label="Upper Left Quadrant" icon="">upperleftquadrant</Program>
<Program label="Upper Right Quadrant" icon="">upperrightquadrant</Program>
<Program label="Lower Left Quadrant" icon="">lowerleftquadrant</Program>
<Program label="Lower Right Quadrant" icon="">lowerrightquadrant</Program>
</Menu>
<Menu label="/3" icon="" height="16">
<Program label="Upper Left Margin" icon="">upl3</Program>
<Program label="Upper Left, 400 pixels to the Right" icon="">upl3x400 </Program>
<Program label="Upper Left, 555 pixels to the Right" icon="">upl3x555</Program>
<Program label="Upper Right, Start at Midpoint" icon="">upr3</Program>
<Program label="Upper Upper Right Margin" icon="">upr3m</Program>
<Separator/>
<Program label="Lower Left Margin" icon="">lwl3</Program>
<Program label="Lower Left, 500 pixels to the Right" icon="">lwl3x500</Program>
<Program label="Lower Right, Start at Midpoint" icon="">lwr3</Program>
<Program label="Lower Right Margin" icon="">lwr3m</Program>
</Menu>
<Menu label="Left Side Placement" icon="" height="16">
<Program label="lower left /2" icon="">lwl2</Program>
<Program label="lower left /3" icon="">lwl3</Program>
<Program label="lower left /4" icon="">lwl4</Program>
<Program label="lower left /5" icon="">lwl5</Program>
<Program label="upper left /2" icon="">upl2</Program>
<Program label="upper left /3" icon="">upl3</Program>
<Program label="upper left /4" icon="">upl4</Program>
<Program label="upper left /5" icon="">upl5</Program>
</Menu>
<Menu label="Right Side Placement" icon="" height="16">
<Program label="lower right /2" icon="">lwr2</Program>
<Program label="lower right /3" icon="">lwr3</Program>
<Program label="lower right /4" icon="">lwr4</Program>
<Program label="lower right /5" icon="">lwr5</Program>
<Program label="upper right /2" icon="">upr2</Program>
<Program label="upper right /3" icon="">upr3</Program>
<Program label="upper right /4" icon="">upr4</Program>
<Program label="upper right /5" icon="">upr5</Program>
</Menu>
<Menu label="/4" icon="" height="16">
<Program label="Upper Left Margin" icon="">upl4</Program>
<Program label="Upper Left, 444 pixels to the Right" icon="">upl4x444</Program>
<Program label="Upper Left, 888 pixels to the Right" icon="">upl4x888</Program>
<Program label="Upper Right, Start at Midpoint" icon="">upr4x1444</Program>
<Program label="Upper Right Margin" icon="">upperrightmargin4</Program>
<Separator/>
<Program label="Lower Left Margin" icon="">lwl4 </Program>
<Program label="Lower Left, 400 pixels to the Right" icon="">lwl4x400</Program>
<Program label="Lower left, 900 pixels to the Right" icon="">lwl4x900</Program>
<Program label="Lower Right, Start at Midpoint" icon="">lwr4</Program>
<Program label="Lower Right, midpt. plus 400" icon="">lwr4p400</Program>
<Program label="Lower Right Margin" icon="">lwr4rghtmrgn</Program>
</Menu>
<Menu label="/5" icon="" height="16">
<Program label="Upper Left Margin" icon="">upl5</Program>
<Program label="Upper Left, 345 pixels to the Right" icon="">upl5x345</Program>
<Program label="Upper Left, 790 pixels to the Right" icon="">upl5x790</Program>
<Program label="Upper Left, 1000 pixels to the Right" icon="">upl5x1000</Program>
<Program label="Upper Right, Start at Midpoint" icon="">upr5</Program>
<Program label="Upper Right, midpt. plus 450" icon="">upr5p450</Program>
<Program label="Upper Right, midpt. plus 950" icon="">upr5p950</Program>
<Separator/>
<Program label="Lower Left Margin" icon="">lwl5</Program>
<Program label="Lower Left, 333 pixels to the Right" icon="">lwl5x333</Program>
<Program label="Lower Left, 666 pixels to the Right" icon="">lwl5x666</Program>
<Program label="Lower Left, 999 pixels to the Right" icon="">lwl5x999</Program>
<Program label="Lower Right, Start at Midpoint" icon="">lwr5</Program>
<Program label="Lower Right, midpt. plus 300" icon="">lwr5p300</Program>
<Program label="Lower Right, midpt. plus 600" icon="">lwr5p600</Program>
<Program label="Lower Right, midpt. plus 900" icon="">lwr5p900</Program>
</Menu>
</Menu>
<Desktops></Desktops>
<Include>/root/places_submenu</Include>
</RootMenu>
</JWM>
----------------
# if you want it as a left click menu, add the above to a file called root1menu placed in /root and add the following to jwmrc.personal or .jwmrc-tray:
# <Include>/root/root1menu</Include>
# <!-- <TrayButton label="1">root:1</TrayButton> -->.
# change the 1 to 4 or 5 if you want to activate the menu by scroll up or down instead. the <Include>/root/root1menu</Include> line added to your custom.jwmrc or /etc/xdg/.../._root_.jwmrc file will add the menu to the right click/main menu. or you could just add the code to one of your custom .jwmrc files or directly to the /etc/xdg/.../._root_.jwmrc file itself.
######################################
helpful hint: alt + right click is grab and resize, alt+left click is grab and move. it may be easier in the long run...