0
votes

I'm trying to start Libreoffice impress automatically once my raspberry pi has started up.

I created:
.config/lxsession/LXDE/autostart

and added my presentation:
sudo libreoffice -show /home/pi/test.odp

When i execute the command in a terminal, all works fine. However the autostart doesn't seem to work at boot. Libreoffice starts, but then says it can't find the file...

1
I recommend you to ask your question there : raspberrypi.stackexchange.com . For a better visibility and better helplucasgehin
Check LXDE-Pi instead. There is several caveats to review in order to make the RPi an autostart device... I have the info, but not stored here. I lost it on a format, made accidentlly by some of the same programs provided by the PI.....Brethlosze

1 Answers

0
votes

The file .config/lxsession/LXDE/autostart is used to start applications without root privileges. Therefore, you should remove "sudo" from your code:

libreoffice -show /home/pi/test.odp

That should work as intended. If your presentation need root privileges (I don't see why it would, but anyway), you could use gksudo on your code, then at boot you would see a window asking for your password to proceed. The new code would look like this:

gksudo libreoffice -show /home/pi/test.odp

Important: please note you should not try to open a GUI enabled application with sudo or root privileges, as this can have bad consequences, such as modifying permissions and ownership on program files, which could lead to malfunctioning. If you really need to open a GUI application as root, always use gksudo or gksu.

On the other hand, if you really need to open a program at boot with root privileges, you should look into using the file /etc/rc.local or the cron service for that.