LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-22-2005, 03:41 PM   #1
gilan
LQ Newbie
 
Registered: Dec 2004
Posts: 13

Rep: Reputation: 0
Execute an application automatically after startx


Hi!

I'm using Debian with an xfce4 X windows and a "start X manager" gdm.... sorry for my english, I hope you understand what i want to mean. Well, after a few days I solve my first problem: How to auto-login a user at start xwindows.

Now, I want to automatically execute an application alter all xfce is set up. What's the very last script that is executed on start? Maybe thats the best place to set my "script".

Thanks!
 
Old 03-23-2005, 06:25 AM   #2
huibert.alblas
Member
 
Registered: Jan 2004
Location: Duesseldorf /Germany
Distribution: Gentoo amd64 / Debian
Posts: 226

Rep: Reputation: 30
The classic approach would be to but this into .xinitrc.
But modern Desktops use something else:
in your home directory there should be a folder "Desktop" and "Desktop/Autostart"

All scripts/symlinks in Desktop/Autostart should be automatcly executed when you log into Xfce / Gnome / Kde
 
Old 03-23-2005, 10:42 AM   #3
gilan
LQ Newbie
 
Registered: Dec 2004
Posts: 13

Original Poster
Rep: Reputation: 0
My desktop doesn't have the folder "Desktop", so the folder "Autostart".......

Well, I tried to make my xinitrc: ~HOME/.xinitrc, There inside I just type:
Code:
firefox
The firefox did execute perfectly but the Xwindows hang. Probably, surely, my "script" has something missing. Can somebody help me with an easy example of .xinitrc?

Thanks!
 
Old 03-24-2005, 09:52 AM   #4
huibert.alblas
Member
 
Registered: Jan 2004
Location: Duesseldorf /Germany
Distribution: Gentoo amd64 / Debian
Posts: 226

Rep: Reputation: 30
Yep, you should have written

Code:
firefox &
.xinitrc is executed, so you should "fork" programms you wan to run....
I think this is not obvious for most people, so the new aproach with the Desktop/Autostart dir is better.
 
Old 03-24-2005, 10:00 AM   #5
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Rep: Reputation: 30
What about .xsession? I was trying to do this a little while ago using wdm (not gdm) to set some environmental variables and found that it didn't work when I put them in .xinitrc, but it did work in .xsession. Hmm I dunno. Maybe I forgot to put #!/usr/bin/bash in the xinitrc one and not the xsession one, who knows.
 
Old 03-24-2005, 05:31 PM   #6
Josh222
LQ Newbie
 
Registered: Sep 2004
Posts: 4

Rep: Reputation: 0
Quote:
Originally posted by R00ts
What about .xsession? I was trying to do this a little while ago using wdm (not gdm) to set some environmental variables and found that it didn't work when I put them in .xinitrc, but it did work in .xsession. Hmm I dunno. Maybe I forgot to put #!/usr/bin/bash in the xinitrc one and not the xsession one, who knows.
Do you use a graphical login manager, or startx? .xinitrc is only used when you type startx.

As far as opening programs automatically when X is started, putting "exec some_app &" into .xinitrc will work, but for WM's like GNOME and XFCE that have "sessions", it's generally better to add those apps you want autostarted to your desktop environments session so that it is started that way. In GNOME, in the menu, go to sessions, and then then add the app there, in XFCE, just open it in XFCE, then log out and check the box to save the session. It will then automatically open the next time you start it.
 
Old 03-24-2005, 10:34 PM   #7
Lindlar
LQ Newbie
 
Registered: Dec 2004
Location: Jiangsu, China
Distribution: Debian unstable
Posts: 10

Rep: Reputation: 0
I think you can do this:
# cd /etc/X11/Xsession.d
# echo yourapp > 95yourapp_start

Then the application will automatically run after you login from gdm.
Could it work?

Last edited by Lindlar; 03-24-2005 at 10:35 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CRON Process Won't Execute Automatically Transition Linux - General 5 01-14-2005 03:51 PM
i need to write a program it has to execute automatically ykirankumar Linux - Software 5 08-31-2004 12:34 AM
execute php script automatically? brandnewbie Linux - Newbie 1 08-14-2004 05:42 AM
How can I execute an application automatically when a user loggs in? iancr Red Hat 3 12-10-2003 04:32 PM
How do I have X-apps automatically execute on startup of the X-server? jtX Slackware 13 08-07-2003 06:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 06:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration