Arch Linux startx on login

6,525

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:
6,525

Related videos on Youtube

Sindre Bjørnhjell
Author by

Sindre Bjørnhjell

Updated on September 18, 2022

Comments

  • Sindre Bjørnhjell
    Sindre Bjørnhjell over 1 year

    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?