A lot of work has gone into hacking common items (like IKEA Lack tables) into useful and effective 3D printer enclosures ... and a combination of solid shelf plus anchoring to the wall put ...
If you want to hang a shelf on the wall, you can print brackets with your 3D printer. You’ll need to create a shape that has a right angle and has holes for using screws to attach it.