From 566ea9a1106fc7e18a670ad57f3e93f28895c015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Tue, 24 Jan 2017 02:12:36 -0300 Subject: [PATCH] Use script for start MagicMirror --- CHANGELOG.md | 1 + package.json | 2 +- run-start.sh | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 run-start.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d4563d3..795bce1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Option to use RegExp in Calendar's titleReplace. - Hungarian Translation. - Icelandic Translation. +- Add use a script to prevent when is run by SSH session set DISPLAY enviroment. ### Fixed - Update .gitignore to not ignore default modules folder. diff --git a/package.json b/package.json index 4cff0689..9d94a012 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "A modular interface for smart mirrors.", "main": "js/electron.js", "scripts": { - "start": "electron js/electron.js", + "start": "sh run-start.sh", "postinstall": "sh installers/postinstall/postinstall.sh", "test": "./node_modules/mocha/bin/mocha tests --recursive" }, diff --git a/run-start.sh b/run-start.sh new file mode 100644 index 00000000..6c4d4003 --- /dev/null +++ b/run-start.sh @@ -0,0 +1,4 @@ +if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty + export DISPLAY=:0 # Set by defaul display +fi +electron js/electron.js