You are not logged in.

#1 2011-08-30 12:03:57

cra
Member
From: Sweden
Registered: 2009-09-25
Posts: 70

[SOLVED] I'd like to autostart X when I log in on concrete tty

Hi all.

Supposing I use a marginal ortodox weird window manager (notion - ion3 fork) and a relatively weird keyboard layout. Furthermore, when I'm using my laptop, sometimes I don't launch X, so I start X manually most of the time. What I want is X autostarted in background with gdm and fancy stuff for login (and a qwerty-layout) to allow someone else to use my computer if necessary.
I also would like that when I loggin' in on tty4(or any other concrete virtula terminal) there would be another X server with my .xinitrc (not related to the one already started).

Okay, let's drop that stuff with different keyboard layouts, I figured out I can just dump my scheme in xmodmap and load it in .xinitrc, so that part of the problem is solved. I also can figure out how to start multiple X servers. What I really unable to do is determine what is my current tty (although that looks to be really simple). Is there any other ways aside from grepping who's pipe output?

I stumbled upon this concrete blog post (in russian) http://iportnov.blogspot.com/2007/01/su … ck_31.html that covers the idea of multiuser computer usage. There is a snippet of bash code, that doesn't work for me.

case "$(basename `tty`)@$HOST" in
 tty4@portnov) runx
               logout ;;
esac

Any ideas?

// also, shouldn't this post will be better placed in "try this" subforum?

Last edited by cra (2011-09-02 12:10:11)


Thou shalt not make a machine in the likeness of a human mind

Offline

#2 2011-08-30 12:51:54

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [SOLVED] I'd like to autostart X when I log in on concrete tty

cra wrote:

// also, shouldn't this post will be better placed in "try this" subforum?

Not really, but it will probably fit better in "Applications & Desktop Environments ".
Moving there.


To know or not to know ...
... the questions remain forever.

Offline

#3 2011-08-30 17:05:21

laloch
Member
Registered: 2010-02-04
Posts: 186

Re: [SOLVED] I'd like to autostart X when I log in on concrete tty

I guess that simple

[[ $(basename `tty`) == "tty4" ]] && startx -- :104 && logout

at the very end of your ~/.bashrc should do the trick.

Edit: ...or better at the end of ~/.bash_profile to affect only login shells.

Last edited by laloch (2011-08-30 17:37:22)

Offline

#4 2011-09-02 12:09:53

cra
Member
From: Sweden
Registered: 2009-09-25
Posts: 70

Re: [SOLVED] I'd like to autostart X when I log in on concrete tty

Yup, thanks.

Little correction:
[[ $(basename `tty`) == "4" ]] && setsid start x -- :1; exit


Thou shalt not make a machine in the likeness of a human mind

Offline

#5 2011-09-02 12:26:44

laloch
Member
Registered: 2010-02-04
Posts: 186

Re: [SOLVED] I'd like to autostart X when I log in on concrete tty

cra wrote:

Little correction:
[[ $(basename `tty`) == "4" ]] && setsid start x -- :1; exit

For me tty returns "/dev/tty4", so the $(basename `tty`) = "tty4" is correct.

Offline

Board footer

Powered by FluxBB