title: Running a script after startx automatically
body: <p>With my Raspberry Pi, I managed to login pi user automatically, then start tomcat automatically and then start X server as well.</p>
  
  <p>For those interested,
  auto login:</p>
  
  <pre><code>1:2345:respawn:/bin/login -f pi tty1 &lt;/dev/tty1 &gt;/dev/tty1 2&gt;&amp;1
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>1:2345:respawn:/sbin/getty 115200 tty1
  </code></pre>
  
  <p>in /etc/inittab</p>
  
  <p>and </p>
  
  <pre><code>sh /home/pi/apache-tomcat-7.0.47/bin/startup.sh
  su -l pi -c startx
  exit 0
  </code></pre>
  
  <p>in /etc/rc.local</p>
  
  <p>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?</p>
  
  <p>Thank you</p>
  
  <p><strong>UPDATE:</strong>
  On my Rapsberry, as LXDE is used, <a href="http://wiki.lxde.org/en/Autostart">http://wiki.lxde.org/en/Autostart</a> solved my problem.</p>