Moving development into master
This commit is contained in:
1 parent
a2e979f847
commit
d2036c13af
104 files changed
+8080
-579
No files matched your search
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
KSPATH=$(sed 's/\/scripts//g' <<< $SCRIPTPATH)
|
||||
KSENV="${HOME}/.KlipperScreen-env"
|
||||
|
||||
install_packages()
|
||||
{
|
||||
echo "Update package data"
|
||||
sudo apt update
|
||||
|
||||
echo "Installing package dependencies"
|
||||
sudo apt install -y \
|
||||
xserver-xorg-video-fbturbo \
|
||||
xinit \
|
||||
xinput \
|
||||
x11-xserver-utils \
|
||||
python3-gi \
|
||||
python3-gi-cairo \
|
||||
gir1.2-gtk-3.0
|
||||
}
|
||||
|
||||
create_virtualenv()
|
||||
{
|
||||
echo "Creating virtual environment"
|
||||
[ ! -d ${KSENV} ] && virtualenv -p /usr/bin/python3 ${KSENV}
|
||||
|
||||
${KSENV}/bin/pip install -r ${KSPATH}/scripts/KlipperScreen-requirements.txt
|
||||
${KSENV}/bin/vext -i ${KSENV}/gi.vext
|
||||
}
|
||||
|
||||
install_systemd_service()
|
||||
{
|
||||
echo "Installing KlipperScreen unit file"
|
||||
|
||||
SERVICE=$(<$SCRIPTPATH/KlipperScreen.service)
|
||||
KSPATH_ESC=$(sed "s/\//\\\\\//g" <<< $KSPATH)
|
||||
KSENV_ESC=$(sed "s/\//\\\\\//g" <<< $KSENV)
|
||||
|
||||
SERVICE=$(sed "s/KS_ENV/$KSENV_ESC/g" <<< $SERVICE)
|
||||
SERVICE=$(sed "s/KS_DIR/$KSPATH_ESC/g" <<< $SERVICE)
|
||||
|
||||
echo "$SERVICE" | sudo tee /etc/systemd/system/KlipperScreen.service > /dev/null
|
||||
sudo systemctl daemon-reload
|
||||
}
|
||||
|
||||
|
||||
#install_packages
|
||||
create_virtualenv
|
||||
install_systemd_service
|
||||
@@ -0,0 +1,6 @@
|
||||
websocket==0.2.1
|
||||
requests==2.24.0
|
||||
vext==0.7.3
|
||||
vext.gi==0.7.0
|
||||
websocket-client==0.57.0
|
||||
humanize==2.5.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=KlipperScreen
|
||||
After=moonraker.service
|
||||
StartLimitIntervalSec=0
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
User=pi
|
||||
WorkingDirectory=KS_DIR
|
||||
ExecStart=/usr/bin/xinit KS_ENV/bin/python KS_DIR/screen.py
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Executable → Regular
File mode changed.
Reference in new issue
Block a user