Assuming you can get the right height/position;
Isolate the speakers from the shelves with blu-tak and pack them with books on all sides so that you absorb the rearward LF radiation whilst creating an even surface flush with the baffle for forward radiation (half space).
In a more thorough arrangement, you could surround each speaker with a thick frame of medium density mdf material and some foam padding (to help absorb rear LF energy & best if this is an integral braced part of the shelving).
You will have a reasonably close equivalent of a soffit mount(an in-wall speaker configuration used in studios) and a practical place to keep books. Not perfect but probably better than on a stand close to a wall, which gives LF energy cancellation from rear wall reflected energy.
Isolate the speakers from the shelves with blu-tak and pack them with books on all sides so that you absorb the rearward LF radiation whilst creating an even surface flush with the baffle for forward radiation (half space).
In a more thorough arrangement, you could surround each speaker with a thick frame of medium density mdf material and some foam padding (to help absorb rear LF energy & best if this is an integral braced part of the shelving).
You will have a reasonably close equivalent of a soffit mount(an in-wall speaker configuration used in studios) and a practical place to keep books. Not perfect but probably better than on a stand close to a wall, which gives LF energy cancellation from rear wall reflected energy.