Q. Is it allowed to get undressed in front of sforim/mezuzos? If the sforim are closed?

A. Mishna Berura (45: 5) rules that one should not stand undressed in front of tefilin or sifrei kodesh. In question 1396 in regards to getting undressed in a bedroom, we wrote: “Shulchan Aruch (Y.D. 286: 14) rules that it is preferable to place the mezuza of a bedroom on the frame on the outside of the door, the mezuza now being on the exterior of the room when the door is closed, thus avoiding issues of honoring the kedusha of the mezuza, including yours.
If it cannot be done, Horav Shlomo Miller’s Shlit’a opinion is that Hashem’s name on the mezuza case requires double covering, similar to the parchment inside. (See Agur Beohalecha 9:5, Shaarei Mezuza 18: 8). He added, that you may be lenient in need, if the name of Hashem is written or engraved vertically.
Cards and posters that have Hashem’s names or psukim, should also not be displayed in a bedroom.”
If the seforim are closed Horav Shlomo Miller’s Shlit’a opinion is that it remains prohibited until they are doubly covered.

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit’a