Autostart a program after X starts


#1

I usually post answers, but today I am going to ask a question.

I have a shell script that I can run after the system starts. I have stored the script in the Desktop directory, and it shows up as an icon on the desktop, when I double click the icon, it starts the script and my system runs the programs I want run as user linaro. Now here is where I am stuck, I want the script to ‘automatically’ start up when the system starts up. I tried the obvious by placing the path of the script into places like ~/.xinitrc or ~/.xstart but the program doesn’t get started.

Which file do I change to run a script after everything else has started up?

Full Disclosure: I am an employee of Qualcomm Canada. Any opinions I may have expressed in this post or any other post may not reflect the opinions of my employer.


#2

Hi Lawrence,

When I have a script like this I normally put it in crontab and specify I want it to start on reboot.
To edit crontab use:
crontab -e

Then in the crontab put:
@reboot /path/to/my/script/file

Regards,
Barry


#3

Hey Laurence!

I think you’ll probably need to create a .desktop file to describe your
"application" and put it in the appropriate place:
https://www.freedesktop.org/wiki/Software/desktop-file-utils/

Once you have that installed the autostart technique varies between the
various DEs but for lxqt (default in our latest debian images) try:
https://wiki.archlinux.org/index.php/LXQt#Autostarting_applications