Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start the mirror on startup #109

Closed
kurtdb opened this issue Feb 22, 2016 · 10 comments
Closed

Start the mirror on startup #109

kurtdb opened this issue Feb 22, 2016 · 10 comments
Assignees

Comments

@kurtdb
Copy link
Collaborator

kurtdb commented Feb 22, 2016

We get more and more questions from people who want to run the mirror on startup. There have been a few people that have already done this, so it might be a good idea to document this in the readme.

Maybe someone can pick this up?

@Shubham0209
Copy link

@kurtdb i had saved the following comments from chat..

If anyone wants the mirror to autostart you can create the following script in the root of your users home :
/home/pi/smart-start.sh

!/bin/bash

export DISPLAY=:0

export XAUTHORITY=/home/pi/.Xauthority

cd /home/pi/smart-mirror && npm start

Afterwards, add this line to the bottom of ~/.config/lxsession/LXDE-pi/autostart

/home/pi/smart-start.sh &

This is better than using .bashrc because it is only executed when the lxSession starts - bashrc gets executed every time a bash session runs.


yeah i have mine on autoboot
theres a number of ways like
cd ~

cd smart-mirror

nano start.sh

export DISPLAY=:0

export XAUTHORITY=/home/pi/.Xauthority

cd /home/pi/smart-mirror && npm start

chmod a+rwx start.sh

and then put "/home/pi/smart-mirror/start.sh &" in the bash.rc file

@Shubham0209
Copy link

@kurtdb
Copy link
Collaborator Author

kurtdb commented Feb 22, 2016

Thanks a ton for the comment. You're a lifesaver. :)

@Shubham0209
Copy link

Pleasure absloutely mine.. 😄

@capfirepants
Copy link

HOW TO START THE SMART-MIRROR ON BOOT.
In /home/pi/, create the file called smart-start.sh with the following content:

#!/bin/bash
export DISPLAY=:0
export XAUTHORITY=/home/pi/.Xauthority
cd /home/pi/smart-mirror && npm start

Make the file owned by the user pi
chown pi:pi /home/pi/smart-start.sh
And make it executable
chmod +x /home/pi/smart-start.sh
Then, edit the file /home/pi/.config/lxsession/LXDE-pi/autostart
and add the following line to the end:
/home/pi/smart-start.sh &
Reboot the Pi and you should be good to go

@gothmate
Copy link

Thanks a lot for the comments. I was lookin' up for it.

@SimonSaid00
Copy link

Hello there! First of all I would like to say Evan that you did a great job with this project.
Second for all- I am trying to follow Evan's start up program but it doesn't work. Does this have something to do with how my Pi is booting up ? Currently it is set to login automatically as user "Pi" and that's about it. How is yours setup in order for these to work? Thanks a lot!

@evancohen
Copy link
Owner

@SimonSaid00 Thanks :)
Have you tried what @capfirepants has suggested above? That has worked for everyone so far.

If you have trouble jump into the gitter chat.

@SimonSaid00
Copy link

Hi Evan! I did not since I wasn't sure WHERE to put the "chown pi:pi /home/pi/smart-start.sh". I am not a coder :)

Thanks for the reply!

@SimonSaid00
Copy link

It has been done, thank you, it works :)

evancohen added a commit that referenced this issue Jul 7, 2016
@evancohen evancohen self-assigned this Jul 7, 2016
TheFunkyMonk pushed a commit to TheFunkyMonk/smart-mirror that referenced this issue Aug 7, 2016
* upstream/master: (64 commits)
  removing dupe fixes evancohen#363
  Removing PulseAudio
  version bump
  Fixed issue with an individual stock quote not rendering. (evancohen#357)
  Performance improvements (evancohen#352)
  Updated the stock information to the yahoo yql service. (evancohen#354)
  Added scrobbler support. (evancohen#346)
  [CALENDAR] Polish day/multi-day formatting. (evancohen#347)
  reverting evancohen#311 because of IPC issues
  Switching to use Dependency CI
  Made descriptions consistent, changed some wording or localizations
  Added localization and made use of ng-show to hide fitbit data when not present
  Attempt to improve the RSS functionality.
  checking in bash boot script fixes evancohen#109 (evancohen#339)
  simplifying example config
  resolving conflicts and preparing for merge
  experamental on-device model trainer (evancohen#330)
  Add the stock-ticker information on screen. (evancohen#331)
  Fixed the discontinued google feed api as defined in evancohen#332.
  fixing calendar issue for days 7+ out
  ...

# Conflicts:
#	css/main.css
#	index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants