And so we say in Shabbat (62b): One who urinates naked before his bed comes to poverty, for the demon of poverty is named Naval, and in every place where he finds a soiled place and one without cleanliness, he dwells there. And specifically when he turns his face toward the bed, but if he turns his face outward - we have no concern with it, for the stream goes outward. And specifically when he urinates on the ground, but when he urinates into a vessel - we have no concern with it. And a talmid chakham must invert a vessel over it or urinate into the vessel, so that it will be permitted to meditate on words of Torah, for it is impossible for a talmid chakham to be without meditation on Torah. (And they wrote that one who trims his nails in order also comes to poverty, and they wrote this in the name of the Abudraham and in the name of the sages of France and Provence, cited in the Atteret Zekenim).
והכי אמרינן בשבת (ס"ב:): דהמשתין מים ערום לפני מטתו בא לידי עניות, דשרא דעניותא נבל שמיה, ובכל מקום שמוצא מקום מטונף ושלא בנקיות שורה שם. ודווקא כשמחזיר פניו להמטה, אבל אם מחזיר פניו לחוץ - לית לן בה, דהקילוח יוצא לחוץ. ודווקא כשמשתין על הארץ, אבל כשמשתין בכלי - לית לן בה. ותלמיד חכם צריך שיכפה עליו כלי או שיטיל מים בהכלי, שיהא מותר להרהר בדברי תורה, שאי אפשר לו לתלמיד חכם בלא הרהור תורה. (וכתבו שהנוטל צפרניו כסדר גם כן בא לידי עניות, וכתבו זה בשם אבודרהם ובשם חכמי צרפת ופרובינצא, הובא בעטרת זקנים).