Electron apps on Trizeps 8 Mini

Electron apps on Trizeps 8 Mini

Electron Apps can easily be debugged and tested using nodejs.

Install curl and nvm:

sudo apt install curl curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh -o install_nvm.sh bash install_nvm.sh source ~/.profile

Install an older LTS version of npm: nvm ls-remote can be used to see a list of available versions

nvm ls-remote nvm install 8.17.0 nvm use 8.17.0

Electron Example Apps

There is a couple of example apps available on the electron github page:

Hello World App

git clone https://github.com/electron/electron-quick-start

Electron API Demos

git clone https://github.com/electron/electron-api-demos

Electron Simple Samples

git clone https://github.com/electron/simple-samples

Installing and launching the example apps

To install the apps navigate to the apps in the terminal and install them.

cd electron-api-demos npm install

or

cd simple-samples/activity-monitor npm install

Electron apps can be launched when logged in remotely via UART or SSH:

DISPLAY=:0 npm start

… or when logged in locally using a keyboard on the eval kit:

npm start

Electron Packager

The electron packager is used to package Electron apps into OS-specific executables.

For use from the CLI

npm install electron-packager -g

Package an application for Trizeps 8 with Debian:

electron-packager <PATHTOSOURCE> <PROJECTNAME> --platform=linux --arch=arm64

The application will be placed in a subfolder of the active directory.

Running Electron Apps in Kiosk Mode

Electron apps can be set up to be launched in kiosk mode by adding that option to the main BrowserWindow in the main .js file (usually app.js or main.js)

Simply add

WINDOWNAME.setKiosk(true);

to the options below the WINDOWNAME = new BrowserWindow({ … }) section.

Looking for labels? They can now be found in the details panel on the floating action bar.