Introduction
The script bellow asks user to choose 1/3 or 2/3 resize option for a window, then allows the user to select a window that is to be resized. The window to be resized to 1/3 will jump on the left and 2/3 window will jump on the right. The script can be bound to a keyboard shortcut as necessary.
Preliminary setup
The script relies on wmctrl
program to do the job. Make sure it is installed first with
sudo apt-get install wmctrl
Setting up the Script
Create folder in your home folder called bin
. You can do so with the command
mkdir $HOME/bin`
In that folder create a file resizer.sh
. Copy over the script below to that file.
Make sure the script is executable with
chmod 755 $HOME/bin/resizer.sh
Open System Settings -> Keyboard -> Shortcuts -> Custom Shortcuts.
Create a new shortcut and give it full path of the script as command,
for example, /home/serg/bin/resizer.sh
.
My example
I set up the shortcut first:

Then press the shortcut. The popup menu allows selection of 1/3 or 2/3 resize; I choose 1. Notice, there's no additional input, except a single 1 digit

Next I choose the free-floating browser window. It jumps to the left, now 1/3 in width, desktop height.

Same behaviour will be for the 2/3 option,
excep the 2/3 window will be placed on the right side

Quirks
Having tested this script, the resizing doesn't work on maximized or left/right split windows (CtrlSuper→/←). Hence, the window must be un-maximized, free-floating.
Script source
#!/bin/bash
#--------------------
# Author: Serg Kolo
# Date: Sept 26,2015
# Purpose: a script to resize a window to its
# 1/3 or 2/3 of width.
# Written for http://askubuntu.com/q/678608/295286
#--------------------
#---------------------
# This part takes user input through graphical popup;
# Input must be 1 or 2, anything else results into an error
# If user selects 1, we set window to 1/3 of desktop width
# and place it on the left;
# If user selects 2, we set window to 2/3 of desktop width
# and place it on the right;
SIZE=$(zenity --entry --text "Enter (1) for 1/3 and (2) for 2/3 of width")
case $SIZE in
"1")NUM=0.333; XPOS=0;;
"2")NUM=0.667;XPOS=455;;
*) zenity --error --text="Invalid input"; exit ;;
esac
#--------------------
# In this part we determine the geometry of the desktop
# and then calculate the width that we want the window to
# be set using bc, the command line calculator
# printf is used to convert floating point result to
# integer value, which is required for wmctrl
ROOT_WIDTH=$(xwininfo -root | awk '/Width/ {print $2}')
ROOT_HEIGHT=$(xwininfo -root | awk '/Height/ {print $2}' )
NEW_WIDTH=$(bc <<< $ROOT_WIDTH*$NUM)
NEW_WIDTH=$(printf "%.0f" $NEW_WIDTH)
#----------------------
# This is what actually does the job.
# wmctrl allows you to select the window with -r :SELECT:
# and sets that window to specific gravity,x-position,y-position,width
# height. To keep the script neutral, I've decided to set the
# height to default desktop height. User can resize the height as
# necessary by themselves
wmctrl -r :SELECT: -e 0,$XPOS,0,$NEW_WIDTH,$ROOT_HEIGHT