From 70268f003f7d85d1b223c124d6b3dfce10ce4900 Mon Sep 17 00:00:00 2001 From: Cyril Date: Wed, 29 May 2024 00:13:52 +0200 Subject: [PATCH] Update --- files/macros/save-zoffset.cfg | 20 +- .../screws-tilt-adjust-3ke.cfg | 25 ++ helper.sh | 5 +- scripts/menu/10SE/customize_menu_10SE.sh | 91 +++++++ scripts/menu/10SE/info_menu_10SE.sh | 95 ++++++++ .../install_menu_10SE.sh} | 87 ++++--- .../remove_menu_10SE.sh} | 87 ++++--- scripts/menu/10SE/tools_menu_10SE.sh | 110 +++++++++ .../customize_menu_3KE.sh} | 18 +- scripts/menu/3KE/info_menu_3KE.sh | 97 ++++++++ scripts/menu/3KE/install_menu_3KE.sh | 226 ++++++++++++++++++ scripts/menu/3KE/remove_menu_3KE.sh | 204 ++++++++++++++++ .../tools_menu_3KE.sh} | 32 +-- scripts/menu/KE/info_menu_KE.sh | 95 -------- scripts/menu/main_menu.sh | 20 +- scripts/paths.sh | 1 + scripts/screws_tilt_adjust.sh | 41 ++-- 17 files changed, 1007 insertions(+), 247 deletions(-) create mode 100644 files/screws-tilt-adjust/screws-tilt-adjust-3ke.cfg create mode 100755 scripts/menu/10SE/customize_menu_10SE.sh create mode 100755 scripts/menu/10SE/info_menu_10SE.sh rename scripts/menu/{KE/install_menu_KE.sh => 10SE/install_menu_10SE.sh} (79%) rename scripts/menu/{KE/remove_menu_KE.sh => 10SE/remove_menu_10SE.sh} (75%) create mode 100755 scripts/menu/10SE/tools_menu_10SE.sh rename scripts/menu/{KE/customize_menu_KE.sh => 3KE/customize_menu_3KE.sh} (92%) create mode 100755 scripts/menu/3KE/info_menu_3KE.sh create mode 100755 scripts/menu/3KE/install_menu_3KE.sh create mode 100755 scripts/menu/3KE/remove_menu_3KE.sh rename scripts/menu/{KE/tools_menu_KE.sh => 3KE/tools_menu_3KE.sh} (75%) delete mode 100755 scripts/menu/KE/info_menu_KE.sh diff --git a/files/macros/save-zoffset.cfg b/files/macros/save-zoffset.cfg index abd3002..ff39100 100644 --- a/files/macros/save-zoffset.cfg +++ b/files/macros/save-zoffset.cfg @@ -13,16 +13,20 @@ description: Saving Z-Offset rename_existing: _SET_GCODE_OFFSET gcode: {% if printer.save_variables.variables.zoffset %} - {% set zoffset = printer.save_variables.variables.zoffset %} + {% set zoffset = printer.save_variables.variables.zoffset %} {% else %} - {% set zoffset = {'z': None} %} + {% set zoffset = {'z': None} %} {% endif %} {% set ns = namespace(zoffset={'z': zoffset.z}) %} _SET_GCODE_OFFSET {% for p in params %}{'%s=%s '% (p, params[p])}{% endfor %} - {%if 'Z' in params %}{% set null = ns.zoffset.update({'z': params.Z}) %}{% endif %} + {%if 'Z' in params %} + {% set null = ns.zoffset.update({'z': params.Z}) %} + {% endif %} {%if 'Z_ADJUST' in params %} - {%if ns.zoffset.z == None %}{% set null = ns.zoffset.update({'z': 0}) %}{% endif %} - {% set null = ns.zoffset.update({'z': (ns.zoffset.z | float) + (params.Z_ADJUST | float)}) %} + {%if ns.zoffset.z == None %} + {% set null = ns.zoffset.update({'z': 0}) %} + {% endif %} + {% set null = ns.zoffset.update({'z': (ns.zoffset.z | float) + (params.Z_ADJUST | float)}) %} {% endif %} SAVE_VARIABLE VARIABLE=zoffset VALUE="{ns.zoffset}" @@ -31,8 +35,8 @@ gcode: initial_duration: 2 gcode: {% if printer.save_variables.variables.zoffset %} - {% set zoffset = printer.save_variables.variables.zoffset %} - _SET_GCODE_OFFSET {% for axis, offset in zoffset.items() if zoffset[axis] %}{ "%s=%s " % (axis, offset) }{% endfor %} - RESPOND TYPE=command MSG="Loaded Z-Offset from variables.cfg: {zoffset.z}mm" + {% set zoffset = printer.save_variables.variables.zoffset %} + _SET_GCODE_OFFSET {% for axis, offset in zoffset.items() if zoffset[axis] %}{ "%s=%s " % (axis, offset) }{% endfor %} + RESPOND TYPE=command MSG="Loaded Z-Offset from variables.cfg: {zoffset.z}mm" {% endif %} \ No newline at end of file diff --git a/files/screws-tilt-adjust/screws-tilt-adjust-3ke.cfg b/files/screws-tilt-adjust/screws-tilt-adjust-3ke.cfg new file mode 100644 index 0000000..8ec1dd4 --- /dev/null +++ b/files/screws-tilt-adjust/screws-tilt-adjust-3ke.cfg @@ -0,0 +1,25 @@ +######################################## +# Screws Tilt Adjust for Ender-3 V3 KE +######################################## + +[screws_tilt_adjust] +screw1: 27.5, -0.5 +screw1_name: front left screw +screw2: 196.5, -0.5 +screw2_name: front right screw +screw3: 196.5, 169.5 +screw3_name: rear right screw +screw4: 27.5, 169.5 +screw4_name: rear left screw +horizontal_move_z: 5 +speed: 150 +screw_thread: CCW-M4 + + +[gcode_macro SCREWS_CALIBRATION] +description: Start Bed Screws Calibration +gcode: + {% if printer.toolhead.homed_axes != "xyz" %} + G28 + {% endif %} + SCREWS_TILT_CALCULATE \ No newline at end of file diff --git a/helper.sh b/helper.sh index f255e2b..fac48fa 100755 --- a/helper.sh +++ b/helper.sh @@ -6,9 +6,10 @@ clear HELPER_SCRIPT_FOLDER="$( cd "$( dirname "${0}" )" && pwd )" for script in "${HELPER_SCRIPT_FOLDER}/scripts/"*.sh; do . "${script}"; done for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/"*.sh; do . "${script}"; done -for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/3V3/"*.sh; do . "${script}"; done for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/K1/"*.sh; do . "${script}"; done -for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/KE/"*.sh; do . "${script}"; done +for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/3V3/"*.sh; do . "${script}"; done +for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/3KE/"*.sh; do . "${script}"; done +for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/10SE/"*.sh; do . "${script}"; done function update_helper_script() { echo -e "${white}" diff --git a/scripts/menu/10SE/customize_menu_10SE.sh b/scripts/menu/10SE/customize_menu_10SE.sh new file mode 100755 index 0000000..ca339a2 --- /dev/null +++ b/scripts/menu/10SE/customize_menu_10SE.sh @@ -0,0 +1,91 @@ +#!/bin/sh + +set -e + +function customize_menu_ui_10se() { + top_line + title '[ CUSTOMIZE MENU ]' "${yellow}" + inner_line + hr + menu_option '1' 'Remove' 'Creality Web Interface' + menu_option '2' 'Restore' 'Creality Web Interface' + hr + menu_option '3' 'Install' 'Guppy Screen' + menu_option '4' 'Remove' 'Guppy Screen' + hr + menu_option '5' 'Install' 'Creality Dynamic Logos for Fluidd' + hr + inner_line + hr + bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}" + bottom_menu_option 'q' 'Exit' "${darkred}" + hr + version_line "$(get_script_version)" + bottom_line +} + +function customize_menu_10se() { + clear + customize_menu_ui_10se + local customize_menu_opt + while true; do + read -p " ${white}Type your choice and validate with Enter: ${yellow}" customize_menu_opt + case "${customize_menu_opt}" in + 1) + if [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then + error_msg "Fluidd or Mainsail is needed, please install one of them first!" + elif [ ! -f "$CREALITY_WEB_FILE" ]; then + error_msg "Creality Web Interface is already removed!" + echo -e " ${darkred}Please restore Creality Web Interface first if you want to change the default Web Interface.${white}" + echo + else + run "remove_creality_web_interface" "customize_menu_ui_10se" + fi;; + 2) + if [ -f "$CREALITY_WEB_FILE" ]; then + error_msg "Creality Web Interface is already present!" + elif [ ! -f "$INITD_FOLDER"/S99start_app ]; then + error_msg "Guppy Screen need to be removed first to restore Creality Web Interface!" + else + run "restore_creality_web_interface" "customize_menu_ui_10se" + fi;; + 3) + if [ -d "$GUPPY_SCREEN_FOLDER" ]; then + error_msg "Guppy Screen is already installed!" + elif [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then + error_msg "Moonraker and Nginx are needed, please install them first!" + elif [ "$(curl -s localhost:7125/server/info | jq .result.klippy_connected)" != "true" ]; then + error_msg "Moonraker and Klipper do not seem to be functional. Please check this!" + elif [ ! -f /lib/ld-2.29.so ]; then + error_msg "Make sure you're running latest firmware version!" + elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then + error_msg "Klipper Gcode Shell Command is needed, please install it first!" + elif [ -d "$IMP_SHAPERS_FOLDER" ]; then + error_msg "Please remove Improved Shapers Calibrations first, Guppy Screen already use it!" + else + run "install_guppy_screen" "customize_menu_ui_10se" + fi;; + 4) + if [ ! -d "$GUPPY_SCREEN_FOLDER" ]; then + error_msg "Guppy Screen is not installed!" + else + run "remove_guppy_screen" "customize_menu_ui_10se" + fi;; + 5) + if [ -f "$FLUIDD_LOGO_FILE" ]; then + error_msg "Creality Dynamic Logos for Fluidd are already installed!" + elif [ ! -d "$FLUIDD_FOLDER" ]; then + error_msg "Fluidd is needed, please install it first!" + else + run "install_creality_dynamic_logos" "customize_menu_ui_10se" + fi;; + B|b) + clear; main_menu; break;; + Q|q) + clear; exit 0;; + *) + error_msg "Please select a correct choice!";; + esac + done + customize_menu_10se +} diff --git a/scripts/menu/10SE/info_menu_10SE.sh b/scripts/menu/10SE/info_menu_10SE.sh new file mode 100755 index 0000000..f9769cb --- /dev/null +++ b/scripts/menu/10SE/info_menu_10SE.sh @@ -0,0 +1,95 @@ +#!/bin/sh + +set -e + +function check_folder_10se() { + local folder_path="$1" + if [ -d "$folder_path" ]; then + echo -e "${green}✓" + else + echo -e "${red}✗" + fi +} + +function check_file_10se() { + local file_path="$1" + if [ -f "$file_path" ]; then + echo -e "${green}✓" + else + echo -e "${red}✗" + fi +} + +function check_simplyprint_10se() { + if [ ! -f "$MOONRAKER_CFG" ]; then + echo -e "${red}✗" + elif grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then + echo -e "${green}✓" + else + echo -e "${red}✗" + fi +} + +function info_menu_ui_10se() { + top_line + title '[ INFORMATION MENU ]' "${yellow}" + inner_line + hr + subtitle '•ESSENTIALS:' + info_line "$(check_folder_10se "$MOONRAKER_FOLDER")" 'Moonraker & Nginx' + info_line "$(check_folder_10se "$FLUIDD_FOLDER")" 'Fluidd' + info_line "$(check_folder_10se "$MAINSAIL_FOLDER")" 'Mainsail' + hr + subtitle '•UTILITIES:' + info_line "$(check_file_10se "$ENTWARE_FILE")" 'Entware' + info_line "$(check_file_10se "$KLIPPER_SHELL_FILE")" 'Klipper Gcode Shell Command' + hr + subtitle '•IMPROVEMENTS:' + info_line "$(check_folder_10se "$IMP_SHAPERS_FOLDER")" 'Improved Shapers Calibrations' + info_line "$(check_file_10se "$SAVE_ZOFFSET_FILE")" 'Save Z-Offset Macros' + info_line "$(check_file_10se "$GIT_BACKUP_FILE")" 'Git Backup' + hr + subtitle '•CAMERA:' + info_line "$(check_file_10se "$TIMELAPSE_FILE")" 'Moonraker Timelapse' + info_line "$(check_file_10se "$CAMERA_SETTINGS_FILE")" 'Nebula Camera Settings Control' + info_line "$(check_file_10se "$USB_CAMERA_FILE")" 'USB Camera Support' + hr + subtitle '•REMOTE ACCESS:' + info_line "$(check_folder_10se "$OCTOEVERYWHERE_FOLDER")" 'OctoEverywhere' + info_line "$(check_folder_10se "$MOONRAKER_OBICO_FOLDER")" 'Obico' + info_line "$(check_folder_10se "$GUPPYFLO_FOLDER")" 'GuppyFLO' + info_line "$(check_folder_10se "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion' + info_line "$(check_folder_10se "$OCTOAPP_COMPANION_FOLDER")" 'OctoApp Companion' + info_line "$(check_simplyprint_10se)" 'SimplyPrint' + hr + subtitle '•CUSTOMIZATION:' + info_line "$(check_file_10se "$CREALITY_WEB_FILE")" 'Creality Web Interface' + info_line "$(check_folder_10se "$GUPPY_SCREEN_FOLDER")" 'Guppy Screen' + info_line "$(check_file_10se "$FLUIDD_LOGO_FILE")" 'Creality Dynamic Logos for Fluidd' + hr + inner_line + hr + bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}" + bottom_menu_option 'q' 'Exit' "${darkred}" + hr + version_line "$(get_script_version)" + bottom_line +} + +function info_menu_10se() { + clear + info_menu_ui_10se + local info_menu_opt + while true; do + read -p " ${white}Type your choice and validate with Enter: ${yellow}" info_menu_opt + case "${info_menu_opt}" in + B|b) + clear; main_menu; break;; + Q|q) + clear; exit 0;; + *) + error_msg "Please select a correct choice!";; + esac + done + info_menu_10se +} diff --git a/scripts/menu/KE/install_menu_KE.sh b/scripts/menu/10SE/install_menu_10SE.sh similarity index 79% rename from scripts/menu/KE/install_menu_KE.sh rename to scripts/menu/10SE/install_menu_10SE.sh index 9e31353..7eca635 100755 --- a/scripts/menu/KE/install_menu_KE.sh +++ b/scripts/menu/10SE/install_menu_10SE.sh @@ -2,7 +2,7 @@ set -e -function install_menu_ui_ke() { +function install_menu_ui_10se() { top_line title '[ INSTALL MENU ]' "${yellow}" inner_line @@ -19,21 +19,20 @@ function install_menu_ui_ke() { subtitle '•IMPROVEMENTS:' menu_option ' 6' 'Install' 'Improved Shapers Calibrations' menu_option ' 7' 'Install' 'Save Z-Offset Macros' - menu_option ' 8' 'Install' 'M600 Support' - menu_option ' 9' 'Install' 'Git Backup' + menu_option ' 8' 'Install' 'Git Backup' hr subtitle '•CAMERA:' - menu_option '10' 'Install' 'Moonraker Timelapse' - menu_option '11' 'Install' 'Nebula Camera Settings Control' - menu_option '12' 'Install' 'USB Camera Support' + menu_option ' 9' 'Install' 'Moonraker Timelapse' + menu_option '10' 'Install' 'Nebula Camera Settings Control' + menu_option '11' 'Install' 'USB Camera Support' hr subtitle '•REMOTE ACCESS:' - menu_option '13' 'Install' 'OctoEverywhere' - menu_option '14' 'Install' 'Moonraker Obico' - menu_option '15' 'Install' 'GuppyFLO' - menu_option '16' 'Install' 'Mobileraker Companion' - menu_option '17' 'Install' 'OctoApp Companion' - menu_option '18' 'Install' 'SimplyPrint' + menu_option '12' 'Install' 'OctoEverywhere' + menu_option '13' 'Install' 'Moonraker Obico' + menu_option '14' 'Install' 'GuppyFLO' + menu_option '15' 'Install' 'Mobileraker Companion' + menu_option '16' 'Install' 'OctoApp Companion' + menu_option '17' 'Install' 'SimplyPrint' hr inner_line hr @@ -44,9 +43,9 @@ function install_menu_ui_ke() { bottom_line } -function install_menu_ke() { +function install_menu_10se() { clear - install_menu_ui_ke + install_menu_ui_10se local install_menu_opt while true; do read -p " ${white}Type your choice and validate with Enter: ${yellow}" install_menu_opt @@ -55,7 +54,7 @@ function install_menu_ke() { if [ -d "$MOONRAKER_FOLDER" ]; then error_msg "Moonraker and Nginx are already installed!" else - run "install_moonraker_nginx" "install_menu_ui_ke" + run "install_moonraker_nginx" "install_menu_ui_10se" fi;; 2) if [ -d "$FLUIDD_FOLDER" ]; then @@ -63,7 +62,7 @@ function install_menu_ke() { elif [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then error_msg "Moonraker and Nginx are needed, please install them first!" else - run "install_fluidd" "install_menu_ui_ke" + run "install_fluidd" "install_menu_ui_10se" fi;; 3) if [ -d "$MAINSAIL_FOLDER" ]; then @@ -71,19 +70,19 @@ function install_menu_ke() { elif [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then error_msg "Moonraker and Nginx are needed, please install them first!" else - run "install_mainsail" "install_menu_ui_ke" + run "install_mainsail" "install_menu_ui_10se" fi;; 4) if [ -f "$ENTWARE_FILE" ]; then error_msg "Entware is already installed!" else - run "install_entware" "install_menu_ui_ke" + run "install_entware" "install_menu_ui_10se" fi;; 5) if [ -f "$KLIPPER_SHELL_FILE" ]; then error_msg "Klipper Gcode Shell Command is already installed!" else - run "install_gcode_shell_command" "install_menu_ui_ke" + run "install_gcode_shell_command" "install_menu_ui_10se" fi;; 6) if [ -d "$IMP_SHAPERS_FOLDER" ]; then @@ -93,21 +92,15 @@ function install_menu_ke() { elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then error_msg "Klipper Gcode Shell Command is needed, please install it first!" else - run "install_improved_shapers" "install_menu_ui_ke" + run "install_improved_shapers" "install_menu_ui_10se" fi;; 7) if [ -f "$SAVE_ZOFFSET_FILE" ]; then error_msg "Save Z-Offset Macros are already installed!" else - run "install_save_zoffset_macros" "install_menu_ui_ke" + run "install_save_zoffset_macros" "install_menu_ui_10se" fi;; 8) - if [ -f "$M600_SUPPORT_FILE" ]; then - error_msg "M600 Support is already installed!" - else - run "install_m600_support" "install_menu_ui_k1" - fi;; - 9) if [ -f "$GIT_BACKUP_FILE" ]; then error_msg "Git Backup is already installed!" elif [ ! -f "$ENTWARE_FILE" ]; then @@ -115,17 +108,17 @@ function install_menu_ke() { elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then error_msg "Klipper Gcode Shell Command is needed, please install it first!" else - run "install_git_backup" "install_menu_ui_ke" + run "install_git_backup" "install_menu_ui_10se" fi;; - 10) + 9) if [ -f "$TIMELAPSE_FILE" ]; then error_msg "Moonraker Timelapse is already installed!" elif [ ! -f "$ENTWARE_FILE" ]; then error_msg "Entware is needed, please install it first!" else - run "install_moonraker_timelapse" "install_menu_ui_ke" + run "install_moonraker_timelapse" "install_menu_ui_10se" fi;; - 11) + 10) if [ -f "$CAMERA_SETTINGS_FILE" ]; then error_msg "Nebula Camera Settings Control is already installed!" elif ! v4l2-ctl --list-devices | grep -q 'CCX2F3298'; then @@ -133,9 +126,9 @@ function install_menu_ke() { elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then error_msg "Klipper Gcode Shell Command is needed, please install it first!" else - run "install_camera_settings_control" "install_menu_ui_ke" + run "install_camera_settings_control" "install_menu_ui_10se" fi;; - 12) + 11) if [ -f "$USB_CAMERA_FILE" ]; then error_msg "Camera USB Support is already installed!" elif v4l2-ctl --list-devices | grep -qE 'CREALITY|CCX2F3298'; then @@ -143,9 +136,9 @@ function install_menu_ke() { elif [ ! -f "$ENTWARE_FILE" ]; then error_msg "Entware is needed, please install it first!" else - run "install_usb_camera" "install_menu_ui_ke" + run "install_usb_camera" "install_menu_ui_10se" fi;; - 13) + 12) if [ -d "$OCTOEVERYWHERE_FOLDER" ]; then error_msg "OctoEverywhere is already installed!" elif [ ! -d "$MOONRAKER_FOLDER" ]; then @@ -155,9 +148,9 @@ function install_menu_ke() { elif [ ! -f "$ENTWARE_FILE" ]; then error_msg "Entware is needed, please install it first!" else - run "install_octoeverywhere" "install_menu_ui_ke" + run "install_octoeverywhere" "install_menu_ui_10se" fi;; - 14) + 13) if [ ! -d "$MOONRAKER_FOLDER" ]; then error_msg "Moonraker and Nginx are needed, please install them first!" elif [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then @@ -165,15 +158,15 @@ function install_menu_ke() { elif [ ! -f "$ENTWARE_FILE" ]; then error_msg "Entware is needed, please install it first!" else - run "install_moonraker_obico" "install_menu_ui_ke" + run "install_moonraker_obico" "install_menu_ui_10se" fi;; - 15) + 14) if [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then error_msg "Moonraker and Nginx are needed, please install them first!" else - run "install_guppyflo" "install_menu_ui_ke" + run "install_guppyflo" "install_menu_ui_10se" fi;; - 16) + 15) if [ -d "$MOBILERAKER_COMPANION_FOLDER" ]; then error_msg "Mobileraker Companion is already installed!" elif [ ! -d "$MOONRAKER_FOLDER" ]; then @@ -183,9 +176,9 @@ function install_menu_ke() { elif [ ! -f "$ENTWARE_FILE" ]; then error_msg "Entware is needed, please install it first!" else - run "install_mobileraker_companion" "install_menu_ui_ke" + run "install_mobileraker_companion" "install_menu_ui_10se" fi;; - 17) + 16) if [ -d "$OCTOAPP_COMPANION_FOLDER" ]; then error_msg "OctoApp Companion is already installed!" elif [ ! -d "$MOONRAKER_FOLDER" ]; then @@ -195,9 +188,9 @@ function install_menu_ke() { elif [ ! -f "$ENTWARE_FILE" ]; then error_msg "Entware is needed, please install it first!" else - run "install_octoapp_companion" "install_menu_ui_ke" + run "install_octoapp_companion" "install_menu_ui_10se" fi;; - 18) + 17) if grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then error_msg "SimplyPrint is already installed!" elif [ ! -d "$MOONRAKER_FOLDER" ]; then @@ -205,7 +198,7 @@ function install_menu_ke() { elif [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then error_msg "Fluidd or Mainsail is needed, please install one of them first!" else - run "install_simplyprint" "install_menu_ui_ke" + run "install_simplyprint" "install_menu_ui_10se" fi;; B|b) clear; main_menu; break;; @@ -215,5 +208,5 @@ function install_menu_ke() { error_msg "Please select a correct choice!";; esac done - install_menu_ke + install_menu_10se } \ No newline at end of file diff --git a/scripts/menu/KE/remove_menu_KE.sh b/scripts/menu/10SE/remove_menu_10SE.sh similarity index 75% rename from scripts/menu/KE/remove_menu_KE.sh rename to scripts/menu/10SE/remove_menu_10SE.sh index 0c48923..fdbb7a7 100755 --- a/scripts/menu/KE/remove_menu_KE.sh +++ b/scripts/menu/10SE/remove_menu_10SE.sh @@ -2,7 +2,7 @@ set -e -function remove_menu_ui_ke() { +function remove_menu_ui_10se() { top_line title '[ REMOVE MENU ]' "${yellow}" inner_line @@ -19,21 +19,20 @@ function remove_menu_ui_ke() { subtitle '•IMPROVEMENTS:' menu_option ' 6' 'Remove' 'Improved Shapers Calibrations' menu_option ' 7' 'Remove' 'Save Z-Offset Macros' - menu_option ' 8' 'Remove' 'M600 Support' - menu_option ' 9' 'Remove' 'Git Backup' + menu_option ' 8' 'Remove' 'Git Backup' hr subtitle '•CAMERA:' - menu_option '10' 'Remove' 'Moonraker Timelapse' - menu_option '11' 'Install' 'Nebula Camera Settings Control' - menu_option '12' 'Remove' 'USB Camera Support' + menu_option ' 9' 'Remove' 'Moonraker Timelapse' + menu_option '10' 'Remove' 'Nebula Camera Settings Control' + menu_option '11' 'Remove' 'USB Camera Support' hr subtitle '•REMOTE ACCESS:' - menu_option '13' 'Remove' 'OctoEverywhere' - menu_option '14' 'Remove' 'Moonraker Obico' - menu_option '15' 'Remove' 'GuppyFLO' - menu_option '16' 'Remove' 'Mobileraker Companion' - menu_option '17' 'Remove' 'OctoApp Companion' - menu_option '18' 'Remove' 'SimplyPrint' + menu_option '12' 'Remove' 'OctoEverywhere' + menu_option '13' 'Remove' 'Moonraker Obico' + menu_option '14' 'Remove' 'GuppyFLO' + menu_option '15' 'Remove' 'Mobileraker Companion' + menu_option '16' 'Remove' 'OctoApp Companion' + menu_option '17' 'Remove' 'SimplyPrint' hr inner_line hr @@ -44,9 +43,9 @@ function remove_menu_ui_ke() { bottom_line } -function remove_menu_ke() { +function remove_menu_10se() { clear - remove_menu_ui_ke + remove_menu_ui_10se local remove_menu_opt while true; do read -p " ${white}Type your choice and validate with Enter: ${yellow}" remove_menu_opt @@ -57,7 +56,7 @@ function remove_menu_ke() { elif [ -d "$GUPPY_SCREEN_FOLDER" ]; then error_msg "Moonraker is needed to use Guppy Screen, please uninstall it first!" else - run "remove_moonraker_nginx" "remove_menu_ui_ke" + run "remove_moonraker_nginx" "remove_menu_ui_10se" fi;; 2) if [ ! -d "$FLUIDD_FOLDER" ]; then @@ -67,7 +66,7 @@ function remove_menu_ke() { echo -e " ${darkred}Please restore Creality Web Interface first if you want to remove Fluidd.${white}" echo else - run "remove_fluidd" "remove_menu_ui_ke" + run "remove_fluidd" "remove_menu_ui_10se" fi;; 3) if [ ! -d "$MAINSAIL_FOLDER" ]; then @@ -77,7 +76,7 @@ function remove_menu_ke() { echo -e " ${darkred}Please restore Creality Web Interface first if you want to remove Mainsail.${white}" echo else - run "remove_mainsail" "remove_menu_ui_ke" + run "remove_mainsail" "remove_menu_ui_10se" fi;; 4) if [ ! -f "$ENTWARE_FILE" ]; then @@ -93,7 +92,7 @@ function remove_menu_ke() { elif [ -f "$USB_CAMERA_FILE" ]; then error_msg "Entware is needed to use USB Camera Support, please uninstall it first!" else - run "remove_entware" "remove_menu_ui_ke" + run "remove_entware" "remove_menu_ui_10se" fi;; 5) if [ ! -f "$KLIPPER_SHELL_FILE" ]; then @@ -105,85 +104,79 @@ function remove_menu_ke() { elif [ -f "$GIT_BACKUP_FILE" ]; then error_msg "Klipper Gcode Shell Command is needed to use Git Backup, please uninstall it first!" else - run "remove_gcode_shell_command" "remove_menu_ui_ke" + run "remove_gcode_shell_command" "remove_menu_ui_10se" fi;; 6) if [ ! -d "$IMP_SHAPERS_FOLDER" ]; then error_msg "Improved Shapers Calibrations are not installed!" else - run "remove_improved_shapers" "remove_menu_ui_ke" + run "remove_improved_shapers" "remove_menu_ui_10se" fi;; 7) if [ ! -f "$SAVE_ZOFFSET_FILE" ]; then error_msg "Save Z-Offset Macros are not installed!" else - run "remove_save_zoffset_macros" "remove_menu_ui_ke" + run "remove_save_zoffset_macros" "remove_menu_ui_10se" fi;; 8) - if [ ! -f "$M600_SUPPORT_FILE" ]; then - error_msg "M600 Support is not installed!" - else - run "remove_m600_support" "remove_menu_ui_ke" - fi;; - 9) if [ ! -f "$GIT_BACKUP_FILE" ]; then error_msg "Git Backup is not installed!" else - run "remove_git_backup" "remove_menu_ui_ke" + run "remove_git_backup" "remove_menu_ui_10se" fi;; - 10) + 9) if [ ! -f "$TIMELAPSE_FILE" ]; then error_msg "Moonraker Timelapse is not installed!" else - run "remove_moonraker_timelapse" "remove_menu_ui_ke" + run "remove_moonraker_timelapse" "remove_menu_ui_10se" fi;; - 11) + 10) if [ ! -f "$CAMERA_SETTINGS_FILE" ]; then error_msg "Nebula Camera Settings Control is not installed!" else - run "remove_camera_settings_control" "remove_menu_ui_ke" + run "remove_camera_settings_control" "remove_menu_ui_10se" fi;; - 12) + 11) if [ ! -f "$USB_CAMERA_FILE" ]; then error_msg "USB Camera Support is not installed!" else - run "remove_usb_camera" "remove_menu_ui_3v3" + run "remove_usb_camera" "remove_menu_ui_10se" fi;; - 13) + 12) if [ ! -d "$OCTOEVERYWHERE_FOLDER" ]; then error_msg "OctoEverywhere is not installed!" else - run "remove_octoeverywhere" "remove_menu_ui_ke" + run "remove_octoeverywhere" "remove_menu_ui_10se" fi;; - 14) + 13) if [ ! -d "$MOONRAKER_OBICO_FOLDER" ]; then error_msg "Moonraker Obico is not installed!" else - run "remove_moonraker_obico" "remove_menu_ui_ke" + run "remove_moonraker_obico" "remove_menu_ui_10se" fi;; - 15) + 14) if [ ! -d "$GUPPYFLO_FOLDER" ]; then error_msg "GuppyFLO is not installed!" else - run "remove_guppyflo" "remove_menu_ui_ke" + run "remove_guppyflo" "remove_menu_ui_10se" fi;; - 16) + 15) if [ ! -d "$MOBILERAKER_COMPANION_FOLDER" ]; then error_msg "Mobileraker Companion is not installed!" else - run "remove_mobileraker_companion" "remove_menu_ui_ke" + run "remove_mobileraker_companion" "remove_menu_ui_10se" fi;; - 17) + 16) if [ ! -d "$OCTOAPP_COMPANION_FOLDER" ]; then error_msg "OctoApp Companion is not installed!" else - run "remove_octoapp_companion" "remove_menu_ui_ke" + run "remove_octoapp_companion" "remove_menu_ui_10se" fi;; - 18) + 17) if ! grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then error_msg "SimplyPrint is not installed!" else - run "remove_simplyprint" "remove_menu_ui_ke" + run "remove_simplyprint" "remove_menu_ui_10se" fi;; B|b) clear; main_menu; break;; @@ -193,5 +186,5 @@ function remove_menu_ke() { error_msg "Please select a correct choice!";; esac done - remove_menu_ke + remove_menu_10se } \ No newline at end of file diff --git a/scripts/menu/10SE/tools_menu_10SE.sh b/scripts/menu/10SE/tools_menu_10SE.sh new file mode 100755 index 0000000..79e7920 --- /dev/null +++ b/scripts/menu/10SE/tools_menu_10SE.sh @@ -0,0 +1,110 @@ +#!/bin/sh + +set -e + +function tools_menu_ui_10se() { + top_line + title '[ TOOLS MENU ]' "${yellow}" + inner_line + hr + menu_option ' 1' 'Prevent updating' 'Klipper configuration files' + menu_option ' 2' 'Allow updating' 'Klipper configuration files' + hr + menu_option ' 3' 'Enable' 'camera settings in Moonraker' + menu_option ' 4' 'Disable' 'camera settings in Moonraker' + hr + menu_option ' 5' 'Restart' 'Nginx service' + menu_option ' 6' 'Restart' 'Moonraker service' + menu_option ' 7' 'Restart' 'Klipper service' + hr + menu_option ' 8' 'Update' 'Entware packages' + hr + menu_option ' 9' 'Clear' 'cache' + menu_option '10' 'Clear' 'logs files' + hr + menu_option '11' 'Restore' 'a previous firmware' + hr + menu_option '12' 'Reset' 'factory settings' + hr + inner_line + hr + bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}" + bottom_menu_option 'q' 'Exit' "${darkred}" + hr + version_line "$(get_script_version)" + bottom_line +} + +function tools_menu_10se() { + clear + tools_menu_ui_10se + local tools_menu_opt + while true; do + read -p " ${white}Type your choice and validate with Enter: ${yellow}" tools_menu_opt + case "${tools_menu_opt}" in + 1) + if [ -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then + error_msg "Updating Klipper configuration files is already prevented!" + else + run "prevent_updating_klipper_files" "tools_menu_ui_10se" + fi;; + 2) + if [ ! -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then + error_msg "Updating Klipper configuration files is already allowed!" + else + run "allow_updating_klipper_files" "tools_menu_ui_10se" + fi;; + 3) + if grep -q "^\[webcam Camera\]$" "$MOONRAKER_CFG"; then + error_msg "Camera settings are alredy enabled in Moonraker!" + else + run "enable_camera_settings" "tools_menu_ui_10se" + fi;; + 4) + if grep -q "^#\[webcam Camera\]" "$MOONRAKER_CFG"; then + error_msg "Camera settings are alredy disabled in Moonraker!" + else + run "disable_camera_settings" "tools_menu_ui_10se" + fi;; + 5) + if [ ! -d "$NGINX_FOLDER" ]; then + error_msg "Nginx is not installed!" + else + run "restart_nginx_action" "tools_menu_ui_10se" + fi;; + 6) + if [ ! -d "$MOONRAKER_FOLDER" ]; then + error_msg "Moonraker is not installed!" + else + run "restart_moonraker_action" "tools_menu_ui_10se" + fi;; + 7) + if [ ! -f "$INITD_FOLDER"/S55klipper_service ]; then + error_msg "Klipper service is not present!" + else + run "restart_klipper_action" "tools_menu_ui_10se" + fi;; + 8) + if [ ! -f "$ENTWARE_FILE" ]; then + error_msg "Entware is not installed!" + else + run "update_entware_packages" "tools_menu_ui_10se" + fi;; + 9) + run "clear_cache" "tools_menu_ui_10see";; + 10) + run "clear_logs" "tools_menu_ui_10se";; + 11) + run "restore_previous_firmware" "tools_menu_ui_10se";; + 12) + run "reset_factory_settings" "tools_menu_ui_10se";; + B|b) + clear; main_menu; break;; + Q|q) + clear; exit 0;; + *) + error_msg "Please select a correct choice!";; + esac + done + tools_menu_10se +} diff --git a/scripts/menu/KE/customize_menu_KE.sh b/scripts/menu/3KE/customize_menu_3KE.sh similarity index 92% rename from scripts/menu/KE/customize_menu_KE.sh rename to scripts/menu/3KE/customize_menu_3KE.sh index c7a6170..5f29bff 100755 --- a/scripts/menu/KE/customize_menu_KE.sh +++ b/scripts/menu/3KE/customize_menu_3KE.sh @@ -2,7 +2,7 @@ set -e -function customize_menu_ui_ke() { +function customize_menu_ui_3ke() { top_line title '[ CUSTOMIZE MENU ]' "${yellow}" inner_line @@ -24,9 +24,9 @@ function customize_menu_ui_ke() { bottom_line } -function customize_menu_ke() { +function customize_menu_3ke() { clear - customize_menu_ui_ke + customize_menu_ui_3ke local customize_menu_opt while true; do read -p " ${white}Type your choice and validate with Enter: ${yellow}" customize_menu_opt @@ -39,7 +39,7 @@ function customize_menu_ke() { echo -e " ${darkred}Please restore Creality Web Interface first if you want to change the default Web Interface.${white}" echo else - run "remove_creality_web_interface" "customize_menu_ui_ke" + run "remove_creality_web_interface" "customize_menu_ui_3ke" fi;; 2) if [ -f "$CREALITY_WEB_FILE" ]; then @@ -47,7 +47,7 @@ function customize_menu_ke() { elif [ ! -f "$INITD_FOLDER"/S99start_app ]; then error_msg "Guppy Screen need to be removed first to restore Creality Web Interface!" else - run "restore_creality_web_interface" "customize_menu_ui_ke" + run "restore_creality_web_interface" "customize_menu_ui_3ke" fi;; 3) if [ -d "$GUPPY_SCREEN_FOLDER" ]; then @@ -63,13 +63,13 @@ function customize_menu_ke() { elif [ -d "$IMP_SHAPERS_FOLDER" ]; then error_msg "Please remove Improved Shapers Calibrations first, Guppy Screen already use it!" else - run "install_guppy_screen" "customize_menu_ui_ke" + run "install_guppy_screen" "customize_menu_ui_3ke" fi;; 4) if [ ! -d "$GUPPY_SCREEN_FOLDER" ]; then error_msg "Guppy Screen is not installed!" else - run "remove_guppy_screen" "customize_menu_ui_ke" + run "remove_guppy_screen" "customize_menu_ui_3ke" fi;; 5) if [ -f "$FLUIDD_LOGO_FILE" ]; then @@ -77,7 +77,7 @@ function customize_menu_ke() { elif [ ! -d "$FLUIDD_FOLDER" ]; then error_msg "Fluidd is needed, please install it first!" else - run "install_creality_dynamic_logos" "customize_menu_ui_ke" + run "install_creality_dynamic_logos" "customize_menu_ui_3ke" fi;; B|b) clear; main_menu; break;; @@ -87,5 +87,5 @@ function customize_menu_ke() { error_msg "Please select a correct choice!";; esac done - customize_menu_ke + customize_menu_3ke } diff --git a/scripts/menu/3KE/info_menu_3KE.sh b/scripts/menu/3KE/info_menu_3KE.sh new file mode 100755 index 0000000..75673ac --- /dev/null +++ b/scripts/menu/3KE/info_menu_3KE.sh @@ -0,0 +1,97 @@ +#!/bin/sh + +set -e + +function check_folder_3ke() { + local folder_path="$1" + if [ -d "$folder_path" ]; then + echo -e "${green}✓" + else + echo -e "${red}✗" + fi +} + +function check_file_3ke() { + local file_path="$1" + if [ -f "$file_path" ]; then + echo -e "${green}✓" + else + echo -e "${red}✗" + fi +} + +function check_simplyprint_3ke() { + if [ ! -f "$MOONRAKER_CFG" ]; then + echo -e "${red}✗" + elif grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then + echo -e "${green}✓" + else + echo -e "${red}✗" + fi +} + +function info_menu_ui_3ke() { + top_line + title '[ INFORMATION MENU ]' "${yellow}" + inner_line + hr + subtitle '•ESSENTIALS:' + info_line "$(check_folder_3ke "$MOONRAKER_FOLDER")" 'Moonraker & Nginx' + info_line "$(check_folder_3ke "$FLUIDD_FOLDER")" 'Fluidd' + info_line "$(check_folder_3ke "$MAINSAIL_FOLDER")" 'Mainsail' + hr + subtitle '•UTILITIES:' + info_line "$(check_file_3ke "$ENTWARE_FILE")" 'Entware' + info_line "$(check_file_3ke "$KLIPPER_SHELL_FILE")" 'Klipper Gcode Shell Command' + hr + subtitle '•IMPROVEMENTS:' + info_line "$(check_folder_3ke "$IMP_SHAPERS_FOLDER")" 'Improved Shapers Calibrations' + info_line "$(check_file_3ke "$SAVE_ZOFFSET_FILE")" 'Save Z-Offset Macros' + info_line "$(check_file_3ke "$SCREWS_ADJUST_FILE")" 'Screws Tilt Adjust Support' + info_line "$(check_file_3ke "$M600_SUPPORT_FILE")" 'M600 Support' + info_line "$(check_file_3ke "$GIT_BACKUP_FILE")" 'Git Backup' + hr + subtitle '•CAMERA:' + info_line "$(check_file_3ke "$TIMELAPSE_FILE")" 'Moonraker Timelapse' + info_line "$(check_file_3ke "$CAMERA_SETTINGS_FILE")" 'Nebula Camera Settings Control' + info_line "$(check_file_3ke "$USB_CAMERA_FILE")" 'USB Camera Support' + hr + subtitle '•REMOTE ACCESS:' + info_line "$(check_folder_3ke "$OCTOEVERYWHERE_FOLDER")" 'OctoEverywhere' + info_line "$(check_folder_3ke "$MOONRAKER_OBICO_FOLDER")" 'Obico' + info_line "$(check_folder_3ke "$GUPPYFLO_FOLDER")" 'GuppyFLO' + info_line "$(check_folder_3ke "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion' + info_line "$(check_folder_3ke "$OCTOAPP_COMPANION_FOLDER")" 'OctoApp Companion' + info_line "$(check_simplyprint_3ke)" 'SimplyPrint' + hr + subtitle '•CUSTOMIZATION:' + info_line "$(check_file_3ke "$CREALITY_WEB_FILE")" 'Creality Web Interface' + info_line "$(check_folder_3ke "$GUPPY_SCREEN_FOLDER")" 'Guppy Screen' + info_line "$(check_file_3ke "$FLUIDD_LOGO_FILE")" 'Creality Dynamic Logos for Fluidd' + hr + inner_line + hr + bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}" + bottom_menu_option 'q' 'Exit' "${darkred}" + hr + version_line "$(get_script_version)" + bottom_line +} + +function info_menu_3ke() { + clear + info_menu_ui_3ke + local info_menu_opt + while true; do + read -p " ${white}Type your choice and validate with Enter: ${yellow}" info_menu_opt + case "${info_menu_opt}" in + B|b) + clear; main_menu; break;; + Q|q) + clear; exit 0;; + *) + error_msg "Please select a correct choice!";; + esac + done + info_menu_3ke +} diff --git a/scripts/menu/3KE/install_menu_3KE.sh b/scripts/menu/3KE/install_menu_3KE.sh new file mode 100755 index 0000000..c9a6f1e --- /dev/null +++ b/scripts/menu/3KE/install_menu_3KE.sh @@ -0,0 +1,226 @@ +#!/bin/sh + +set -e + +function install_menu_ui_3ke() { + top_line + title '[ INSTALL MENU ]' "${yellow}" + inner_line + hr + subtitle '•ESSENTIALS:' + menu_option ' 1' 'Install' 'Moonraker and Nginx' + menu_option ' 2' 'Install' 'Fluidd (port 4408)' + menu_option ' 3' 'Install' 'Mainsail (port 4409)' + hr + subtitle '•UTILITIES:' + menu_option ' 4' 'Install' 'Entware' + menu_option ' 5' 'Install' 'Klipper Gcode Shell Command' + hr + subtitle '•IMPROVEMENTS:' + menu_option ' 6' 'Install' 'Improved Shapers Calibrations' + menu_option ' 7' 'Install' 'Save Z-Offset Macros' + menu_option ' 8' 'Install' 'M600 Support' + menu_option ' 9' 'Install' 'Screws Tilt Adjust Support' + menu_option '10' 'Install' 'Git Backup' + hr + subtitle '•CAMERA:' + menu_option '11' 'Install' 'Moonraker Timelapse' + menu_option '12' 'Install' 'Nebula Camera Settings Control' + menu_option '13' 'Install' 'USB Camera Support' + hr + subtitle '•REMOTE ACCESS:' + menu_option '14' 'Install' 'OctoEverywhere' + menu_option '15' 'Install' 'Moonraker Obico' + menu_option '16' 'Install' 'GuppyFLO' + menu_option '17' 'Install' 'Mobileraker Companion' + menu_option '18' 'Install' 'OctoApp Companion' + menu_option '19' 'Install' 'SimplyPrint' + hr + inner_line + hr + bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}" + bottom_menu_option 'q' 'Exit' "${darkred}" + hr + version_line "$(get_script_version)" + bottom_line +} + +function install_menu_3ke() { + clear + install_menu_ui_3ke + local install_menu_opt + while true; do + read -p " ${white}Type your choice and validate with Enter: ${yellow}" install_menu_opt + case "${install_menu_opt}" in + 1) + if [ -d "$MOONRAKER_FOLDER" ]; then + error_msg "Moonraker and Nginx are already installed!" + else + run "install_moonraker_nginx" "install_menu_ui_3ke" + fi;; + 2) + if [ -d "$FLUIDD_FOLDER" ]; then + error_msg "Fluidd is already installed!" + elif [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then + error_msg "Moonraker and Nginx are needed, please install them first!" + else + run "install_fluidd" "install_menu_ui_3ke" + fi;; + 3) + if [ -d "$MAINSAIL_FOLDER" ]; then + error_msg "Mainsail is already installed!" + elif [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then + error_msg "Moonraker and Nginx are needed, please install them first!" + else + run "install_mainsail" "install_menu_ui_3ke" + fi;; + 4) + if [ -f "$ENTWARE_FILE" ]; then + error_msg "Entware is already installed!" + else + run "install_entware" "install_menu_ui_3ke" + fi;; + 5) + if [ -f "$KLIPPER_SHELL_FILE" ]; then + error_msg "Klipper Gcode Shell Command is already installed!" + else + run "install_gcode_shell_command" "install_menu_ui_3ke" + fi;; + 6) + if [ -d "$IMP_SHAPERS_FOLDER" ]; then + error_msg "Improved Shapers Calibrations are already installed!" + elif [ -d "$GUPPY_SCREEN_FOLDER" ]; then + error_msg "Guppy Screen already has these features!" + elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then + error_msg "Klipper Gcode Shell Command is needed, please install it first!" + else + run "install_improved_shapers" "install_menu_ui_3ke" + fi;; + 7) + if [ -f "$SAVE_ZOFFSET_FILE" ]; then + error_msg "Save Z-Offset Macros are already installed!" + else + run "install_save_zoffset_macros" "install_menu_ui_3ke" + fi;; + 8) + if [ -f "$M600_SUPPORT_FILE" ]; then + error_msg "M600 Support is already installed!" + else + run "install_m600_support" "install_menu_ui_3ke" + fi;; + 9) + if [ -f "$SCREWS_ADJUST_FILE" ]; then + error_msg "Screws Tilt Adjust Support is already installed!" + else + run "install_screws_tilt_adjust" "install_menu_ui_3ke" + fi;; + 10) + if [ -f "$GIT_BACKUP_FILE" ]; then + error_msg "Git Backup is already installed!" + elif [ ! -f "$ENTWARE_FILE" ]; then + error_msg "Entware is needed, please install it first!" + elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then + error_msg "Klipper Gcode Shell Command is needed, please install it first!" + else + run "install_git_backup" "install_menu_ui_3ke" + fi;; + 11) + if [ -f "$TIMELAPSE_FILE" ]; then + error_msg "Moonraker Timelapse is already installed!" + elif [ ! -f "$ENTWARE_FILE" ]; then + error_msg "Entware is needed, please install it first!" + else + run "install_moonraker_timelapse" "install_menu_ui_3ke" + fi;; + 12) + if [ -f "$CAMERA_SETTINGS_FILE" ]; then + error_msg "Nebula Camera Settings Control is already installed!" + elif ! v4l2-ctl --list-devices | grep -q 'CCX2F3298'; then + error_msg "Nebula camera not detected, please plug it in!" + elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then + error_msg "Klipper Gcode Shell Command is needed, please install it first!" + else + run "install_camera_settings_control" "install_menu_ui_3ke" + fi;; + 13) + if [ -f "$USB_CAMERA_FILE" ]; then + error_msg "Camera USB Support is already installed!" + elif v4l2-ctl --list-devices | grep -qE 'CREALITY|CCX2F3298'; then + error_msg "It looks like you are using a Creality camera and it's not compatible!" + elif [ ! -f "$ENTWARE_FILE" ]; then + error_msg "Entware is needed, please install it first!" + else + run "install_usb_camera" "install_menu_ui_3ke" + fi;; + 14) + if [ -d "$OCTOEVERYWHERE_FOLDER" ]; then + error_msg "OctoEverywhere is already installed!" + elif [ ! -d "$MOONRAKER_FOLDER" ]; then + error_msg "Moonraker and Nginx are needed, please install them first!" + elif [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then + error_msg "Fluidd or Mainsail is needed, please install one of them first!" + elif [ ! -f "$ENTWARE_FILE" ]; then + error_msg "Entware is needed, please install it first!" + else + run "install_octoeverywhere" "install_menu_ui_3ke" + fi;; + 15) + if [ ! -d "$MOONRAKER_FOLDER" ]; then + error_msg "Moonraker and Nginx are needed, please install them first!" + elif [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then + error_msg "Fluidd or Mainsail is needed, please install one of them first!" + elif [ ! -f "$ENTWARE_FILE" ]; then + error_msg "Entware is needed, please install it first!" + else + run "install_moonraker_obico" "install_menu_ui_3ke" + fi;; + 16) + if [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then + error_msg "Moonraker and Nginx are needed, please install them first!" + else + run "install_guppyflo" "install_menu_ui_3ke" + fi;; + 17) + if [ -d "$MOBILERAKER_COMPANION_FOLDER" ]; then + error_msg "Mobileraker Companion is already installed!" + elif [ ! -d "$MOONRAKER_FOLDER" ]; then + error_msg "Moonraker and Nginx are needed, please install them first!" + elif [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then + error_msg "Fluidd or Mainsail is needed, please install one of them first!" + elif [ ! -f "$ENTWARE_FILE" ]; then + error_msg "Entware is needed, please install it first!" + else + run "install_mobileraker_companion" "install_menu_ui_3ke" + fi;; + 18) + if [ -d "$OCTOAPP_COMPANION_FOLDER" ]; then + error_msg "OctoApp Companion is already installed!" + elif [ ! -d "$MOONRAKER_FOLDER" ]; then + error_msg "Moonraker and Nginx are needed, please install them first!" + elif [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then + error_msg "Fluidd or Mainsail is needed, please install one of them first!" + elif [ ! -f "$ENTWARE_FILE" ]; then + error_msg "Entware is needed, please install it first!" + else + run "install_octoapp_companion" "install_menu_ui_3ke" + fi;; + 19) + if grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then + error_msg "SimplyPrint is already installed!" + elif [ ! -d "$MOONRAKER_FOLDER" ]; then + error_msg "Moonraker and Nginx are needed, please install them first!" + elif [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then + error_msg "Fluidd or Mainsail is needed, please install one of them first!" + else + run "install_simplyprint" "install_menu_ui_3ke" + fi;; + B|b) + clear; main_menu; break;; + Q|q) + clear; exit 0;; + *) + error_msg "Please select a correct choice!";; + esac + done + install_menu_3ke +} \ No newline at end of file diff --git a/scripts/menu/3KE/remove_menu_3KE.sh b/scripts/menu/3KE/remove_menu_3KE.sh new file mode 100755 index 0000000..e21cc87 --- /dev/null +++ b/scripts/menu/3KE/remove_menu_3KE.sh @@ -0,0 +1,204 @@ +#!/bin/sh + +set -e + +function remove_menu_ui_3ke() { + top_line + title '[ REMOVE MENU ]' "${yellow}" + inner_line + hr + subtitle '•ESSENTIALS:' + menu_option ' 1' 'Remove' 'Moonraker and Nginx' + menu_option ' 2' 'Remove' 'Fluidd (port 4408)' + menu_option ' 3' 'Remove' 'Mainsail (port 4409)' + hr + subtitle '•UTILITIES:' + menu_option ' 4' 'Remove' 'Entware' + menu_option ' 5' 'Remove' 'Klipper Gcode Shell Command' + hr + subtitle '•IMPROVEMENTS:' + menu_option ' 6' 'Remove' 'Improved Shapers Calibrations' + menu_option ' 7' 'Remove' 'Save Z-Offset Macros' + menu_option ' 8' 'Remove' 'M600 Support' + menu_option ' 9' 'Remove' 'Screws Tilt Adjust Support' + menu_option '10' 'Remove' 'Git Backup' + hr + subtitle '•CAMERA:' + menu_option '11' 'Remove' 'Moonraker Timelapse' + menu_option '12' 'Remove' 'Nebula Camera Settings Control' + menu_option '13' 'Remove' 'USB Camera Support' + hr + subtitle '•REMOTE ACCESS:' + menu_option '14' 'Remove' 'OctoEverywhere' + menu_option '15' 'Remove' 'Moonraker Obico' + menu_option '16' 'Remove' 'GuppyFLO' + menu_option '17' 'Remove' 'Mobileraker Companion' + menu_option '18' 'Remove' 'OctoApp Companion' + menu_option '19' 'Remove' 'SimplyPrint' + hr + inner_line + hr + bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}" + bottom_menu_option 'q' 'Exit' "${darkred}" + hr + version_line "$(get_script_version)" + bottom_line +} + +function remove_menu_3ke() { + clear + remove_menu_ui_3ke + local remove_menu_opt + while true; do + read -p " ${white}Type your choice and validate with Enter: ${yellow}" remove_menu_opt + case "${remove_menu_opt}" in + 1) + if [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then + error_msg "Moonraker and Nginx are not installed!" + elif [ -d "$GUPPY_SCREEN_FOLDER" ]; then + error_msg "Moonraker is needed to use Guppy Screen, please uninstall it first!" + else + run "remove_moonraker_nginx" "remove_menu_ui_3ke" + fi;; + 2) + if [ ! -d "$FLUIDD_FOLDER" ]; then + error_msg "Fluidd is not installed!" + elif [ ! -f "$CREALITY_WEB_FILE" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then + error_msg "Creality Web Interface is removed!" + echo -e " ${darkred}Please restore Creality Web Interface first if you want to remove Fluidd.${white}" + echo + else + run "remove_fluidd" "remove_menu_ui_3ke" + fi;; + 3) + if [ ! -d "$MAINSAIL_FOLDER" ]; then + error_msg "Mainsail is not installed!" + elif [ ! -f "$CREALITY_WEB_FILE" ] && [ ! -d "$FLUIDD_FOLDER" ]; then + error_msg "Creality Web Interface is removed!" + echo -e " ${darkred}Please restore Creality Web Interface first if you want to remove Mainsail.${white}" + echo + else + run "remove_mainsail" "remove_menu_ui_3ke" + fi;; + 4) + if [ ! -f "$ENTWARE_FILE" ]; then + error_msg "Entware is not installed!" + elif [ -f "$TIMELAPSE_FILE" ]; then + error_msg "Entware is needed to use Moonraker Timelapse, please uninstall it first!" + elif [ -f "$GIT_BACKUP_FILE" ]; then + error_msg "Entware is needed to use Git Backup, please uninstall it first!" + elif [ -d "$OCTOEVERYWHERE_FOLDER" ]; then + error_msg "Entware is needed to use OctoEverywhere, please uninstall it first!" + elif [ -d "$MOONRAKER_OBICO_FOLDER" ]; then + error_msg "Entware is needed to use Moonraker Obico, please uninstall it first!" + elif [ -f "$USB_CAMERA_FILE" ]; then + error_msg "Entware is needed to use USB Camera Support, please uninstall it first!" + else + run "remove_entware" "remove_menu_ui_3ke" + fi;; + 5) + if [ ! -f "$KLIPPER_SHELL_FILE" ]; then + error_msg "Klipper Gcode Shell Command is not installed!" + elif [ -d "$GUPPY_SCREEN_FOLDER" ]; then + error_msg "Klipper Gcode Shell Command is needed to use Guppy Screen, please uninstall it first!" + elif [ -d "$IMP_SHAPERS_FOLDER" ]; then + error_msg "Klipper Gcode Shell Command is needed to use Improved Shapers Calibrations, please uninstall it first!" + elif [ -f "$GIT_BACKUP_FILE" ]; then + error_msg "Klipper Gcode Shell Command is needed to use Git Backup, please uninstall it first!" + else + run "remove_gcode_shell_command" "remove_menu_ui_3ke" + fi;; + 6) + if [ ! -d "$IMP_SHAPERS_FOLDER" ]; then + error_msg "Improved Shapers Calibrations are not installed!" + else + run "remove_improved_shapers" "remove_menu_ui_3ke" + fi;; + 7) + if [ ! -f "$SAVE_ZOFFSET_FILE" ]; then + error_msg "Save Z-Offset Macros are not installed!" + else + run "remove_save_zoffset_macros" "remove_menu_ui_3ke" + fi;; + 8) + if [ ! -f "$M600_SUPPORT_FILE" ]; then + error_msg "M600 Support is not installed!" + else + run "remove_m600_support" "remove_menu_ui_3ke" + fi;; + 9) + if [ ! -f "$SCREWS_ADJUST_FILE" ]; then + error_msg "Screws Tilt Adjust Support is not installed!" + else + run "remove_screws_tilt_adjust" "remove_menu_ui_3ke" + fi;; + 10) + if [ ! -f "$GIT_BACKUP_FILE" ]; then + error_msg "Git Backup is not installed!" + else + run "remove_git_backup" "remove_menu_ui_3ke" + fi;; + 11) + if [ ! -f "$TIMELAPSE_FILE" ]; then + error_msg "Moonraker Timelapse is not installed!" + else + run "remove_moonraker_timelapse" "remove_menu_ui_3ke" + fi;; + 12) + if [ ! -f "$CAMERA_SETTINGS_FILE" ]; then + error_msg "Nebula Camera Settings Control is not installed!" + else + run "remove_camera_settings_control" "remove_menu_ui_3ke" + fi;; + 13) + if [ ! -f "$USB_CAMERA_FILE" ]; then + error_msg "USB Camera Support is not installed!" + else + run "remove_usb_camera" "remove_menu_ui_3ke" + fi;; + 14) + if [ ! -d "$OCTOEVERYWHERE_FOLDER" ]; then + error_msg "OctoEverywhere is not installed!" + else + run "remove_octoeverywhere" "remove_menu_ui_3ke" + fi;; + 15) + if [ ! -d "$MOONRAKER_OBICO_FOLDER" ]; then + error_msg "Moonraker Obico is not installed!" + else + run "remove_moonraker_obico" "remove_menu_ui_3ke" + fi;; + 16) + if [ ! -d "$GUPPYFLO_FOLDER" ]; then + error_msg "GuppyFLO is not installed!" + else + run "remove_guppyflo" "remove_menu_ui_3ke" + fi;; + 17) + if [ ! -d "$MOBILERAKER_COMPANION_FOLDER" ]; then + error_msg "Mobileraker Companion is not installed!" + else + run "remove_mobileraker_companion" "remove_menu_ui_3ke" + fi;; + 18) + if [ ! -d "$OCTOAPP_COMPANION_FOLDER" ]; then + error_msg "OctoApp Companion is not installed!" + else + run "remove_octoapp_companion" "remove_menu_ui_3ke" + fi;; + 19) + if ! grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then + error_msg "SimplyPrint is not installed!" + else + run "remove_simplyprint" "remove_menu_ui_3ke" + fi;; + B|b) + clear; main_menu; break;; + Q|q) + clear; exit 0;; + *) + error_msg "Please select a correct choice!";; + esac + done + remove_menu_3ke +} \ No newline at end of file diff --git a/scripts/menu/KE/tools_menu_KE.sh b/scripts/menu/3KE/tools_menu_3KE.sh similarity index 75% rename from scripts/menu/KE/tools_menu_KE.sh rename to scripts/menu/3KE/tools_menu_3KE.sh index b6e3987..e97622e 100755 --- a/scripts/menu/KE/tools_menu_KE.sh +++ b/scripts/menu/3KE/tools_menu_3KE.sh @@ -2,7 +2,7 @@ set -e -function tools_menu_ui_ke() { +function tools_menu_ui_3ke() { top_line title '[ TOOLS MENU ]' "${yellow}" inner_line @@ -35,9 +35,9 @@ function tools_menu_ui_ke() { bottom_line } -function tools_menu_ke() { +function tools_menu_3ke() { clear - tools_menu_ui_ke + tools_menu_ui_3ke local tools_menu_opt while true; do read -p " ${white}Type your choice and validate with Enter: ${yellow}" tools_menu_opt @@ -46,58 +46,58 @@ function tools_menu_ke() { if [ -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then error_msg "Updating Klipper configuration files is already prevented!" else - run "prevent_updating_klipper_files" "tools_menu_ui_ke" + run "prevent_updating_klipper_files" "tools_menu_ui_3ke" fi;; 2) if [ ! -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then error_msg "Updating Klipper configuration files is already allowed!" else - run "allow_updating_klipper_files" "tools_menu_ui_ke" + run "allow_updating_klipper_files" "tools_menu_ui_3ke" fi;; 3) if grep -q "^\[webcam Camera\]$" "$MOONRAKER_CFG"; then error_msg "Camera settings are alredy enabled in Moonraker!" else - run "enable_camera_settings" "tools_menu_ui_ke" + run "enable_camera_settings" "tools_menu_ui_3ke" fi;; 4) if grep -q "^#\[webcam Camera\]" "$MOONRAKER_CFG"; then error_msg "Camera settings are alredy disabled in Moonraker!" else - run "disable_camera_settings" "tools_menu_ui_ke" + run "disable_camera_settings" "tools_menu_ui_3ke" fi;; 5) if [ ! -d "$NGINX_FOLDER" ]; then error_msg "Nginx is not installed!" else - run "restart_nginx_action" "tools_menu_ui_ke" + run "restart_nginx_action" "tools_menu_ui_3ke" fi;; 6) if [ ! -d "$MOONRAKER_FOLDER" ]; then error_msg "Moonraker is not installed!" else - run "restart_moonraker_action" "tools_menu_ui_ke" + run "restart_moonraker_action" "tools_menu_ui_3ke" fi;; 7) if [ ! -f "$INITD_FOLDER"/S55klipper_service ]; then error_msg "Klipper service is not present!" else - run "restart_klipper_action" "tools_menu_ui_ke" + run "restart_klipper_action" "tools_menu_ui_3ke" fi;; 8) if [ ! -f "$ENTWARE_FILE" ]; then error_msg "Entware is not installed!" else - run "update_entware_packages" "tools_menu_ui_ke" + run "update_entware_packages" "tools_menu_ui_3ke" fi;; 9) - run "clear_cache" "tools_menu_ui_ke";; + run "clear_cache" "tools_menu_ui_3ke";; 10) - run "clear_logs" "tools_menu_ui_ke";; + run "clear_logs" "tools_menu_ui_3ke";; 11) - run "restore_previous_firmware" "tools_menu_ui_ke";; + run "restore_previous_firmware" "tools_menu_ui_3ke";; 12) - run "reset_factory_settings" "tools_menu_ui_ke";; + run "reset_factory_settings" "tools_menu_ui_3ke";; B|b) clear; main_menu; break;; Q|q) @@ -106,5 +106,5 @@ function tools_menu_ke() { error_msg "Please select a correct choice!";; esac done - tools_menu_ke + tools_menu_3ke } diff --git a/scripts/menu/KE/info_menu_KE.sh b/scripts/menu/KE/info_menu_KE.sh deleted file mode 100755 index 019c737..0000000 --- a/scripts/menu/KE/info_menu_KE.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/sh - -set -e - -function check_folder_ke() { - local folder_path="$1" - if [ -d "$folder_path" ]; then - echo -e "${green}✓" - else - echo -e "${red}✗" - fi -} - -function check_file_ke() { - local file_path="$1" - if [ -f "$file_path" ]; then - echo -e "${green}✓" - else - echo -e "${red}✗" - fi -} - -function check_simplyprint_ke() { - if [ ! -f "$MOONRAKER_CFG" ]; then - echo -e "${red}✗" - elif grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then - echo -e "${green}✓" - else - echo -e "${red}✗" - fi -} - -function info_menu_ui_ke() { - top_line - title '[ INFORMATION MENU ]' "${yellow}" - inner_line - hr - subtitle '•ESSENTIALS:' - info_line "$(check_folder_ke "$MOONRAKER_FOLDER")" 'Moonraker & Nginx' - info_line "$(check_folder_ke "$FLUIDD_FOLDER")" 'Fluidd' - info_line "$(check_folder_ke "$MAINSAIL_FOLDER")" 'Mainsail' - hr - subtitle '•UTILITIES:' - info_line "$(check_file_ke "$ENTWARE_FILE")" 'Entware' - info_line "$(check_file_ke "$KLIPPER_SHELL_FILE")" 'Klipper Gcode Shell Command' - hr - subtitle '•IMPROVEMENTS:' - info_line "$(check_folder_ke "$IMP_SHAPERS_FOLDER")" 'Improved Shapers Calibrations' - info_line "$(check_file_ke "$SAVE_ZOFFSET_FILE")" 'Save Z-Offset Macros' - info_line "$(check_file_ke "$GIT_BACKUP_FILE")" 'Git Backup' - hr - subtitle '•CAMERA:' - info_line "$(check_file_ke "$TIMELAPSE_FILE")" 'Moonraker Timelapse' - info_line "$(check_file_ke "$CAMERA_SETTINGS_FILE")" 'Nebula Camera Settings Control' - info_line "$(check_file_ke "$USB_CAMERA_FILE")" 'USB Camera Support' - hr - subtitle '•REMOTE ACCESS:' - info_line "$(check_folder_ke "$OCTOEVERYWHERE_FOLDER")" 'OctoEverywhere' - info_line "$(check_folder_ke "$MOONRAKER_OBICO_FOLDER")" 'Obico' - info_line "$(check_folder_ke "$GUPPYFLO_FOLDER")" 'GuppyFLO' - info_line "$(check_folder_ke "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion' - info_line "$(check_folder_ke "$OCTOAPP_COMPANION_FOLDER")" 'OctoApp Companion' - info_line "$(check_simplyprint_ke)" 'SimplyPrint' - hr - subtitle '•CUSTOMIZATION:' - info_line "$(check_file_ke "$CREALITY_WEB_FILE")" 'Creality Web Interface' - info_line "$(check_folder_ke "$GUPPY_SCREEN_FOLDER")" 'Guppy Screen' - info_line "$(check_file_ke "$FLUIDD_LOGO_FILE")" 'Creality Dynamic Logos for Fluidd' - hr - inner_line - hr - bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}" - bottom_menu_option 'q' 'Exit' "${darkred}" - hr - version_line "$(get_script_version)" - bottom_line -} - -function info_menu_ke() { - clear - info_menu_ui_ke - local info_menu_opt - while true; do - read -p " ${white}Type your choice and validate with Enter: ${yellow}" info_menu_opt - case "${info_menu_opt}" in - B|b) - clear; main_menu; break;; - Q|q) - clear; exit 0;; - *) - error_msg "Please select a correct choice!";; - esac - done - info_menu_ke -} diff --git a/scripts/menu/main_menu.sh b/scripts/menu/main_menu.sh index 79d4f5b..7c71771 100755 --- a/scripts/menu/main_menu.sh +++ b/scripts/menu/main_menu.sh @@ -85,8 +85,10 @@ function main_menu() { install_menu_k1 elif [ "$model" = "3V3" ]; then install_menu_3v3 + elif [ "$model" = "3KE" ]; then + install_menu_3ke else - install_menu_ke + install_menu_10se fi break;; 2) clear @@ -94,8 +96,10 @@ function main_menu() { remove_menu_k1 elif [ "$model" = "3V3" ]; then remove_menu_3v3 + elif [ "$model" = "3KE" ]; then + remove_menu_3ke else - remove_menu_ke + remove_menu_10se fi break;; 3) clear @@ -103,8 +107,10 @@ function main_menu() { customize_menu_k1 elif [ "$model" = "3V3" ]; then customize_menu_3v3 + elif [ "$model" = "3KE" ]; then + customize_menu_3ke else - customize_menu_ke + customize_menu_10se fi break;; 4) clear @@ -115,8 +121,10 @@ function main_menu() { tools_menu_k1 elif [ "$model" = "3V3" ]; then tools_menu_3v3 + elif [ "$model" = "3KE" ]; then + tools_menu_3ke else - tools_menu_ke + tools_menu_10se fi main_ui;; 6) clear @@ -124,8 +132,10 @@ function main_menu() { info_menu_k1 elif [ "$model" = "3V3" ]; then info_menu_3v3 + elif [ "$model" = "3KE" ]; then + info_menu_3ke else - info_menu_ke + info_menu_10se fi break;; 7) clear diff --git a/scripts/paths.sh b/scripts/paths.sh index 1f5e465..785e935 100755 --- a/scripts/paths.sh +++ b/scripts/paths.sh @@ -115,6 +115,7 @@ function set_paths() { SCREWS_ADJUST_URL="${HS_FILES}/screws-tilt-adjust/screws_tilt_adjust.py" SCREWS_ADJUST_K1_URL="${HS_FILES}/screws-tilt-adjust/screws-tilt-adjust-k1.cfg" SCREWS_ADJUST_K1M_URL="${HS_FILES}/screws-tilt-adjust/screws-tilt-adjust-k1max.cfg" + SCREWS_ADJUST_3KE_URL="${HS_FILES}/screws-tilt-adjust/screws-tilt-adjust-3ke.cfg" # M600 Support # M600_SUPPORT_FILE="${HS_CONFIG_FOLDER}/M600-support.cfg" diff --git a/scripts/screws_tilt_adjust.sh b/scripts/screws_tilt_adjust.sh index 11e9ec0..d092b29 100755 --- a/scripts/screws_tilt_adjust.sh +++ b/scripts/screws_tilt_adjust.sh @@ -36,24 +36,29 @@ function install_screws_tilt_adjust(){ mv "$KLIPPER_EXTRAS_FOLDER"/screws_tilt_adjust.pyc "$HS_BACKUP_FOLDER"/screws-tilt-adjust fi echo - local printer_choice - while true; do - read -p " ${white}Do you want install it for ${yellow}K1${white} or ${yellow}K1 Max${white}? (${yellow}k1${white}/${yellow}k1max${white}): ${yellow}" printer_choice - case "${printer_choice}" in - K1|k1) - echo -e "${white}" - echo -e "Info: Linking files..." - ln -sf "$SCREWS_ADJUST_K1_URL" "$HS_CONFIG_FOLDER"/screws-tilt-adjust.cfg - break;; - K1MAX|k1max) - echo -e "${white}" - echo -e "Info: Linking files..." - ln -sf "$SCREWS_ADJUST_K1M_URL" "$HS_CONFIG_FOLDER"/screws-tilt-adjust.cfg - break;; - *) - error_msg "Please select a correct choice!";; - esac - done + if [ "$model" = "K1" ]; then + local printer_choice + while true; do + read -p " ${white}Do you want install it for ${yellow}K1${white} or ${yellow}K1 Max${white}? (${yellow}k1${white}/${yellow}k1max${white}): ${yellow}" printer_choice + case "${printer_choice}" in + K1|k1) + echo -e "${white}" + echo -e "Info: Linking files..." + ln -sf "$SCREWS_ADJUST_K1_URL" "$HS_CONFIG_FOLDER"/screws-tilt-adjust.cfg + break;; + K1MAX|k1max) + echo -e "${white}" + echo -e "Info: Linking files..." + ln -sf "$SCREWS_ADJUST_K1M_URL" "$HS_CONFIG_FOLDER"/screws-tilt-adjust.cfg + break;; + *) + error_msg "Please select a correct choice!";; + esac + done + else + echo -e "Info: Linking files..." + ln -sf "$SCREWS_ADJUST_3KE_URL" "$HS_CONFIG_FOLDER"/screws-tilt-adjust.cfg + fi ln -sf "$SCREWS_ADJUST_URL" "$KLIPPER_EXTRAS_FOLDER"/screws_tilt_adjust.py if grep -q "include Helper-Script/screws-tilt-adjust" "$PRINTER_CFG" ; then echo -e "Info: Screws Tilt Adjust Support configurations are already enabled in printer.cfg file..."