Running a script after startx automatically

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.


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

链接地址: http://www.djcxy.com/p/75364.html

上一篇: 如何根据解释结果改进此查询

下一篇: 在startx后自动运行脚本