Is `.xinitrc` used anymore?

I’m updating an old openSUSE-based kiosk, which launches various background apps and then launches a browser window to view a captive site. The kiosk originally used openSUSE 12.3, and I’m updating it to 15.5 (not the latest, for various reasons). I’m doing as much as possible on the command line, for reproduceability and documentability.

Originally, the default user’s $HOME had an .xinitrc which launched everything. This no longer works, though; ~/.xinitrc isn’t being run at all. I even tried adding a touch /tmp/iWasHere.txt to /etc/X11/xdm/sys.xsession, but that wasn’t being run either.

Searching for answers, there’s lots of old doc on .xinitrc, including one hint that I need to install xorg-xinit (which I haven’t, as I can’t find doc on what the package does).

<rant>
I tried setting things up with systemd, but after about a week of wasted time I threw in the towel. Mysterious, magical, and confusing. Good documentation on the leaves, but nothing on the forest, if you know what I mean. For example, if the documentation were comprehensive there would be no need for blog posts such as Difference between PartOf and BindsTo in a systemd unit .
</rant>

Is .xinitrc still used? If so, how do I enable it? If not, what’s a good way to configure a GUI on startup from the command line?

I was a bit curious reading this and thus did a bit of browsing through the man pages. That confirms in my opinion that .xinitrc is a configuration file (indeed there is a sort of convention to call configuration files used at the startup of a program with the name of the program and the characters rc added at the end).

So to me it is not about .xinitrc “not doing” anything, but it is about: is xinit running, or better, is it started at any moment in time. No xinit started, then no .xinitrc interpreted.

Sounds right to me, but that begs the question: how is xinit started on boot? Must I install some package (perhaps xorg-xinit?), or is there a flag to be enabled?

Or, is there a better (non-systemd) way to start a GUI on boot?

I assume (but your set-up seems to be a bit out of fashion), that it was done in a SysVinit way. Try to find out the appropriate start/stop files (/etc/init.d and rcn.d files if I remember correctly). Then people here can try to help you in converting them into a systemd service,

Yes, that is one of the problems when you do not stay up-to date. Other people forget how it worked long ago. And when you then need help …

It should be as long as your X11 session startup is using /etc/X11/xdm/Xsession. I just tested on Leap 15.6 with lightdm as Display Manager in default configuration and ~/.xinitrc is invoked.

The ~/.xinitrc file in your home directory is executed by the command startx. In general, it is used to start your Desktop Environment.

https://wiki.archlinux.org/title/Xinit

File .xinitrc.template is available in home folder.

Install xinit package - available in Main repo.

https://manpages.opensuse.org/Tumbleweed/xinit/startx.1.en.html

https://manpages.opensuse.org/Tumbleweed/xinit/xinit.1.en.html

Well, now I’m really confused. My copy of openSUSE 15.5 has a fully functioning desktop system (which I know very little about, although I did choose GNOME when I installed openSUSE). Would installing xinit replace whatever system I’m currently using, or augment it? Or, is there some FM that I could R that would explain my current graphical stack, and how to auto-start a browser within it?

Would autostarting a browser via XDG Autostart be sufficient for your use case?
https://wiki.archlinux.org/title/XDG_Autostart

That would do for the browser, but I’d need a number of other command-line applications running beforehand.

Which displaymanager is in use here?

This might be of relevance to you…
https://wiki.archlinux.org/title/Xprofile

I added a ~/.xprofile file, but it, too, isn’t being executed on boot.

I thought everyone would know what X11 tools an openSUSE 15.5 system uses, but I was wrong. I’m using the GNOME GUI; how do I tell which display server and window manager I’m using?

I just realized; generally ~/.xprofile is run by ~/.xinit, and since my ~/.xinit isn’t being run, ~/.xprofile isn’t being run either.

As some people like to reiterate, “Linux is about choice”. So no, we do not know what X11 tools your installation of openSUSE 15.5 sysem uses. I just tested 15.5 with lightdm and ~/.xinitrc is respected and used.

Well, I used the standard openSUSE installer, and the only choice I was given was KDE vs GNOME (I chose the latter).

More research shows that the standard openSUSE 15.5 uses Mutter (Wayland). I’ll keep researching my problem based on that.

Thanks for the help,
Dan

And, the final solution: add a /home/devuser/.config/autostart/myapp.desktop file:

[Desktop Entry]
Type=Application
TryExec=/home/devuser/myapp.sh
Exec=/home/devuser/myapp.sh

If ~/myapp.sh exists, then this runs ~/myapp.sh as user devuser, which means I’ll have to play sudo games, but No Big Deal.

Thanks,
Dan

Did you try switching to using LightDM as was mentioned above? (It has nothing to do with the desktop environment you are using.)
https://en.opensuse.org/SDB:Change_Display_Manager

I think the *.desktop solution will work just fine; no need to change horses.