Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Autostart X based apps on bootup, without x/g/kdm
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
garion911
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jun 2002
Posts: 88

PostPosted: Thu Jun 02, 2005 12:11 am    Post subject: Autostart X based apps on bootup, without x/g/kdm Reply with quote

I have a couple machines that I use for specialize reasons.

Machine 1: Mythtv
Machine 2: Xterminal and mpd jukebox.

My problem initially started with machine 2.. I wanted to have an Xterminal, and I was using LTSP to get it. But eventaully, since this Xterminal is near my "good" stereo anyways, I wanted to use it as an mpd jukebox also. So I installed linux on the machine, and tried to get it to do both.

It seems that Gentoo is not really designed to be an Xterminal.. I tried setting up xdm with a modified Xservers to have "X --indirect xdmhost", but that gave me my selection, AND a login..

Eventaully I came to the conclusion that I can not have XDM running at all.

So. How to achieve this? Firstly, I tried just adding the X --indirect xdmhost" to the /etc/conf.d/local.start. That worked initially, except when you exited your login.

What I ended up doing was creating a script with the following code:

Code:

#!/bin/bash

while true; do
        X -indirect xdmhost
done


and save it as /sbin/Xstart

then at the end of /etc/conf.d/local.start:

Code:

/sbin/Xstart &


Dont forget the &, otherwise you may not get a login prompt on the main console...

This allows X to restart when you exit your Xterminal login.


This also closely ties into my MythTV setup.

In my mythtv setup, I have it setup similarly to the various guides in the forum and Gentoo Wiki.. I have a mythtv user that actaully runs the frontend when it logs in. The .xinitrc for my mythtv user looks like this:

Code:

exec mythfrontend


And the Xstart looks like this:

Code:

#!/bin/bash

while true; do
        sudo -u mythtv -H startx
done


To get the sudo, you need to emerge app-admin/sudo.. The -u sets the user to run as. Since this gets run as root, it won't need any password. ***SECURITY RISK***.. The -H tells sudo to use the $HOME from /etc/passwd. Otherwise it would use root's $HOME. "startx" starts the X server, running the .xinitrc along the way.

This also helps with the problem of the person using mythtv who hits buttons too fast, and exits from Mythtv, usually leaving it at the X, windowmanager, or xdm login screen... With these changes, Mythtv will actaully restart, eliminating the "THE TV IS BROKEN" phone call from the wife, when she want to watch her CSI from last night...*sigh*

Hope this proves useful to folks.

--Garion
Back to top
View user's profile Send private message
papal_authority
Veteran
Veteran


Joined: 31 Mar 2004
Posts: 1823
Location: Canada

PostPosted: Thu Jun 02, 2005 1:43 pm    Post subject: Reply with quote

Couldn't you just use kdm with the autologin feature? Then have the user account that you chose to autologin, run the specific apps? Sorry if I'm missing something...
_________________
The free market gave me gonorrhea.
Back to top
View user's profile Send private message
garion911
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jun 2002
Posts: 88

PostPosted: Thu Jun 02, 2005 2:19 pm    Post subject: Reply with quote

You could yes.. I actaully did it originally with GDM... But why waste the space, memory, maintenance, and time for having kdelibs, kdebase installed? It makes for a more specialized machine..

Plus, it would not have solved my Xterminal problem.
Back to top
View user's profile Send private message
Tatey
n00b
n00b


Joined: 18 Apr 2004
Posts: 37
Location: Brisbane, Australia

PostPosted: Tue Mar 14, 2006 2:40 am    Post subject: Reply with quote

Thanks, this script worked like a charm :)
_________________
[ visit my website, tatey.com ]
Back to top
View user's profile Send private message
lysergicacid
Guru
Guru


Joined: 25 Nov 2003
Posts: 352
Location: The Universe,Virgo Super Cluster,Milky Way,Earth

PostPosted: Thu Apr 27, 2006 3:51 am    Post subject: autologin.c Reply with quote

theres also this : http://peeweelinux.com/list-archive/peeweelinux/2004-January/001231.html if u google autologin.c u find this too & u can just start ur wm / mythtv via a simple bash script u can create and run it from the user who is automatically logged in's bash_profile why run anything in x as root if u dont have to ?
_________________
[img]http://valid.canardpc.com/cache/banner/2040927.png[/img]
Desktop:
[img]http://valid.canardpc.com/cache/banner/2703952.png[/img]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum