it really really is. Another option, if you’re okay with it not being a floating shelf is a pair of keyhole brackets fixed to wooden braces. The braces then are bolted into the shelf board (You could leave them floating if there was no, uh, cat…).
Then, some glue-down carpet squares for traction. (if they’re up high you won’t see it so get the ugliest cheapest discards you can! I mean, uh… go for that cyberpunk-chiq look. )