I sleep on the top bunk of a bunk bed, and here is my technique. I lick two fingers, and wet my pussy. Then I swing my leg over the rail of the bunk bed, and rub my pussy against the wood back and forth. Oh, it feels so good!
For extra pleasure, I also stick an object up my pussy so it's in there while I rub against the wood. I use one of those plastic money containers you can hang around your neck. I pull the top off, and stick the bottom half in me.