I was able to make it work using wmctrl and xdotool . Both are window manipulation tool.
#!/bin/bash
WIN=$(xdotool getactivewindow)
eval $(xdotool getwindowgeometry --shell $WIN)
WIDTH=$(calc "int($WIDTH*0.75)")
wmctrl -r :ACTIVE: -b remove,maximized_horz,sticky
wmctrl -r :ACTIVE: -e "0,0,24,$WIDTH,-1"
Above script snap window to 75 % to its size to left side. Save above script in a file and assign shortcut to the file.
Similarly following script snap window to 25% width to the right.
#!/bin/bash
WIN=$(xdotool getactivewindow)
eval $(xdotool getwindowgeometry --shell $WIN)
X=$(calc "int($WIDTH-$WIDTH*0.25)")
WIDTH=$(calc "int($WIDTH*0.25)")
wmctrl -i -r $WINDOW -b remove,maximized_horz
wmctrl -i -r $WINDOW -e "0,$X,-1,$WIDTH,-1"
Check wmctrl and xdotool manpages and tutorials to find how they work.
Install dependencies using
sudo apt-get install apcalc wmctrl xdotool
Note: The resizing works relative to current window position and size. To make it relative to screen size, maximize the window then execute the script.