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

@ -0,0 +1,108 @@
#!/bin/sh
set -e
function customize_menu_ui_k1() {
top_line
title '[ CUSTOMIZE MENU ]' "${yellow}"
inner_line
hr
menu_option '1' 'Install' 'Custom Boot Display'
menu_option '2' 'Remove' 'Custom Boot Display'
hr
menu_option '3' 'Remove' 'Creality Web Interface'
menu_option '4' 'Restore' 'Creality Web Interface'
hr
menu_option '5' 'Install' 'Guppy Screen'
menu_option '6' 'Remove' 'Guppy Screen'
hr
menu_option '7' '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_k1() {
clear
customize_menu_ui_k1
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 [ -f "$BOOT_DISPLAY_FILE" ]; then
error_msg "Custom Boot Display is already installed!"
elif [ ! -d "$BOOT_DISPLAY_FOLDER" ]; then
error_msg "Please use latest firmware to install Custom Boot Display!"
else
run "install_custom_boot_display" "customize_menu_ui_k1"
fi;;
2)
if [ ! -f "$BOOT_DISPLAY_FILE" ]; then
error_msg "Custom Boot Display is not installed!"
elif [ ! -d "$BOOT_DISPLAY_FOLDER" ]; then
error_msg "Please use latest firmware to restore Stock Boot Display!"
else
run "remove_custom_boot_display" "customize_menu_ui_k1"
fi;;
3)
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_k1"
fi;;
4)
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_k1"
fi;;
5)
if [ -d "$GUPPY_SCREEN_FOLDER" ]; then
error_msg "Guppy Screen is already installed!"
echo -e " ${darkred}Please remove Guppy Screen first if you want to change the theme.${white}"
echo
elif [ -d "$IMP_SHAPERS_FOLDER" ]; then
error_msg "Please remove Improved Shapers Calibrations first, Guppy Screen already use it!"
elif [ ! -f /lib/ld-2.29.so ]; then
error_msg "Make sure you're running 1.3.x.x firmware version!"
elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then
error_msg "Klipper Gcode Shell Command is needed, please install it first!"
else
run "install_guppy_screen" "customize_menu_ui_k1"
fi;;
6)
if [ ! -d "$GUPPY_SCREEN_FOLDER" ]; then
error_msg "Guppy Screen is not installed!"
else
run "remove_guppy_screen" "customize_menu_ui_k1"
fi;;
7)
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_k1"
fi;;
B|b)
clear; main_menu; break;;
Q|q)
clear; exit 0;;
*)
error_msg "Please select a correct choice!";;
esac
done
customize_menu_k1
}

101
scripts/menu/K1/info_menu_K1.sh Executable file
View file

@ -0,0 +1,101 @@
#!/bin/sh
set -e
function check_folder_k1() {
local folder_path="$1"
if [ -d "$folder_path" ]; then
echo -e "${green}"
else
echo -e "${red}"
fi
}
function check_file_k1() {
local file_path="$1"
if [ -f "$file_path" ]; then
echo -e "${green}"
else
echo -e "${red}"
fi
}
function check_simplyprint_k1() {
if grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
echo -e "${green}"
else
echo -e "${red}"
fi
}
function info_menu_ui_k1() {
top_line
title '[ INFORMATIONS MENU ]' "${yellow}"
inner_line
hr
subtitle '•ESSENTIALS:'
info_line "$(check_folder_k1 "$MOONRAKER_FOLDER")" 'Moonraker & Nginx'
info_line "$(check_folder_k1 "$FLUIDD_FOLDER")" 'Fluidd'
info_line "$(check_folder_k1 "$MAINSAIL_FOLDER")" 'Mainsail'
hr
subtitle '•UTILITIES:'
info_line "$(check_file_k1 "$ENTWARE_FILE")" 'Entware'
info_line "$(check_file_k1 "$KLIPPER_SHELL_FILE")" 'Klipper Gcode Shell Command'
hr
subtitle '•IMPROVEMENTS:'
info_line "$(check_folder_k1 "$KAMP_FOLDER")" 'Klipper Adaptive Meshing & Purging'
info_line "$(check_file_k1 "$BUZZER_FILE")" 'Buzzer Support'
info_line "$(check_folder_k1 "$NOZZLE_CLEANING_FOLDER")" 'Nozzle Cleaning Fan Control'
info_line "$(check_file_k1 "$FAN_CONTROLS_FILE")" 'Fans Control Macros'
info_line "$(check_folder_k1 "$IMP_SHAPERS_FOLDER")" 'Improved Shapers Calibrations'
info_line "$(check_file_k1 "$USEFUL_MACROS_FILE")" 'Useful Macros'
info_line "$(check_file_k1 "$SAVE_ZOFFSET_FILE")" 'Save Z-Offset Macros'
info_line "$(check_file_k1 "$SCREWS_ADJUST_FILE")" 'Screws Tilt Adjust Support'
info_line "$(check_file_k1 "$M600_SUPPORT_FILE")" 'M600 Support'
info_line "$(check_file_k1 "$GIT_BACKUP_FILE")" 'Git Backup'
hr
subtitle '•CAMERA:'
info_line "$(check_file_k1 "$TIMELAPSE_FILE")" 'Moonraker Timelapse'
info_line "$(check_file_k1 "$CAMERA_SETTINGS_FILE")" 'Camera Settings Control'
info_line "$(check_file_k1 "$USB_CAMERA_FILE")" 'USB Camera Support'
hr
subtitle '•REMOTE ACCESS:'
info_line "$(check_folder_k1 "$OCTOEVERYWHERE_FOLDER")" 'OctoEverywhere'
info_line "$(check_folder_k1 "$MOONRAKER_OBICO_FOLDER")" 'Obico'
info_line "$(check_folder_k1 "$GUPPYFLO_FOLDER")" 'GuppyFLO'
info_line "$(check_folder_k1 "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion'
info_line "$(check_folder_k1 "$OCTOAPP_COMPANION_FOLDER")" 'OctoApp Companion'
info_line "$(check_simplyprint_k1)" 'SimplyPrint'
hr
subtitle '•CUSTOMIZATION:'
info_line "$(check_file_k1 "$BOOT_DISPLAY_FILE")" 'Custom Boot Display'
info_line "$(check_file_k1 "$CREALITY_WEB_FILE")" 'Creality Web Interface'
info_line "$(check_folder_k1 "$GUPPY_SCREEN_FOLDER")" 'Guppy Screen'
info_line "$(check_file_k1 "$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_k1() {
clear
info_menu_ui_k1
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_k1
}

View file

@ -0,0 +1,263 @@
#!/bin/sh
set -e
function install_menu_ui_k1() {
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' 'Klipper Adaptive Meshing & Purging'
menu_option ' 7' 'Install' 'Buzzer Support'
menu_option ' 8' 'Install' 'Nozzle Cleaning Fan Control'
menu_option ' 9' 'Install' 'Fans Control Macros'
menu_option '10' 'Install' 'Improved Shapers Calibrations'
menu_option '11' 'Install' 'Useful Macros'
menu_option '12' 'Install' 'Save Z-Offset Macros'
menu_option '13' 'Install' 'Screws Tilt Adjust Support'
menu_option '14' 'Install' 'M600 Support'
menu_option '15' 'Install' 'Git Backup'
hr
subtitle '•CAMERA:'
menu_option '16' 'Install' 'Moonraker Timelapse'
menu_option '17' 'Install' 'Camera Settings Control'
menu_option '18' 'Install' 'USB Camera Support'
hr
subtitle '•REMOTE ACCESS:'
menu_option '19' 'Install' 'OctoEverywhere'
menu_option '20' 'Install' 'Moonraker Obico'
menu_option '21' 'Install' 'GuppyFLO'
menu_option '22' 'Install' 'Mobileraker Companion'
menu_option '23' 'Install' 'OctoApp Companion'
menu_option '24' '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_k1() {
clear
install_menu_ui_k1
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_k1"
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_k1"
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_k1"
fi;;
4)
if [ -f "$ENTWARE_FILE" ]; then
error_msg "Entware is already installed!"
else
run "install_entware" "install_menu_ui_k1"
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_k1"
fi;;
6)
if [ -d "$KAMP_FOLDER" ]; then
error_msg "Klipper Adaptive Meshing & Purging is already installed!"
else
run "install_kamp" "install_menu_ui_k1"
fi;;
7)
if [ -f "$BUZZER_FILE" ]; then
error_msg "Buzzer Support is already installed!"
elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then
error_msg "Klipper Gcode Shell Command is needed, please install it first!"
else
run "install_buzzer_support" "install_menu_ui_k1"
fi;;
8)
if [ -d "$NOZZLE_CLEANING_FOLDER" ]; then
error_msg "Nozzle Cleaning Fan Control is already installed!"
else
run "install_nozzle_cleaning_fan_control" "install_menu_ui_k1"
fi;;
9)
if [ -f "$FAN_CONTROLS_FILE" ]; then
error_msg "Fans Control Macros are already installed!"
else
run "install_fans_control_macros" "install_menu_ui_k1"
fi;;
10)
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_k1"
fi;;
11)
if [ -f "$USEFUL_MACROS_FILE" ]; then
error_msg "Useful Macros are already installed!"
elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then
error_msg "Klipper Gcode Shell Command is needed, please install it first!"
else
run "install_useful_macros" "install_menu_ui_k1"
fi;;
12)
if [ -f "$SAVE_ZOFFSET_FILE" ]; then
error_msg "Save Z-Offset Macros are already installed!"
else
run "install_save_zoffset_macros" "install_menu_ui_k1"
fi;;
13)
if [ -f "$SCREWS_ADJUST_FILE" ]; then
error_msg "Screws Tilt Adjust Support is already installed!"
else
run "install_screws_tilt_adjust" "install_menu_ui_k1"
fi;;
14)
if [ -f "$M600_SUPPORT_FILE" ]; then
error_msg "M600 Support is already installed!"
else
run "install_m600_support" "install_menu_ui_k1"
fi;;
15)
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_k1"
fi;;
16)
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_k1"
fi;;
17)
if [ -f "$CAMERA_SETTINGS_FILE" ]; then
error_msg "Camera Settings Control is already installed!"
elif v4l2-ctl --list-devices | grep -q 'CCX2F3299' && [ ! -f "$INITD_FOLDER"/S50usb_camera ]; then
error_msg "This is not compatible with the new hardware version of the camera!"
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_k1"
fi;;
18)
if [ -f "$USB_CAMERA_FILE" ]; then
error_msg "Camera USB Support is already installed!"
elif [ ! -f "$ENTWARE_FILE" ]; then
error_msg "Entware is needed, please install it first!"
else
run "install_usb_camera" "install_menu_ui_k1"
fi;;
19)
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_k1"
fi;;
20)
if [ -d "$MOONRAKER_OBICO_FOLDER" ]; then
error_msg "Moonraker Obico 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_moonraker_obico" "install_menu_ui_k1"
fi;;
21)
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_k1"
fi;;
22)
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!"
else
run "install_mobileraker_companion" "install_menu_ui_k1"
fi;;
23)
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_k1"
fi;;
24)
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_k1"
fi;;
B|b)
clear; main_menu; break;;
Q|q)
clear; exit 0;;
*)
error_msg "Please select a correct choice!";;
esac
done
install_menu_k1
}

243
scripts/menu/K1/remove_menu_K1.sh Executable file
View file

@ -0,0 +1,243 @@
#!/bin/sh
set -e
function remove_menu_ui_k1() {
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' 'Klipper Adaptive Meshing & Purging'
menu_option ' 7' 'Remove' 'Buzzer Support'
menu_option ' 8' 'Remove' 'Nozzle Cleaning Fan Control'
menu_option ' 9' 'Remove' 'Fans Control Macros'
menu_option '10' 'Remove' 'Improved Shapers Calibrations'
menu_option '11' 'Remove' 'Useful Macros'
menu_option '12' 'Remove' 'Save Z-Offset Macros'
menu_option '13' 'Remove' 'Screws Tilt Adjust Support'
menu_option '14' 'Remove' 'M600 Support'
menu_option '15' 'Remove' 'Git Backup'
hr
subtitle '•CAMERA:'
menu_option '16' 'Remove' 'Moonraker Timelapse'
menu_option '17' 'Remove' 'Camera Settings Control'
menu_option '18' 'Remove' 'USB Camera Support'
hr
subtitle '•REMOTE ACCESS:'
menu_option '19' 'Remove' 'OctoEverywhere'
menu_option '20' 'Remove' 'Moonraker Obico'
menu_option '21' 'Remove' 'GuppyFLO'
menu_option '22' 'Remove' 'Mobileraker Companion'
menu_option '23' 'Remove' 'OctoApp Companion'
menu_option '24' '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_k1() {
clear
remove_menu_ui_k1
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!"
else
run "remove_moonraker_nginx" "remove_menu_ui_k1"
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_k1"
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_k1"
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_k1"
fi;;
5)
if [ ! -f "$KLIPPER_SHELL_FILE" ]; then
error_msg "Klipper Gcode Shell Command is not installed!"
elif [ -f "$BUZZER_FILE" ]; then
error_msg "Klipper Gcode Shell Command is needed to use Buzzer Support, please uninstall it first!"
elif [ -f "$CAMERA_SETTINGS_FILE" ]; then
error_msg "Klipper Gcode Shell Command is needed to use Camera Settings Control, please uninstall it first!"
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!"
elif [ -f "$USEFUL_MACROS_FILE" ]; then
error_msg "Klipper Gcode Shell Command is needed to use Useful Macros, please uninstall it first!"
else
run "remove_gcode_shell_command" "remove_menu_ui_k1"
fi;;
6)
if [ ! -d "$KAMP_FOLDER" ]; then
error_msg "Klipper Adaptive Meshing & Purging is not installed!"
else
run "remove_kamp" "remove_menu_ui_k1"
fi;;
7)
if [ ! -f "$BUZZER_FILE" ]; then
error_msg "Buzzer Support is not installed!"
else
run "remove_buzzer_support" "remove_menu_ui_k1"
fi;;
8)
if [ ! -d "$NOZZLE_CLEANING_FOLDER" ]; then
error_msg "Nozzle Cleaning Fan Control is not installed!"
else
run "remove_nozzle_cleaning_fan_control" "remove_menu_ui_k1"
fi;;
9)
if [ ! -f "$FAN_CONTROLS_FILE" ]; then
error_msg "Fans Control Macros are not installed!"
else
run "remove_fans_control_macros" "remove_menu_ui_k1"
fi;;
10)
if [ ! -d "$IMP_SHAPERS_FOLDER" ]; then
error_msg "Improved Shapers Calibrations are not installed!"
else
run "remove_improved_shapers" "remove_menu_ui_k1"
fi;;
11)
if [ ! -f "$USEFUL_MACROS_FILE" ]; then
error_msg "Useful Macros are not installed!"
else
run "remove_useful_macros" "remove_menu_ui_k1"
fi;;
12)
if [ ! -f "$SAVE_ZOFFSET_FILE" ]; then
error_msg "Save Z-Offset Macros are not installed!"
else
run "remove_save_zoffset_macros" "remove_menu_ui_k1"
fi;;
13)
if [ ! -f "$SCREWS_ADJUST_FILE" ]; then
error_msg "Screws Tilt Adjust Support is not installed!"
else
run "remove_screws_tilt_adjust" "remove_menu_ui_k1"
fi;;
14)
if [ ! -f "$M600_SUPPORT_FILE" ]; then
error_msg "M600 Support is not installed!"
else
run "remove_m600_support" "remove_menu_ui_k1"
fi;;
15)
if [ ! -f "$GIT_BACKUP_FILE" ]; then
error_msg "Git Backup is not installed!"
else
run "remove_git_backup" "remove_menu_ui_k1"
fi;;
16)
if [ ! -f "$TIMELAPSE_FILE" ]; then
error_msg "Moonraker Timelapse is not installed!"
else
run "remove_moonraker_timelapse" "remove_menu_ui_k1"
fi;;
17)
if [ ! -f "$CAMERA_SETTINGS_FILE" ]; then
error_msg "Camera Settings Control is not installed!"
else
run "remove_camera_settings_control" "remove_menu_ui_k1"
fi;;
18)
if [ ! -f "$USB_CAMERA_FILE" ]; then
error_msg "USB Camera Support is not installed!"
else
run "remove_usb_camera" "remove_menu_ui_k1"
fi;;
19)
if [ ! -d "$OCTOEVERYWHERE_FOLDER" ]; then
error_msg "OctoEverywhere is not installed!"
else
run "remove_octoeverywhere" "remove_menu_ui_k1"
fi;;
20)
if [ ! -d "$MOONRAKER_OBICO_FOLDER" ]; then
error_msg "Moonraker Obico is not installed!"
else
run "remove_moonraker_obico" "remove_menu_ui_k1"
fi;;
21)
if [ ! -d "$GUPPYFLO_FOLDER" ]; then
error_msg "GuppyFLO is not installed!"
else
run "remove_guppyflo" "remove_menu_ui_k1"
fi;;
22)
if [ ! -d "$MOBILERAKER_COMPANION_FOLDER" ]; then
error_msg "Mobileraker Companion is not installed!"
else
run "remove_mobileraker_companion" "remove_menu_ui_k1"
fi;;
23)
if [ ! -d "$OCTOAPP_COMPANION_FOLDER" ]; then
error_msg "OctoApp Companion is not installed!"
else
run "remove_octoapp_companion" "remove_menu_ui_k1"
fi;;
24)
if ! grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
error_msg "SimplyPrint is not installed!"
else
run "remove_simplyprint" "remove_menu_ui_k1"
fi;;
B|b)
clear; main_menu; break;;
Q|q)
clear; exit 0;;
*)
error_msg "Please select a correct choice!";;
esac
done
remove_menu_k1
}

115
scripts/menu/K1/tools_menu_K1.sh Executable file
View file

@ -0,0 +1,115 @@
#!/bin/sh
set -e
function tools_menu_ui_k1() {
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'
menu_option ' 3' 'Fix' 'printing Gcode files from folder'
hr
menu_option ' 4' 'Enable' 'camera settings in Moonraker'
menu_option ' 5' 'Disable' 'camera settings in Moonraker'
hr
menu_option ' 6' 'Restart' 'Nginx service'
menu_option ' 7' 'Restart' 'Moonraker service'
menu_option ' 8' 'Restart' 'Klipper service'
hr
menu_option ' 9' 'Update' 'Entware packages'
hr
menu_option '10' 'Clear' 'cache'
menu_option '11' 'Clear' 'logs files'
hr
menu_option '12' 'Restore' 'a previous firmware'
hr
menu_option '13' '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_k1() {
clear
tools_menu_ui_k1
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_k1"
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_k1"
fi;;
3)
if [ -f "$KLIPPER_KLIPPY_FOLDER"/gcode.py ]; then
run "printing_gcode_from_folder" "tools_menu_ui_k1"
fi;;
4)
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_k1"
fi;;
5)
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_k1"
fi;;
6)
if [ ! -d "$NGINX_FOLDER" ]; then
error_msg "Nginx is not installed!"
else
run "restart_nginx_action" "tools_menu_ui_k1"
fi;;
7)
if [ ! -d "$MOONRAKER_FOLDER" ]; then
error_msg "Moonraker is not installed!"
else
run "restart_moonraker_action" "tools_menu_ui_k1"
fi;;
8)
if [ ! -f "$INITD_FOLDER"/S55klipper_service ]; then
error_msg "Klipper service is not present!"
else
run "restart_klipper_action" "tools_menu_ui_k1"
fi;;
9)
if [ ! -f "$ENTWARE_FILE" ]; then
error_msg "Entware is not installed!"
else
run "update_entware_packages" "tools_menu_ui_k1"
fi;;
10)
run "clear_cache" "tools_menu_ui_k1";;
11)
run "clear_logs" "tools_menu_ui_k1";;
12)
run "restore_previous_firmware" "tools_menu_ui_k1";;
13)
run "reset_factory_settings" "tools_menu_ui_k1";;
B|b)
clear; main_menu; break;;
Q|q)
clear; exit 0;;
*)
error_msg "Please select a correct choice!";;
esac
done
tools_menu_k1
}