HOWTO: Auto launch programs/scripts on LXDE startup
Purpose: Recently I started using LXDE and I really liked it. It is extremely light weight and it loads super fast and at the same time it is feature rich also compare to other similar desktop managers like Fluxbox. Once I installed LXDE, I wanted to auto launch a shell script as soon as I log into LXDE. In this post, we will learn exactly how to do that.
Step 1: Create a “.desktop” file”
From my limited experience so far, I have seen the the “.desktop” file are very important if you want to customize LXDE. Let’s say you want to execute a shell script as soon as you log into your LXDE desktop. Let’s assume the shell script is called “test.sh” and is stored at “/root/” directory.
Now create a file called “auto.desktop” with the following contents:
# nano /root/auto.desktop
File contents:
[Desktop Entry]
Encoding=UTF-8
Name= Connect
Comment=Checks internet connectivity
Exec=lxterminal --command "/root/test.sh"
Terminal=true
Step 2: Copy the file
Now we need to move the file, “auto.desktop”, in the following directory:
# cd /root/
# mv auto.desktop .config/autostart/
Basically any file that you would like to launch automatically during start-up, you need to create a “.desktop” file and copy that in the “.config/autostart/” directory in your home directory.
Step 3: Logout and Login
Now in order for to make the new settings effective, just logout from LXDE and log back in and you should see your shell script, “test.sh” getting executed.
That’s it!
Happy Auto-starting!


Email Subscription









September 11th, 2009 at 2:41 am
[...] In our last post on LXDE, we saw how to auto-start a script/program in LXDE as soon as the user logs in. Now in this post, we will learn how to place [...]
December 22nd, 2010 at 11:42 pm
There’s now a GUI – I can’t find it on the menu, but the command is lxsession-edit.
Reply to this comment
Julian Reply:
May 14th, 2011 at 7:40 am
Chris Watkins, on the LXDE i am running you get to “lxsession-edit” by clicking (main menu)/Preferences/Desktop Session Settings
Reply to this comment
Rahul Reply:
November 21st, 2011 at 3:15 am
Its cool as well. same apps.
Reply to this comment
June 6th, 2011 at 4:40 am
[...] am using LXDE, I will create a startup script using a .Desktop file like this guy did in his blog: http://linux.koolsolutions.com/2009/…-lxde-startup/ and is also described in [...]
November 21st, 2011 at 3:14 am
Thanks. for the solution, its cool.
However I found another solution.
In terminal write.(This tool doesn’t show up in lxde apps menu.)
$ gnome-session-properties
This will bring GNOMNE startup manager, but the only problem is u might need to install gnome-desktop to use this facilities. I am not sure.
Reply to this comment
November 27th, 2011 at 9:28 pm
Thank you
I’ve been looking this solution for a while
Reply to this comment
March 15th, 2012 at 4:40 pm
[...] Of these methods, only the xkb command works. To have the key remapped every session, I followed these instructions and created the file [...]