I have a small shelf on my desk that the books would always fall off. To maximize book space, we used c-claps for bookends. These red clamps were a few bucks a piece at Home Depot. I did spot some cheaper black ones at Harbor Freight after I bought these.
While the red is really fun, it doesn't match anything in our house. Color was an easy fix.
Here is how we did it...
Let the spray paint dry over night. You don't want to smudge your super awesome paint job.
There were a few scratches on my desk from when I first tightened the clamps down. The felt pads should prevent any more of that.