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]
Name= Connect
Comment=Checks internet connectivity
Exec=lxterminal --command "/root/test.sh"

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!

Be Sociable, Share!