Creating a new .xinitrc file or edit an existing one? Which is best?

smooth_buddha

Active Member
Joined
Feb 13, 2020
Messages
362
Reaction score
246
Credits
1,648
I just recently indtalled Arch and ive seen 2 different ways to start a desktop enviroment from the .xinitrc file. Im currently using xfce4 for my desktop enviro.

The 2 methods:

1. Create a new .xinitrc file by touch comand and using nano edit it and type

Exec xfce4-session


2. Cp /etc/X11/xinit/.xinitrc /home/user

And edit this copy of the pre exisitng .xinitrc file by delting last fe lines and replacing with

Exec xfce4-session


Both methods seem to work but which is best?
 


Option 2 since you are doing it for your user it it's better to use your user's configuration files, if you were wanting several users to start a specific desktop environment it would be more logical to use the one for general use or to use a display manager.
1. pacman -S xorg-xinit
2. cp /etc/X11/xinit/xinitrc /home/user/.xinitrc
3. You can then remove these lines from /home/user/.xinitrc
Code:
twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
4. Add the desktop environment you want to start to the bottom of /home/user/.xinitrc
Code:
exec startxfce4
5. Add the following to your /home/user/.bashrc
Code:
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]
then
    startx
fi
 
Last edited:

Members online


Top