If the 2x4's are orientated vertically and are resting on the floor, they will support most of the weight. Think of a hundred lb weight hanging on a 2x4 in free air, just your hand holding it from falling over. It will not require 100 lbs of effort on your part to stop the 2x4 from falling. the force you are exerting is not vertical, the 2x4 takes care of that. You effort is only opposing the overbalance of all load being on one side.
HeyBub may have been sober all along.
Of course the OP could add 2x4s to the front of the shelves as well and have a device that would not require any attachment to his walls at all.