0

I would like to open image from rc.local. I am sure rc.local is getting called during boot as it execute/run test c++ code. I tried with various image viewer like gpicview , mirage. I can try with imagemagic but i don't think, image viewer is the problem. Something I am missing fundamental.

rc.local code:

cd /home/pi/test 
gpicview test.jpg
#mirage test.jpg #doesnt work so commented
exit (0)

How can resolve this issue? Any suggestion for further debugging?

  • Note : exit (0) is on next line some reason, copy past code didn't dispaly properly. – NoWorries Aug 17 '18 at 22:33
  • GPicView - A Simple and Fast Image Viewer for X - two things to ask. Is X running yet? would rc.local have access to it? If you want to run something when X starts, you need to use a different method (I'm sure there's plenty of information about how to start a program when X starts if you search) – Jaromanda X Aug 18 '18 at 1:13
  • thanks for comment, Let me have a read about 'X' starts sequence. How would i know , is X running? – NoWorries Aug 18 '18 at 16:32
  • 1
    You cannot start GUI stuff from rc.local, as explained here. Consider using LXDE autostart. – Dmitry Grigoryev Aug 20 '18 at 12:06
  • Thanks Dmitry, Looks like i found the answer. Let me try with LXDE autostart. I will update you tomorrow. Thanks a lot! – NoWorries Aug 20 '18 at 20:05
0

I hope this may be useful to someone: Finally mange to get image open from LXDE autostart. I wrote script call test.sh : cd /home/pi/test gpicview test.jpg

Next Step :This script to be executable with chmod +x test.sh

Then modified LXDE autostart script:

@/home/pi/test/test.sh
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@point-rpi

Reboot device.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.