humpty > promotes Linux  > Lubuntu Tips

Lubuntu linux Tips
 
How to autostart X apps



LXDE provides an easy way to auto run an x-windows program. You will need to do this if the app requires that x-windows be already up and running before the app starts. (many other start-up places do not wait for X to startup, so the app will fail).

Simple

To execute something everytime you login, just after x-window starts;

1. Create a shortcut called MyStarts.Desktop inside /home/<user>/.config/autostart

>cd ~/.config/autostart
>leafpad MyStarts.desktop

and add these lines;

[Desktop Entry]
Type=Application
Name=MyStarts
Comment=my commands after X startup
Exec=mystarts.sh

2. Create a mystarts.sh script inside your home directory, and put in any commands you wish to execute;

>cd ~
>leafpad .xstartup

e.g, run a mouse script;

$HOME/fixmouse.sh


touch $HOME/_MSG_mystarts_done


Note that "touch $HOME/_MSG_mystarts_done" will create an empty msg file each time. You can look at it's time stamp to check when mystarts.sh was run (ls -l).

Now, everytime X is started, mystarts.sh will be run !


End.


Notes :
In Lubuntu 12.04, ~/.config/autostart will run after lxsession ( /home/<user>/.config/lxsession/Lubuntu/desktop.conf ), this means it will override the affects of lxsession.
However, this might not be true for your linux distro.

More Lubuntu Tips