Update 6.0.0

This commit is contained in:
Cyril 2024-05-01 16:10:07 +02:00
parent bb0b7539a0
commit c8db437b79
63 changed files with 3667 additions and 737 deletions

View file

@ -24,28 +24,44 @@ function install_guppy_screen(){
if [ -f "$USR_DATA"/guppyscreen.tar.gz ]; then
rm -f "$USR_DATA"/guppyscreen.tar.gz
fi
if [ $K1 -eq 1 ]; then
if [ "$model" = "K1" ] || [ "$model" = "3V3" ]; then
local theme_choice
while true; do
read -p " Do you want to install it with ${green}Material Design ${white}or ${green}Z-Bolt ${white}theme? (${yellow}material${white}/${yellow}zbolt${white}): ${yellow}" theme_choice
read -p " Do you want to install ${green}Nightly Build ${white}or ${green}Release Build ${white}? (${yellow}nightly${white}/${yellow}release${white}): ${yellow}" theme_choice
case "${theme_choice}" in
MATERIAL|material)
NIGHTLY|nightly)
echo -e "${white}"
echo -e "Info: Downloading Guppy Screen..."
"$CURL" -L https://github.com/ballaswag/guppyscreen/releases/download/nightly/guppyscreen.tar.gz -o "$USR_DATA"/guppyscreen.tar.gz
break;;
RELEASE|release)
echo -e "${white}"
echo -e "Info: Downloading Guppy Screen..."
"$CURL" -L https://github.com/ballaswag/guppyscreen/releases/latest/download/guppyscreen.tar.gz -o "$USR_DATA"/guppyscreen.tar.gz
break;;
ZBOLT|zbolt)
echo -e "${white}"
echo -e "Info: Downloading Guppy Screen..."
"$CURL" -L https://github.com/ballaswag/guppyscreen/releases/latest/download/guppyscreen-zbolt.tar.gz -o "$USR_DATA"/guppyscreen.tar.gz
break;;
*)
error_msg "Please select a correct choice!";;
esac
done
else
echo -e "Info: Downloading Guppy Screen..."
"$CURL" -L https://github.com/ballaswag/guppyscreen/releases/latest/download/guppyscreen-smallscreen.tar.gz -o "$USR_DATA"/guppyscreen.tar.gz
local theme_choice
while true; do
read -p " Do you want to install ${green}Nightly Build ${white}or ${green}Release Build ${white}? (${yellow}nightly${white}/${yellow}release${white}): ${yellow}" theme_choice
case "${theme_choice}" in
NIGHTLY|nightly)
echo -e "${white}"
echo -e "Info: Downloading Guppy Screen..."
"$CURL" -L https://github.com/ballaswag/guppyscreen/releases/download/nightly/guppyscreen-smallscreen.tar.gz -o "$USR_DATA"/guppyscreen.tar.gz
break;;
RELEASE|release)
echo -e "${white}"
echo -e "Info: Downloading Guppy Screen..."
"$CURL" -L https://github.com/ballaswag/guppyscreen/releases/latest/download/guppyscreen-smallscreen.tar.gz -o "$USR_DATA"/guppyscreen.tar.gz
break;;
*)
error_msg "Please select a correct choice!";;
esac
done
fi
echo -e "Info: Installing files..."
tar -xvf "$USR_DATA"/guppyscreen.tar.gz -C "$USR_DATA"
@ -114,7 +130,17 @@ function install_guppy_screen(){
mkdir -p "$KLIPPER_CONFIG_FOLDER"/GuppyScreen/scripts
cp "$GUPPY_SCREEN_FOLDER"/scripts/*.cfg "$KLIPPER_CONFIG_FOLDER"/GuppyScreen
cp "$GUPPY_SCREEN_FOLDER"/scripts/*.py "$KLIPPER_CONFIG_FOLDER"/GuppyScreen/scripts
ln -sf "$GUPPY_SCREEN_URL1" "$KLIPPER_CONFIG_FOLDER"/GuppyScreen/guppy_update.cfg
if [ "$model" = "K1" ]; then
ln -sf "$GUPPY_SCREEN_URL1" "$KLIPPER_CONFIG_FOLDER"/GuppyScreen/guppy_update.cfg
else
ln -sf "$GUPPY_SCREEN_3V3_URL" "$KLIPPER_CONFIG_FOLDER"/GuppyScreen/guppy_update.cfg
fi
if [ "$model" = "3V3" ]; then
if [ -f "$GUPPY_SCREEN_FOLDER"/guppyconfig.json ];then
rm -f "$GUPPY_SCREEN_FOLDER"/guppyconfig.json
fi
cp "$GUPPY_SCREEN_CONFIG_3V3_URL" "$GUPPY_SCREEN_FOLDER"/guppyconfig.json
fi
chmod 775 "$GUPPY_SCREEN_URL2"
if grep -q "include GuppyScreen" "$PRINTER_CFG" ; then
echo -e "Info: Guppy Screen configurations are already enabled in printer.cfg file."
@ -128,11 +154,13 @@ function install_guppy_screen(){
else
echo -e "Info: Stock configuration is already disabled in gcode_macro.cfg file..."
fi
if grep -q '\[gcode_macro INPUTSHAPER\]' "$MACROS_CFG" ; then
echo -e "Info: Replacing stock configuration in gcode_macro.cfg file..."
sed -i 's/SHAPER_CALIBRATE AXIS=y/SHAPER_CALIBRATE/' "$MACROS_CFG"
else
echo -e "Info: Stock configuration is already replaced in gcode_macro.cfg file..."
if [ "$model" = "K1" ]; then
if grep -q '\[gcode_macro INPUTSHAPER\]' "$MACROS_CFG" ; then
echo -e "Info: Replacing stock configuration in gcode_macro.cfg file..."
sed -i 's/SHAPER_CALIBRATE AXIS=y/SHAPER_CALIBRATE/' "$MACROS_CFG"
else
echo -e "Info: Stock configuration is already replaced in gcode_macro.cfg file..."
fi
fi
sync
echo -e "Info: Restarting Moonraker service..."
@ -221,11 +249,13 @@ function remove_guppy_screen(){
else
echo -e "Info: Stock configuration is already enabled in gcode_macro.cfg file..."
fi
if grep -q '\[gcode_macro INPUTSHAPER\]' "$MACROS_CFG" ; then
echo -e "Info: Restoring stock configuration in gcode_macro.cfg file..."
sed -i 's/SHAPER_CALIBRATE/SHAPER_CALIBRATE AXIS=y/' "$MACROS_CFG"
else
echo -e "Info: Stock configuration is already restored in gcode_macro.cfg file..."
if [ "$model" = "K1" ]; then
if grep -q '\[gcode_macro INPUTSHAPER\]' "$MACROS_CFG" ; then
echo -e "Info: Restoring stock configuration in gcode_macro.cfg file..."
sed -i 's/SHAPER_CALIBRATE/SHAPER_CALIBRATE AXIS=y/' "$MACROS_CFG"
else
echo -e "Info: Stock configuration is already restored in gcode_macro.cfg file..."
fi
fi
echo -e "Info: Restarting Moonraker service..."
stop_moonraker