Skip to content

Commit

Permalink
Updated installation script and README
Browse files Browse the repository at this point in the history
  • Loading branch information
julianschill committed May 5, 2024
1 parent d493923 commit 6fa9041
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 11 deletions.
60 changes: 57 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,75 @@ 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 ~
git clone https://github.com/julianschill/klipper-led_effect.git
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 <klipper path>] [-s <klipper service name>] [-c <configuration path>]

### 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 <klipper path>] [-s <klipper service name>] [-c <configuration path>]

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).
Expand Down
18 changes: 10 additions & 8 deletions install-led_effect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -12,11 +13,12 @@ if [ ! -d "${MOONRAKER_CONFIG_DIR}" ]; then
MOONRAKER_CONFIG_DIR="${HOME}/klipper_config"
fi

usage(){ echo "Usage: $0 [-k <klipper path>] [-c <configuration path>]" 1>&2; exit 1; }
usage(){ echo "Usage: $0 [-k <klipper path>] [-s <klipper service name>] [-c <configuration path>] [-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;;
Expand All @@ -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
}
Expand Down Expand Up @@ -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]"
}

Expand Down

0 comments on commit 6fa9041

Please sign in to comment.