You are not logged in.

#1 2020-07-06 20:10:45

dj pixus
Member
Registered: 2019-04-09
Posts: 10

[SOLVED] Xinit starts an xterm, no matter how it's started.

Hi!
I am experimenting with an old PC and Arch, trying to get Xorg work the most simple way possible. There is no xinitrc or anything like that, I just use the following command as a normal user:

xinit openbox -- vt1

The xserver starts, Openbox works fine, but there is also an xterm window in which looks like Openbox puts output.

xinit bash -- vt1

This command makes an xterm window with bash running inside. So basically xinit runs the given command inside xterm.
The question is simple: How to make it run the program directly?

Last edited by dj pixus (2020-07-08 17:51:26)

Offline

#2 2020-07-06 20:21:54

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

Re: [SOLVED] Xinit starts an xterm, no matter how it's started.

I just tested and confirmed that without an ~/.xinitrc xinit does indeed try to start an xterm even when a WM or client program is given on the command line.  This looks like a bug as this is not the documented behavior.

However, it's also very easy to avoid the problem: create an ~/.xinitrc.

I just confirmed, this is in the code for xinit: on line 168 of xinit.c the default client of xterm is used unless the first command line parameter starts with either a '/' or a '.', so "xinit /usr/bin/openbox" should get the result you intended.  I believe this is new behavior since the last time I used xinit - I'll confirm shortly. edit: it would seem this has been around for at least 10 years, though it's particularly odd as the client specified is called via execvp which does path lookup - so a full/relative pathname should not be required.  Oh well, one more batshit crazy bit of xinit's code.

EDIT: oops!  It is in the man page:

man xinit wrote:

Both the client program name and the server program name must begin with a slash (/) or a period (.).  Otherwise, they are treated as an arguments to be appended to their respective startup lines.

The code still is crazy.

Last edited by Trilby (2020-07-07 03:10:36)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2020-07-08 09:33:42

dj pixus
Member
Registered: 2019-04-09
Posts: 10

Re: [SOLVED] Xinit starts an xterm, no matter how it's started.

Oh, I see. I remember that I read something about the program name must start with a /. I first tried it with a full screen application which worked perfectly so I considered the full path unnecessary. Without a WM I didn't see the xterm window cause it was hiding behind the specified one.
Anyways, specifying the full path solved the issue. Thank You!

Offline

#4 2020-07-08 11:49:31

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

Re: [SOLVED] Xinit starts an xterm, no matter how it's started.

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

Offline

Board footer

Powered by FluxBB