LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   Execute an application automatically after startx (http://www.linuxquestions.org/questions/debian-26/execute-an-application-automatically-after-startx-304818/)

gilan 03-22-2005 03:41 PM

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!

huibert.alblas 03-23-2005 06:25 AM

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

gilan 03-23-2005 10:42 AM

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!

huibert.alblas 03-24-2005 09:52 AM

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.

R00ts 03-24-2005 10:00 AM

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. :Pengy:

Josh222 03-24-2005 05:31 PM

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. :Pengy:
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.

Lindlar 03-24-2005 10:34 PM

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?


All times are GMT -5. The time now is 01:06 AM.