Skip to content

Latest commit

 

History

History
150 lines (106 loc) · 2.8 KB

LaserWeb-CNCWeb.md

File metadata and controls

150 lines (106 loc) · 2.8 KB

LaserWeb/CNCWeb

My guide

Open the terminal window and enter:

sudo apt-get update && sudo apt install npm

You can verify that npm and node are installed then by entering the following:

npm -v && node -v 
  • The following were the version numbers returned at the time of this writing:
    • 9.2.0
    • v18.19.1

Then install Chromium by entering:

sudo apt install chromium

Install git:

sudo apt install git

Clone and build the latest lw.comm-server:

cd /usr/local
sudo git clone https://github.com/LaserWeb/lw.comm-server.git
cd lw.comm-server
sudo npm audit fix
sudo npm install 

You can then test that the sever is working with:

node server

Type CTRL-C to stop the server:

Then create a bash script for launchng the server and the browser:

sudo nano startlw.sh

Copy and paste or type the following into the nano editor. Note that this script can be used with Chromium (recommended) or Firefox by uncommenting the correct line:

#!/bin/bash

# Start the Node.js server in the background
node /usr/local/lw.comm-server/server &

# Store the PID of the last background command (Node.js server)
server_pid=$!

#ONLY UNCOMMENT ONE OF THE FOLLOWING BROWSERS
# Uncomment the next line to launch Chromium browser pointing to localhost:8000
chromium --app=http://localhost:8000/ --start-maximized
# Uncomment the next line to launch Firefox browser pointing to localhost:8000
#firefox -new-window http://localhost:8000/

# Terminate the Node.js server
kill $server_pid
  • Save and Exit nano
    • To Save: [Ctrl]+[o]
    • To Exit: [Ctrl]+[w]

Then make the script executable and change the owner to your username (replace all the below with your own Linux username):

sudo chmod u+x startlw.sh 
sudo chown <username>:<username> startlw.sh 
sudo usermod -a -G dialout <username>

You should be able to launch LaserWeb fro the terminal then by entering:

./startlw.sh

You are ok to close the terminal if everything worked.

Add a desktop file

mkdir -p ~/.local/bin && mkdir -p ~/.local/share/icons
sudo nano ~/.local/share/applications/LaserWeb4.desktop
[Desktop Entry]
Type=Application
Name=LaserWeb4 
Comment=Better Software For Laser Cutters
Exec=/usr/local/lw.comm-server/startlw.sh
Icon=LaserWeb4.png
Categories=Graphics;

Add App Icons

LaserWeb4
LaserWeb4

Download LaserWeb4.png to:

 ~/.local/share/icons