From fcc0e5813efd4f091878c54e7a505f88c7705331 Mon Sep 17 00:00:00 2001 From: leukipp Date: Sun, 23 Feb 2025 13:36:46 +0100 Subject: [PATCH] feat: check for DISPLAY variable #12 --- index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.js b/index.js index 8476c09..d92fddc 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,14 @@ const { app } = require("electron"); global.ARGS = global.ARGS || {}; +if (!process.env.DISPLAY) { + console.error(`$DISPLAY variable not set to run the GUI application, are you connected via SSH?`); + console.error(`If you have installed the service use:`); + console.error(` systemctl --user start touchkio.service`); + console.error(`Alternatively export the variables first:`); + console.error(` export DISPLAY=":0" && export WAYLAND_DISPLAY="wayland-0" && touchkio\n`); +} + /** * This promise resolves when the app has finished initializing, * allowing to safely create browser windows and perform other