Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to start my window manager when I log in with a spesiific user, but stay in the console if I log in as root. So I want the startup to be as it is, but at the login prompt, if I choose my user, it automaticly runs '$ startx' basicly, while if I log in as root, nothing happens. Is this at all possible?

share|improve this question
up vote 1 down vote accepted

While I'd just use a display manager (I use LXDM set to automatically login to my user) and switch to the console when I need to be root, you might want to try this (from the Arch wiki):

For Bash, add the following to the bottom of ~/.bash_profile. If the file does not exist, copy a skeleton version from /etc/skel/.bash_profile

For Zsh, add it to ~/.zprofile instead.

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.