diff --git a/README.md b/README.md index 6d7c682..f465fed 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,21 @@ And this one (in french) from Tom's Basement: [![Klipper LED EFFECTS : C'est Noël avant l'heure dans votre imprimante 3D ! (Tuto Leds)](http://i3.ytimg.com/vi/6rGjlBjFhss/hqdefault.jpg)](https://www.youtube.com/watch?v=6rGjlBjFhss) ## Disclaimer -**This is work in progress and currently in "alpha" state.** +**This is work in progress and currently in "beta" state.** +I don't take any responsibility for any damage that happens while using this software. -If you encounter any problems, feel free to open an issue. +## Support + +For questions and support use the Q&A section on the [Discussions](https://github.com/julianschill/klipper-led_effect/discussions) page. + +If you found a bug or you want to file a feature request open an [issue](https://github.com/julianschill/klipper-led_effect/issues). -If you need support or want to help by testing or contributing, please contact me on the [Klipper](https://discord.klipper3d.org/) or [Voron](https://discord.com/channels/460117602945990666/460172848565190667) Discord: Hagbard#7867 +If you need direct support or want to help by testing or contributing, please contact me on the [Klipper](https://discord.klipper3d.org/) or [Voron](https://discord.gg/voron) Discord. User: 5hagbard23 ## Installation +### Automatic installation + The module can be installed into a existing Klipper installation with an install script. cd ~ @@ -33,6 +40,53 @@ The module can be installed into a existing Klipper installation with an install cd klipper-led_effect ./install-led_effect.sh +If your directory structure differs from the usual setup you can configure the +installation script with parameters: + ./install-led_effect.sh [-k ] [-s ] [-c ] + +### Manual installation +Clone the repository: + cd ~ + git clone https://github.com/julianschill/klipper-led_effect.git + +Stop Klipper: + systemctl stop klipper + +Link the file in the Klipper directory (adjust the paths as needed): + ln -s klipper-led_effect/led_effect.py ~/klipper/extras/led_effect.py + +Start Klipper: + systemctl start klipper + +Add the updater section to moonraker.conf and restart moonraker to receive +updates: + + [update_manager led_effect] + type: git_repo + path: ~/klipper-led_effect + origin: https://github.com/julianschill/klipper-led_effect.git + is_system_service: False + +## Uninstall + +Remove all led_effect definitions in your Klipper configuration and the updater +section in the Moonraker configuration. Then run the script to remove the link: + + cd ~ + cd klipper-led_effect + ./install-led_effect.sh -u + +If your directory structure differs from the usual setup you can configure the +installation script with parameters: + ./install-led_effect.sh -u [-k ] [-s ] [-c ] + +If that fails, you can delete the link in Klipper manually: + rm ~/klipper/extras/led_effect.py + +Delete the repository (optional) + cd ~ + rm -rf klipper-led_effect + ## Configuration Documentation can be found [here](docs/LED_Effect.md). diff --git a/install-led_effect.sh b/install-led_effect.sh index eb606c4..99ba53d 100755 --- a/install-led_effect.sh +++ b/install-led_effect.sh @@ -3,6 +3,7 @@ set -e KLIPPER_PATH="${HOME}/klipper" +KLIPPER_SERVICE_NAME=klipper SYSTEMDDIR="/etc/systemd/system" MOONRAKER_CONFIG_DIR="${HOME}/printer_data/config" @@ -12,11 +13,12 @@ if [ ! -d "${MOONRAKER_CONFIG_DIR}" ]; then MOONRAKER_CONFIG_DIR="${HOME}/klipper_config" fi -usage(){ echo "Usage: $0 [-k ] [-c ]" 1>&2; exit 1; } +usage(){ echo "Usage: $0 [-k ] [-s ] [-c ] [-u]" 1>&2; exit 1; } # Parse command line arguments -while getopts "k:c:uh" arg; do +while getopts "k:s:c:uh" arg; do case $arg in k) KLIPPER_PATH=$OPTARG;; + s) KLIPPER_SERVICE_NAME=$OPTARG;; c) MOONRAKER_CONFIG_DIR=$OPTARG;; u) UNINSTALL=1;; h) usage;; @@ -29,10 +31,10 @@ SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/src/ && pwd )" # Verify Klipper has been installed check_klipper() { - if [ "$(sudo systemctl list-units --full -all -t service --no-legend | grep -F "klipper.service")" ]; then - echo "Klipper service found." + if [ "$(sudo systemctl list-units --full -all -t service --no-legend | grep -F "$KLIPPER_SERVICE_NAME.service")" ]; then + echo "Klipper service found with name "$KLIPPER_SERVICE_NAME"." else - echo "[ERROR] Klipper service not found, please install Klipper first" + echo "[ERROR] Klipper service with name "$KLIPPER_SERVICE_NAME" not found, please install Klipper first or specify name with -s." exit -1 fi } @@ -90,21 +92,21 @@ add_updater() restart_klipper() { echo -n "Restarting Klipper... " - sudo systemctl restart klipper + sudo systemctl restart $KLIPPER_SERVICE_NAME echo "[OK]" } start_klipper() { echo -n "Starting Klipper... " - sudo systemctl start klipper + sudo systemctl start $KLIPPER_SERVICE_NAME echo "[OK]" } stop_klipper() { echo -n "Stopping Klipper... " - sudo systemctl stop klipper + sudo systemctl stop $KLIPPER_SERVICE_NAME echo "[OK]" }