I had leftover shelving, and thought it might work in the bathroom. The trouble was the roof is slanted, there is a skylight, and who knows what is behind the drywall? I found a few joists/studs with the stud-finder, not in the most convenient place for the size of the shelf.
Because of the stud location, I needed hooks and chain for the outer shelf edge. The inner edge could go up against the wall -- the helpful folks at Hodges Hardware sold me a handful of clips that were intended for wiring, and re-purposed as clamps.
The chain hangs from brass hooks (also from Hodges). Originally I looked at hook eyes, but that would add more S-hooks. The galvanized metal chain I'm using temporarily until I get a few feet of brass chain to better match the hook.
This is a closeup of the clamp anchoring the shelf into the wall around the skylight. If you look close you can see it has an insulated center; this helps keep the shelf steady. The twist tie was a marker to keep the centered shelving location correct. There isn't an anchor behind this screw, it simply goes into the metal drywall edging. Normally I would not trust any weight to that metal; this shelf has 2 outer clamps that have drywall expansion screws in them (see "drilling" below).
The photos and video clips aren't in chronological order, as I put up 2 shelves on different days (had to go back later for more clips after seeing how well the first shelf held weight). The screw job video clip shows manual screwing of the 2 inner clamps and the pivot step afterward.
The drill sounds rather whiny as it probably needs a touch of oil. I'm using it to drive a screw into a hollow wall anchor. The first step (not shown) was drilling the hole for the anchor, next, driving the screw in to expand the anchor, and finally, as shown, screwing it tight.