My .xinitrc file doesn't get executed

Hello, I’m a newbie, so I’m very sorry if this question will be trivial but it bothers me.

So I had this problem even before i reinstalled Manjaro and I did it hoping that it will fix it, it didn’t.
My .xinitrc file is no read at all, This is newly installed system, I’ve put few programs there to see if they will be executed and they aren’t I tried putting it in the .xinitrc file in my home directory and in /etc/X11/xinit/xinitrc both don’t work. Here’s my .xinitrc file from /etc/X11/xinit

#!/bin/sh



# 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




exec spotify
#twm &
#xclock -geometry 50x50-1+1 &
#xterm -geometry 80x50+494+51 &
#xterm -geometry 80x20+494-0 &
#xterm -geometry 80x66+0+0 -name login

And here’s my .xinitrc file from home directory.

#!/bin/bash
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

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

DEFAULT_SESSION='i3 --shmlog-size 0'

# 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

exec spotify

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

get_session(){
	local dbus_args=(--sh-syntax --exit-with-session)
	case $1 in
		awesome) dbus_args+=(awesome) ;;
		bspwm) dbus_args+=(bspwm-session) ;;
		budgie) dbus_args+=(budgie-desktop) ;;
		cinnamon) dbus_args+=(cinnamon-session) ;;
		deepin) dbus_args+=(startdde) ;;
		enlightenment) dbus_args+=(enlightenment_start) ;;
		fluxbox) dbus_args+=(startfluxbox) ;;
		gnome) dbus_args+=(gnome-session) ;;
		i3|i3wm) dbus_args+=(i3 --shmlog-size 0) ;;
		jwm) dbus_args+=(jwm) ;;
		kde) dbus_args+=(startplasma-x11) ;;
		lxde) dbus_args+=(startlxde) ;;
		lxqt) dbus_args+=(lxqt-session) ;;
		mate) dbus_args+=(mate-session) ;;
		xfce) dbus_args+=(xfce4-session) ;;
		openbox) dbus_args+=(openbox-session) ;;
		*) dbus_args+=($DEFAULT_SESSION) ;;
	esac

	echo "dbus-launch ${dbus_args[*]}"
}


$(get_session "$1")

like I said, I’m a newbie so keep that in mind.

How do you (try to) start your i3 session?
No display manager is active and used?
How do you know that

?

I may not be able to help directly - I’m not too familiar, it’s bedtime and I can’t be back for ~ 20 hours at least.
But this info will likely help others to help you.

it’s not read because I tried putting “exec (program)” in it, I tried it with many programs and they don’t start. I also tried putting commands there like xinput set-prop '9' 'libinput Accel Speed' '-0.8' and it never works whatever i put there.

And about how I start i3… I have no idea.

… so you don’t know how to start your i3 window manager - but are sure that the files are not read?

That’s also important information to others trying to help - I’ll be gone now.

well, when I put something in my i3 config it gets executed, unlike .xinitrc.

There is a config for that. Must be that?

~/.config/i3/config

Starting a GUI application right before xorg has been started will not work.

So I can’t put gui applications in .xinitrc if I understood. right?

No, that is not what I am saying. I mean: order matters. And when you run only exec without a & at the end of the line, it will return 0, which means, that it stops executing.

exec spotify &

Anyway. Don’t modify the file in /etc. Keep your personal modifications in ~/.xinitrc. However, you use i3, therefore use the config of i3 to autostart programs. That is the best approach.

well… Okay, thanks.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.