You are not logged in.

#1 2022-02-16 19:20:40

Freder
Member
Registered: 2021-07-17
Posts: 10

[SOLVED] xinitrc not executing

Hi,
The other day I made a Xmodmap configuration for my system and when I rebooted I found out that it wasn't applying automatically even though it is specified in the .xinitrc in my home directory.
Yes, I triple checked that it is executable.
I tried to touch some files in the .xinitrc to see if they would get created after I login, but nothing.

The xinit man page says:

If no specific client program is given on the command line, xinit will look for
a file in the user's home directory called .xinitrc to run as a shell script to
start up client programs.

It says "if no specific client program is given on the command line". But I don't really have control on that because it is my display manager that runs xinit (or at least from what I understand).

I use ly as my display manager.

Last edited by Freder (2022-02-18 15:52:37)

Offline

#2 2022-02-16 19:21:49

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,292

Re: [SOLVED] xinitrc not executing

Generally display managers don't execute your .xinitrc but your .xprofile instead, so try to add the relevant command there. https://wiki.archlinux.org/title/Xprofile

Last edited by V1del (2022-02-16 19:22:23)

Offline

#3 2022-02-16 19:23:03

Freder
Member
Registered: 2021-07-17
Posts: 10

Re: [SOLVED] xinitrc not executing

My .xinitrc, which is almost the same as the default one.

#!/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

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

Offline

#4 2022-02-16 19:29:52

Freder
Member
Registered: 2021-07-17
Posts: 10

Re: [SOLVED] xinitrc not executing

V1del wrote:

Generally display managers don't execute your .xinitrc but your .xprofile instead, so try to add the relevant command there. https://wiki.archlinux.org/title/Xprofile

Wow you replied so fast!
Just tried and .xprofile works perfectly, thanks a lot!

Offline

#5 2022-02-16 23:48:54

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: [SOLVED] xinitrc not executing

Please remember to mark your thread [SOLVED] (edit the title of your first post).

Offline

Board footer

Powered by FluxBB