#!usr/bin/env bash

# https://github.com/nhchiu/Klipper-on-Orange-Pi-Zero-2

# Update existing release
# apt update --allow-releaseinfo-change && apt dist-upgrade -y
apt-get install git virtualenv -y

# Add the pi user
adduser pi
adduser pi sudo

# We need to have klipper, Moonraker, and one of the clients
# Klipper is a 3d-Printer firmware.
# - [klipper](https://www.klipper3d.org/)
# - [klipper install](http://www.klipper3d.org/Installation.html)
#
# A web user interface
# - [Mainsail](https://docs.mainsail.xyz/)
# - [Mainsail](https://docs.mainsail.xyz/setup/getting-started/manual-setup)
# - [Mainsail git](https://github.com/mainsail-crew/mainsail)
#
# Fluidd Klipper web interface for managing your 3d printer.
# - [Fluidd](https://docs.fluidd.xyz/)
# - [Fluidd git](https://github.com/fluidd-core/fluidd)
#
# Moonraker - API Web Server for Klipper
# - [Moonraker](https://moonraker.readthedocs.io/en/latest/)
# - [Moonraker install](https://moonraker.readthedocs.io/en/latest/installation/)
# - [Moonraker git](https://github.com/Arksine/moonraker)
# - [Klipperscreen](https://github.com/jordanruthe/KlipperScreen)
# - [Moonraker-Telegram-Bot](https://github.com/nlef/moonraker-telegram-bot)
#
# PrettyGCode WebGL based GCode preview and simulator
# - [PrettyGCode for Klipper](https://github.com/Kragrathea/pgcode)
#
# Obico 3D printing platform
# This is a Moonraker plugin that enables the Klipper-based 3D printers to connect to Obico.
# - [Obico Cloud for Klipper](https://github.com/TheSpaghettiDetective/moonraker-obico)
# - [Mobileraker's Companion](https://github.com/Clon1998/mobileraker_companion)
#
# Octoprint is a 3d-Printer firmware.
# - [Octoprint](https://docs.octoprint.org/en/master/)
# - [Octoprint](https://github.com/OctoPrint/OctoPrint)
# - [OctoEverywhere for Klipper](https://octoeverywhere.com/?source=kiauh_readme)
# - [OctoApp for Klipper](https://github.com/crysxd/OctoPrint-OctoApp)
# installed to make it functional.

# We can't use this:
# this is a systemd based script that uses a tui to ask for input.
# [Klipper install and update helper](https://github.com/dw-0/kiauh)

MainsailOS images includes:
[Mainsail](https://github.com/mainsail-crew/mainsail)

[Klipper](https://github.com/klipper3d/klipper)


Moonraker - API Web Server for Klipper
[Moonraker](https://github.com/arksine/moonraker)

Webcam daemon
[Crowsnest](https://github.com/mainsail-crew/crowsnest)

Keep alive daemon
[Sonar](https://github.com/mainsail-crew/sonar)

Timelapse plugin for Moonraker
[Timelapse](https://github.com/mainsail-crew/moonraker-timelapse)

Preinstalled software dependencies:

[Measuring Resonances](https://www.klipper3d.org/Measuring_Resonances.html)

[Katapult](https://github.com/Arksine/katapult) (formerly known as CanBoot)

KlipperScreen is a touchscreen GUI that interfaces with Klipper via Moonraker. 
[KlipperScreen](https://github.com/jordanruthe/KlipperScreen/)
