Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a script after startx automatically [closed]

With my Raspberry Pi, I managed to login pi user automatically, then start tomcat automatically and then start X server as well.

For those interested, auto login:

1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1

instead of

1:2345:respawn:/sbin/getty 115200 tty1

in /etc/inittab

and

sh /home/pi/apache-tomcat-7.0.47/bin/startup.sh
su -l pi -c startx
exit 0

in /etc/rc.local

Now, I'd like to launch a java program (jar file) that I made, automatically after server X has started. How could I do that?

Thank you

UPDATE: On my Rapsberry, as LXDE is used, http://wiki.lxde.org/en/Autostart solved my problem.

like image 433
Romain Pellerin Avatar asked Nov 11 '13 22:11

Romain Pellerin


1 Answers

startx uses the ~HOME/.xinitrc file to load programs at the startup of X where ~HOME is the home directory of the user running X [ in this case pi]

see http://www.x.org/archive/X11R6.8.1/doc/startx.1.html for an example of .xinitrc

like image 118
WhyteWolf Avatar answered Nov 15 '22 05:11

WhyteWolf