TouchSelfie-extended icon indicating copy to clipboard operation
TouchSelfie-extended copied to clipboard

Launch TouchSelfie at boot

Open laurentalacoque opened this issue 6 years ago • 8 comments

Although it's possible to launch TouchSelfie in rc.local or in the X server startup scripts, many services won't be ready and TouchSelfie will die on an unexpected error

For example, the piCamera module will fail until a few seconds after X server has started.

We should therefore add a loop to try/except/sleep predictable errors and retry for a given period of time

laurentalacoque avatar Feb 17 '19 09:02 laurentalacoque

note:

Simply trying / except doesn't seem to work The only solution so far : writing an autostart.sh script that does

#!/bin/sh
env sleep 10
/path/to/touchselfie/touchselfie.sh

Then add this line to ~/.config/lxsessions/autostart

@/path/to/autostart/autostart.sh

This way, TouchSelfie gets launched 10 seconds after Xserver has started (needed, otherwise picamera fails)

todo

Write an autostart.sh script that launches photobooth.sh every 2 seconds until it works OR detects that Xserver has fully started

laurentalacoque avatar Feb 17 '19 17:02 laurentalacoque

Suggest you add TouchSelfie to main menu and launch from touchscreen.

wyojustin avatar Feb 18 '19 20:02 wyojustin

@wyojustin hey ;)

Already did :) I'm looking for a fully resilient solution though. Ideally, the photobooth should start on power-up without user action: this is more convenient whenever I lend it or rent it!

laurentalacoque avatar Feb 23 '19 09:02 laurentalacoque

I tried this solution but there is no "~/config/lxsessions/autostart" anymore?!

wearebeta avatar Apr 27 '19 14:04 wearebeta

If your pi won't boot, it's probably best to start with a clean install.

On Sat, Apr 27, 2019, 8:23 AM wearebeta [email protected] wrote:

I tried this solution but there is no "~/config/lxsessions/autostart" anymore?!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/laurentalacoque/TouchSelfie-extended/issues/67#issuecomment-487290198, or mute the thread https://github.com/notifications/unsubscribe-auth/AAG5AW2TDF3S3WWLX3PXRSTPSROXDANCNFSM4GX53SPA .

wyojustin avatar Apr 27 '19 14:04 wyojustin

@wearebeta I think it's ‘.config‘ with a dot!

laurentalacoque avatar Apr 27 '19 19:04 laurentalacoque

I think, I found the solution: https://gomilkyway.com/linux/how-to-run-a-command-at-the-start-of-raspbian-stretch/

"How to run a command at the start of raspbian stretch Posted on February 22, 2019 To run a command at the start of raspbian stretch the newest raspbian on rasbperry 3+ for instance. you no longer use ~/.config/lxsession autostart. it is now in /etc/xdg/lxsession/LXDE-pi/autostart because raspbian now uses P.I.X.E.L."

wearebeta avatar Apr 30 '19 13:04 wearebeta

Otherwise, you can create a shortcut onto the desktop. To do so, create a .desktop file and copy/paste this script (adapting the path to your personal configuration) :

[Desktop Entry]Type=Application Name=TouchSelfie Comment=PhotoBooth Exec=sudo /home/pi/TouchSelfie/photobooth.sh Icon=face-smile-big Terminal=false Categories=Application

mattx38 avatar Apr 09 '20 07:04 mattx38