You are not logged in.

#1 2020-11-05 22:03:35

Celsiuss
Member
Registered: 2020-11-05
Posts: 28

[Solved] startx is not start running .xinitrc

I have a .xinitrc file located at ~/.xinitrc, with the following contents:

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then







    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then







    xrdb -merge "$userresources"

fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

/usr/bin/i3 &
#xclock -geometry 50x50-1+1 &
#xterm -geometry 80x50+494+51 &
#xterm -geometry 80x20+494-0 &
#exec xterm -geometry 80x66+0+0 -name login

When I run startx (as the same user which the file is located in), x just exits without any erros., when I want it to start i3. It starts fine with startx /usr/bin/i3.

Last edited by Celsiuss (2020-11-05 22:16:44)

Offline

#2 2020-11-05 22:06:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,512
Website

Re: [Solved] startx is not start running .xinitrc

The problem is that it is running that xinitrc - and the xinitrc is broken.  X exits successfully as it has completed everything you asked it to do.  Do not background your window manager.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2020-11-05 22:16:31

Celsiuss
Member
Registered: 2020-11-05
Posts: 28

Re: [Solved] startx is not start running .xinitrc

Haha, thank you!
Then may I ask why the default configuration file (/etc/X11/xinit/xinitrc) has the line 'twm &' ?

Offline

#4 2020-11-05 22:55:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,512
Website

Re: [Solved] startx is not start running .xinitrc

The default xinitrc is controlled by an xterm instance which is not backgrounded.  When that xterm exits, X shuts down.

Technically you can background a window manager, but you need some primary process that runs in the foreground from xinitrc.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2020-11-05 22:59:00

Celsiuss
Member
Registered: 2020-11-05
Posts: 28

Re: [Solved] startx is not start running .xinitrc

Trilby wrote:

The default xinitrc is controlled by an xterm instance which is not backgrounded.  When that xterm exits, X shuts down.

Technically you can background a window manager, but you need some primary process that runs in the foreground from xinitrc.

Oh well that makes sense. Thank you again!

Offline

Board footer

Powered by FluxBB