outpaddling / desktop-installer

Quickly configure a FreeBSD or NetBSD desktop system
BSD 2-Clause "Simplified" License
57 stars 9 forks source link

X11 Reconfiguration is for the root user #18

Closed yzgyyang closed 3 years ago

yzgyyang commented 3 years ago

Hi Jason,

During the "Reconfigure X11 and desktop?" step, the script seems to be setting the configuration up for root under /root/.xinitrc even if I am under a normal user running with sudo desktop-installer. Can we use something like ${SUDO_USER} to get the real user?

I was testing a KDE5 installation in a Virtualbox VM if it helps. Thanks!

outpaddling commented 3 years ago

I'm not sure this will work reliably due to possible xauth issues running under su + I would want to be consistent about where the .xinitrc is written. I'd be more inclined to add a check to warn users about running under su or sudo. I think for desktop-installer it's best to log in directly as root, which of course should be avoided once the system is fully configured.

outpaddling commented 3 years ago

Added a warning if running under su or sudo, advising the user to run under a direct root login on a text console.

yzgyyang commented 3 years ago

Thanks! A warning is good enough (as I didn't know root is preferred over sudo) ;)