You are not logged in.

#1 2014-03-31 10:16:03

jriz
Member
Registered: 2014-03-30
Posts: 22

question on xinit and startx[SOLVED]

In the last part of the last section of the xinitrc wikipage (for loading a de/wm using a command line option) after making  the modification to the rc files it states the execution command for the program as : xinit gnome or startx ~/.xinitrc gnome.I want to know why there has to be a ~/.bashrc argument for the startx command.

Edit:fixed .bashrc(replaced with xinitrc)

Last edited by jriz (2014-03-31 17:03:16)

Offline

#2 2014-03-31 10:24:59

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: question on xinit and startx[SOLVED]

Where did you see that?
There is no mention of .bashrc in the page https://wiki.archlinux.org/index.php/Xinitrc

Offline

#3 2014-03-31 11:05:33

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: question on xinit and startx[SOLVED]

It's ~/.xinitrc.

Short answer

startx sometimes modifies the arguments you give it before it passes them on to xinit, so you need to run it like that. You can also include ~/.xinitrc in the xinit examples and it will still work.

More detailed explanation

Both xinit and startx allow you to specify a program, but it has to start with a slash (/) or a period (.). Otherwise, the default client is executed and the arguments passed to xinit/startx are forwarded to this client. So you can run `xinit gnome` and "gnome" becomes $1 for ~/.xinitrc.

However, startx only uses ~/.xinitrc as the default client in case you do not specify any command line arguments like this (a comment in the script says this is "For compatibility reasons"). So `startx` will use ~/.xinitrc if it exists, otherwise (in particular when invoked as `startx gnome`), it will use "xterm $clientargs" as the client ("gnome" would end up in $clientargs).

But then, because "xterm gnome" doesn't start with a slash or period, xinit will run ~/.xinitrc and pass these arguments on, so "gnome" ends up in $2, because the first argument is "xterm".

To get around this weird behavior of startx, you can specify "~/.xinitrc gnome" as the client program. The shell will expand the  tilde to a full path (starting with a slash) so neither startx nor xinit will treat it in a special way.

Offline

#4 2014-03-31 14:05:24

jriz
Member
Registered: 2014-03-30
Posts: 22

Re: question on xinit and startx[SOLVED]

Thank you.One little thing: I didn't get where xterm came from in the second paragraph.

Last edited by jriz (2014-03-31 14:05:59)

Offline

#5 2014-03-31 14:55:57

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: question on xinit and startx[SOLVED]

jriz wrote:

Thank you.One little thing: I didn't get where xterm came from in the second paragraph.

That comes from the startx script. It uses xterm as the default client program instead of ~/.xinitrc if you pass any arguments.

Offline

#6 2014-03-31 14:57:50

jriz
Member
Registered: 2014-03-30
Posts: 22

Re: question on xinit and startx[SOLVED]

And one more question.how can i start kde via the command xinit without modifying .xinitrc.i've tried

# xinit /usr/bin/kde4 -- -nolisten tcp -br +bs -dpi 96 vt$XDG_VTNR
# xinit /usr/bin/kdeinit4 -- -nolisten tcp -br +bs -dpi 96 vt$XDG_VTNR
# startx /usr/bin/kdeinit4
# startx /usr/bin/kde4
# startx /usr/bin/kde

Last edited by jriz (2014-03-31 15:05:26)

Offline

#7 2014-03-31 15:05:16

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: question on xinit and startx[SOLVED]

See the example xinitrc in the wiki: the executable (in /usr/bin/) is called startkde.

Offline

#8 2014-03-31 15:07:19

jriz
Member
Registered: 2014-03-30
Posts: 22

Re: question on xinit and startx[SOLVED]

I also tried that.I don't have that file.and i installed the package group kdebase.shouldn't that suffice to launch it?

Offline

#9 2014-03-31 15:46:20

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: question on xinit and startx[SOLVED]

$ pkgfile startkde
extra/kdebase-workspace
$ pacman -Sg kdebase
kdebase kde-wallpapers
kdebase kdebase-dolphin
kdebase kdebase-kdepasswd
kdebase kdebase-kdialog
kdebase kdebase-keditbookmarks
kdebase kdebase-kfind
kdebase kdebase-konq-plugins
kdebase kdebase-konqueror
kdebase kdebase-konsole
kdebase kdebase-kwrite
kdebase kdebase-plasma

It's not in there and it doesn't appear to be a dependency of any of the packages in the group. So, no.

Offline

#10 2014-03-31 21:45:30

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: question on xinit and startx[SOLVED]

Offline

Board footer

Powered by FluxBB