├── .github
└── FUNDING.yml
├── .gitignore
├── LICENSE
├── README.md
├── files
├── boot-display
│ ├── k1_boot_display.tar.gz
│ ├── k1max_boot_display.tar.gz
│ └── stock_boot_display.tar.gz
├── buzzer-support
│ ├── beep.mp3
│ └── buzzer-support.cfg
├── camera-settings
│ ├── camera-settings-nebula.cfg
│ └── camera-settings.cfg
├── entware
│ └── generic.sh
├── fixes
│ ├── curl
│ ├── gcode.py
│ ├── gcode_3v3.py
│ ├── sudo
│ ├── supervisorctl
│ └── systemctl
├── fluidd-logos
│ ├── config.json
│ ├── logo_creality_v1.svg
│ └── logo_creality_v2.svg
├── gcode-shell-command
│ └── gcode_shell_command.py
├── git-backup
│ ├── S52Git-Backup
│ ├── git-backup.cfg
│ └── git-backup.sh
├── guppy-screen
│ ├── guppy-update.sh
│ ├── guppy_update-3v3.cfg
│ ├── guppy_update.cfg
│ └── guppyconfig-3v3.json
├── improved-shapers
│ ├── calibrate_shaper_config.py
│ ├── delete_csv.sh
│ ├── delete_graph.sh
│ ├── ft2font.cpython-38-mipsel-linux-gnu.so
│ ├── improved-shapers-3v3.cfg
│ ├── improved-shapers.cfg
│ └── scripts
│ │ ├── calibrate_shaper.py
│ │ ├── graph_belts.py
│ │ ├── shaper_calibrate.py
│ │ └── shaper_defs.py
├── kamp
│ ├── Adaptive_Meshing.cfg
│ ├── KAMP_Settings.cfg
│ ├── Line_Purge.cfg
│ ├── Prusa_Slicer.cfg
│ ├── Smart_Park.cfg
│ ├── Start_Print-3v3.cfg
│ └── Start_Print.cfg
├── klipper-virtual-pins
│ └── virtual_pins.py
├── macros
│ ├── M600-support-3v3.cfg
│ ├── M600-support-ke.cfg
│ ├── M600-support.cfg
│ ├── fans-control.cfg
│ ├── save-zoffset.cfg
│ ├── useful-macros-3v3.cfg
│ └── useful-macros.cfg
├── moonraker-timelapse
│ ├── timelapse.cfg
│ └── timelapse.py
├── moonraker
│ ├── moonraker.asvc
│ ├── moonraker.conf
│ ├── moonraker.tar.gz
│ ├── nginx.conf
│ └── nginx.tar.gz
├── nozzle-cleaning-fan-control
│ ├── __init__.py
│ ├── nozzle-cleaning-fan-control.cfg
│ └── prtouch_v2_fan.pyc
├── screws-tilt-adjust
│ ├── screws-tilt-adjust-3ke.cfg
│ ├── screws-tilt-adjust-e5m.cfg
│ ├── screws-tilt-adjust-k1.cfg
│ ├── screws-tilt-adjust-k1max.cfg
│ └── screws_tilt_adjust.py
├── scripts
│ └── useful_macros.sh
└── services
│ ├── S50nginx
│ ├── S50usb_camera-dual
│ ├── S50usb_camera-single
│ ├── S55klipper_service
│ ├── S56moonraker_service
│ └── S58factoryreset
├── helper.sh
└── scripts
├── backup_klipper_config.sh
├── backup_moonraker_database.sh
├── buzzer_support.sh
├── camera_settings_control.sh
├── creality_dynamic_logos.sh
├── creality_web_interface.sh
├── custom_boot_display.sh
├── entware.sh
├── fans_control_macros.sh
├── fluidd.sh
├── gcode_shell_command.sh
├── git_backup.sh
├── guppy_screen.sh
├── guppyflo.sh
├── improved_shapers.sh
├── kamp.sh
├── m600_support.sh
├── mainsail.sh
├── menu
├── 10SE
│ ├── customize_menu_10SE.sh
│ ├── info_menu_10SE.sh
│ ├── install_menu_10SE.sh
│ ├── remove_menu_10SE.sh
│ └── tools_menu_10SE.sh
├── 3KE
│ ├── customize_menu_3KE.sh
│ ├── info_menu_3KE.sh
│ ├── install_menu_3KE.sh
│ ├── remove_menu_3KE.sh
│ └── tools_menu_3KE.sh
├── 3V3
│ ├── customize_menu_3V3.sh
│ ├── info_menu_3V3.sh
│ ├── install_menu_3V3.sh
│ ├── remove_menu_3V3.sh
│ └── tools_menu_3V3.sh
├── E5M
│ ├── customize_menu_E5M.sh
│ ├── info_menu_E5M.sh
│ ├── install_menu_E5M.sh
│ ├── remove_menu_E5M.sh
│ └── tools_menu_E5M.sh
├── K1
│ ├── customize_menu_K1.sh
│ ├── info_menu_K1.sh
│ ├── install_menu_K1.sh
│ ├── remove_menu_K1.sh
│ └── tools_menu_K1.sh
├── backup_restore_menu.sh
├── functions.sh
├── main_menu.sh
└── system_menu.sh
├── mobileraker_companion.sh
├── moonraker_nginx.sh
├── moonraker_obico.sh
├── moonraker_timelapse.sh
├── nozzle_cleaning_fan_control.sh
├── octoapp_companion.sh
├── octoeverywhere.sh
├── paths.sh
├── save_zoffset_macros.sh
├── screws_tilt_adjust.sh
├── simplyprint.sh
├── tools.sh
├── usb_camera.sh
└── useful_macros.sh
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | ko_fi: guilouz
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.DS_Store
2 | desktop.ini
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Creality Helper Script
2 |
3 | ## About
4 |
5 | This script intended for use on Creality **K1 Series** and **Ender-3 V3 Series** printers allows to add more features.
6 |
7 | If you don't know what you're doing, I don't recommend following this guide.
8 |
9 | ## Wiki
10 |
11 | Guide to use it is available here: [Wiki](https://guilouz.github.io/Creality-Helper-Script-Wiki/)
12 |
13 |
14 |
--------------------------------------------------------------------------------
/files/boot-display/k1_boot_display.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script/b46787a61b3ce2f04ec04d115a73a46c26814057/files/boot-display/k1_boot_display.tar.gz
--------------------------------------------------------------------------------
/files/boot-display/k1max_boot_display.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script/b46787a61b3ce2f04ec04d115a73a46c26814057/files/boot-display/k1max_boot_display.tar.gz
--------------------------------------------------------------------------------
/files/boot-display/stock_boot_display.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script/b46787a61b3ce2f04ec04d115a73a46c26814057/files/boot-display/stock_boot_display.tar.gz
--------------------------------------------------------------------------------
/files/buzzer-support/beep.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script/b46787a61b3ce2f04ec04d115a73a46c26814057/files/buzzer-support/beep.mp3
--------------------------------------------------------------------------------
/files/buzzer-support/buzzer-support.cfg:
--------------------------------------------------------------------------------
1 | ########################################
2 | # Buzzer Support
3 | ########################################
4 |
5 | [gcode_shell_command beep]
6 | command: aplay /usr/data/helper-script/files/buzzer-support/beep.mp3
7 | timeout: 2
8 | verbose: False
9 |
10 | [gcode_macro BEEP]
11 | description: Play a sound
12 | gcode:
13 | RUN_SHELL_COMMAND CMD=beep
14 |
--------------------------------------------------------------------------------
/files/camera-settings/camera-settings-nebula.cfg:
--------------------------------------------------------------------------------
1 | ########################################
2 | # Camera Settings Control
3 | ########################################
4 |
5 | [gcode_shell_command v4l2-ctl]
6 | command: v4l2-ctl
7 | timeout: 5.0
8 | verbose: True
9 |
10 | [gcode_macro CAM_SETTINGS]
11 | description: Show current camera settings
12 | gcode:
13 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 -l"
14 |
15 | [gcode_macro CAM_BRIGHTNESS]
16 | description: min=50 / max=160
17 | gcode:
18 | {% set brightness = params.BRIGHTNESS|default(100) %}
19 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl brightness="{brightness}
20 |
21 | [gcode_macro CAM_CONTRAST]
22 | description: min=50 / max=160
23 | gcode:
24 | {% set contrast = params.CONTRAST|default(50) %}
25 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl contrast="{contrast}
26 |
27 | [gcode_macro CAM_SATURATION]
28 | description: min=50 / max=160
29 | gcode:
30 | {% set saturation = params.SATURATION|default(56) %}
31 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl saturation="{saturation}
32 |
33 | [gcode_macro CAM_HUE]
34 | description: min=50 / max=160
35 | gcode:
36 | {% set hue = params.HUE|default(50) %}
37 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl hue="{hue}
38 |
39 | [gcode_macro CAM_WHITE_BALANCE_TEMPERATURE_AUTO]
40 | description: disable=0 / enable=1
41 | gcode:
42 | {% set white_balance_temperature_auto = params.WHITE_BALANCE_TEMPERATURE_AUTO|default(1) %}
43 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl white_balance_temperature_auto="{white_balance_temperature_auto}
44 |
--------------------------------------------------------------------------------
/files/camera-settings/camera-settings.cfg:
--------------------------------------------------------------------------------
1 | ########################################
2 | # Camera Settings Control
3 | ########################################
4 |
5 | [delayed_gcode LOAD_CAM_SETTINGS]
6 | initial_duration: 2
7 | gcode:
8 | CAM_BRIGHTNESS BRIGHTNESS=0
9 | CAM_CONTRAST CONTRAST=32
10 | CAM_SATURATION SATURATION=56
11 | CAM_HUE HUE=0
12 | CAM_WHITE_BALANCE_TEMPERATURE_AUTO WHITE_BALANCE_TEMPERATURE_AUTO=1
13 | CAM_GAMMA GAMMA=80
14 | CAM_GAIN GAIN=0
15 | CAM_POWER_LINE_FREQUENCY POWER_LINE_FREQUENCY=1
16 | CAM_SHARPNESS SHARPNESS=3
17 | CAM_BACKLIGHT_COMPENSATION BACKLIGHT_COMPENSATION=1
18 | CAM_EXPOSURE_AUTO EXPOSURE_AUTO=3
19 | CAM_EXPOSURE_AUTO_PRIORITY EXPOSURE_AUTO_PRIORITY=0
20 |
21 |
22 | [gcode_shell_command v4l2-ctl]
23 | command: v4l2-ctl
24 | timeout: 5.0
25 | verbose: True
26 |
27 | [gcode_macro CAM_SETTINGS]
28 | description: Show current camera settings
29 | gcode:
30 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 -l"
31 |
32 | [gcode_macro CAM_BRIGHTNESS]
33 | description: min=-64 / max=64
34 | gcode:
35 | {% set brightness = params.BRIGHTNESS|default(0) %}
36 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl brightness="{brightness}
37 |
38 | [gcode_macro CAM_CONTRAST]
39 | description: min=0 / max=64
40 | gcode:
41 | {% set contrast = params.CONTRAST|default(32) %}
42 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl contrast="{contrast}
43 |
44 | [gcode_macro CAM_SATURATION]
45 | description: min=0 / max=128
46 | gcode:
47 | {% set saturation = params.SATURATION|default(56) %}
48 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl saturation="{saturation}
49 |
50 | [gcode_macro CAM_HUE]
51 | description: min=-40 / max=40
52 | gcode:
53 | {% set hue = params.HUE|default(0) %}
54 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl hue="{hue}
55 |
56 | [gcode_macro CAM_WHITE_BALANCE_TEMPERATURE_AUTO]
57 | description: disable=0 / enable=1
58 | gcode:
59 | {% set white_balance_temperature_auto = params.WHITE_BALANCE_TEMPERATURE_AUTO|default(1) %}
60 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl white_balance_temperature_auto="{white_balance_temperature_auto}
61 |
62 | [gcode_macro CAM_GAMMA]
63 | description: min=72 / max=500
64 | gcode:
65 | {% set gamma = params.GAMMA|default(80) %}
66 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl gamma="{gamma}
67 |
68 | [gcode_macro CAM_GAIN]
69 | description: min=0 / max=100
70 | gcode:
71 | {% set gain = params.GAIN|default(0) %}
72 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl gain="{gain}
73 |
74 | [gcode_macro CAM_POWER_LINE_FREQUENCY]
75 | description: min=0 / max=2
76 | gcode:
77 | {% set power_line_frequency = params.POWER_LINE_FREQUENCY|default(1) %}
78 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl power_line_frequency="{power_line_frequency}
79 |
80 | [gcode_macro CAM_WHITE_BALANCE_TEMPERATURE]
81 | description: min=2800 / max=6500
82 | gcode:
83 | {% set white_balance_temperature = params.WHITE_BALANCE_TEMPERATURE|default(4600) %}
84 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl white_balance_temperature="{white_balance_temperature}
85 |
86 | [gcode_macro CAM_SHARPNESS]
87 | description: min=0 / max=6
88 | gcode:
89 | {% set sharpness = params.SHARPNESS|default(3) %}
90 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl sharpness="{sharpness}
91 |
92 | [gcode_macro CAM_BACKLIGHT_COMPENSATION]
93 | description: min=0 / max=2
94 | gcode:
95 | {% set backlight_compensation = params.BACKLIGHT_COMPENSATION|default(1) %}
96 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl backlight_compensation="{backlight_compensation}
97 |
98 | [gcode_macro CAM_EXPOSURE_AUTO]
99 | description: manual=1 / auto=3
100 | gcode:
101 | {% set exposure_auto = params.EXPOSURE_AUTO|default(3) %}
102 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl exposure_auto="{exposure_auto}
103 |
104 | [gcode_macro CAM_EXPOSURE_AUTO_PRIORITY]
105 | description: disable=0 / enable=1
106 | gcode:
107 | {% set exposure_auto_priority = params.EXPOSURE_AUTO_PRIORITY|default(0) %}
108 | RUN_SHELL_COMMAND CMD=v4l2-ctl PARAMS="-d /dev/video4 --set-ctrl exposure_auto_priority="{exposure_auto_priority}
109 |
--------------------------------------------------------------------------------
/files/entware/generic.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | unset LD_LIBRARY_PATH
4 | unset LD_PRELOAD
5 |
6 | LOADER=ld.so.1
7 | GLIBC=2.27
8 |
9 | echo -e "Info: Removing old directories..."
10 | rm -rf /opt
11 | rm -rf /usr/data/opt
12 |
13 | echo -e "Info: Creating directory..."
14 | mkdir -p /usr/data/opt
15 |
16 | echo -e "Info: Linking folder..."
17 | ln -nsf /usr/data/opt /opt
18 |
19 | echo -e "Info: Creating subdirectories..."
20 | for folder in bin etc lib/opkg tmp var/lock
21 | do
22 | mkdir -p /usr/data/opt/$folder
23 | done
24 |
25 | echo -e "Info: Downloading opkg package manager from Entware repo..."
26 | chmod 755 /usr/data/helper-script/files/fixes/curl
27 | primary_URL="https://bin.entware.net/mipselsf-k3.4/installer"
28 | secondary_URL="http://www.openk1.org/static/entware/mipselsf-k3.4/installer"
29 |
30 | download_files() {
31 | local url="$1"
32 | local output_file="$2"
33 | /usr/data/helper-script/files/fixes/curl -L "$url" -o "$output_file"
34 | return $?
35 | }
36 |
37 | if download_files "$primary_URL/opkg" "/opt/bin/opkg"; then
38 | download_files "$primary_URL/opkg.conf" "/opt/etc/opkg.conf"
39 | else
40 | echo -e "Info: Unable to download from Entware repo. Attempting to download from openK1 repo..."
41 | if download_files "$secondary_URL/opkg" "/opt/bin/opkg"; then
42 | download_files "$secondary_URL/opkg.conf" "/opt/etc/opkg.conf"
43 | else
44 | echo "Info: Failed to download from openK1 repo..."
45 | rm -rf /opt
46 | rm -rf /usr/data/opt
47 | exit 1
48 | fi
49 | fi
50 |
51 | echo -e "Info: Applying permissions..."
52 | chmod 755 /opt/bin/opkg
53 | chmod 777 /opt/tmp
54 |
55 | echo -e "Info: Installing basic packages..."
56 | /opt/bin/opkg update
57 | /opt/bin/opkg install entware-opt
58 |
59 | echo -e "Info: Installing SFTP server support..."
60 | /opt/bin/opkg install openssh-sftp-server; ln -s /opt/libexec/sftp-server /usr/libexec/sftp-server
61 |
62 | echo -e "Info: Configuring files..."
63 | for file in passwd group shells shadow gshadow; do
64 | if [ -f /etc/$file ]; then
65 | ln -sf /etc/$file /opt/etc/$file
66 | else
67 | [ -f /opt/etc/$file.1 ] && cp /opt/etc/$file.1 /opt/etc/$file
68 | fi
69 | done
70 |
71 | [ -f /etc/localtime ] && ln -sf /etc/localtime /opt/etc/localtime
72 |
73 | echo -e "Info: Applying changes in system profile..."
74 | echo 'export PATH="/opt/bin:/opt/sbin:$PATH"' > /etc/profile.d/entware.sh
75 |
76 | echo -e "Info: Adding startup script..."
77 | echo '#!/bin/sh\n/opt/etc/init.d/rc.unslung "$1"' > /etc/init.d/S50unslung
78 | chmod 755 /etc/init.d/S50unslung
79 |
--------------------------------------------------------------------------------
/files/fixes/curl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script/b46787a61b3ce2f04ec04d115a73a46c26814057/files/fixes/curl
--------------------------------------------------------------------------------
/files/fixes/sudo:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | exec $*
--------------------------------------------------------------------------------
/files/fixes/supervisorctl:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # supervisorctl shim - by destinal
3 | # this is a fake supervisorctl that provides just enough information for moonraker to think it's the real thing.
4 | # good enough to list the names of services in moonraker.conf, to say whether they're running or not (with false pids and times)
5 | # and to start and stop them by name, finding and calling the matching init scripts.
6 | # installing: put this in in /usr/bin/supervisorctl and then in moonraker.conf in [machine] section, set "provider: supervisord_cli"
7 |
8 | if [ -t 1 ]; then # colorize only if we're on a terminal
9 | GREEN='\033[32m'
10 | RED='\033[31m'
11 | ENDCOLOR='\033[0m'
12 | fi
13 |
14 | get_services() {
15 | moonraker_pid="$(cat /var/run/moonraker.pid)"
16 | # if moonraker is running, get its config directory from its command line
17 | if [ -f /var/run/moonraker.pid ] && [ -d /proc/"$moonraker_pid" ] ; then
18 | cmdline="$(tr '\0' '\n' < /proc/"$moonraker_pid"/cmdline)"
19 | moonraker_dir="$(echo $cmdline | awk -F'-d ' '{print $2}' | awk '{print $1}')"
20 | moonraker_conf="$moonraker_dir/config/moonraker.conf"
21 | # services="klipper moonraker $(awk '/managed_services:/ {print $2}' $moonraker_conf | sed 's/://')"
22 | # services=`(printf 'klipper\nmoonraker\n'; awk '/managed_services:/ {print $2}' $moonraker_conf | sed 's/://') | sort|uniq`
23 | services=$(ls -1 /etc/init.d/S*|sed 's/.*\/S..//;s/_service$//')
24 | echo $services
25 | else
26 | echo "Error: Invalid or missing PID file /var/run/moonraker.pid" >&2
27 | exit 1
28 | fi
29 | }
30 |
31 | get_pid_file() {
32 | service="$1"
33 | [ $service == "klipper" ] && service="klippy"
34 | pid_file="/var/run/$service.pid"
35 | echo $pid_file
36 | }
37 |
38 | is_running() {
39 | service="$1"
40 | pid_file="$(get_pid_file "$service")"
41 |
42 | # Check for PID file
43 | if [ -f "$pid_file" ] && [ -d "/proc/$(cat $pid_file)" ]; then
44 | return 0 # Running
45 | fi
46 |
47 | # Fallback to using pidof in case the service doesn't use pid files
48 | if pidof "$service" &>/dev/null; then
49 | return 0 # Running
50 | fi
51 | return 1 # Not running
52 | }
53 |
54 | print_process_status() {
55 | if is_running "$service"; then
56 | printf "%-33s$GREEN""RUNNING$ENDCOLOR\n" "$service"
57 | else
58 | printf "%-33s$RED""STOPPED$ENDCOLOR\n" "$service"
59 | fi
60 | }
61 |
62 | print_usage() {
63 | echo "supervisorctl shim - provide minimal support for moonraker so CrealityOS moonraker can start/stop without systemd"
64 | echo "Usage: $0 [command] "
65 | echo "commands include status stop start restart"
66 | }
67 |
68 | get_script_path() {
69 | service="$1"
70 | script_path="$(ls -1 /etc/init.d/S[0-9][0-9]${service}_service /etc/init.d/S[0-9][0-9]${service}* 2>/dev/null|head -1)"
71 | echo "$script_path"
72 | }
73 |
74 | stop() {
75 | service="$1"
76 | script_path="$(get_script_path $service)"
77 | # Check if the script exists and stop the service
78 | if [[ -f "$script_path" ]]; then
79 | "$script_path" stop
80 | fi
81 | }
82 |
83 | start() {
84 | service="$1"
85 | script_path="$(get_script_path $service)"
86 | # Check if the script exists and start the service
87 | if [[ -f "$script_path" ]]; then
88 | "$script_path" start
89 | fi
90 | }
91 |
92 | restart() {
93 | service="$1"
94 | script_path="$(get_script_path $service)"
95 | # Check if the script exists and restart the service
96 | if [[ -f "$script_path" ]]; then
97 | "$script_path" restart
98 | fi
99 | }
100 |
101 | main() {
102 | # echo "$0 $@" >> /tmp/supervisorctl.log
103 | action="$1"; shift
104 | case "$action" in
105 | status)
106 | if [ "$#" -lt 1 ]; then # just status, no arguments
107 | for service in $(get_services); do
108 | print_process_status $service
109 | done
110 | else
111 | for service in "$@"; do # loop through the arguments provided
112 | print_process_status $service
113 | done
114 | fi
115 | ;;
116 | start)
117 | start "$1"
118 | ;;
119 | stop)
120 | stop "$1"
121 | ;;
122 | restart)
123 | restart "$1"
124 | ;;
125 | *)
126 | print_usage
127 | exit 1
128 | esac
129 | }
130 |
131 | main "$@"
132 |
--------------------------------------------------------------------------------
/files/fixes/systemctl:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "$1" == "reboot" ]; then
4 | /sbin/reboot
5 | elif [ "$1" == "poweroff" ]; then
6 | /sbin/poweroff
7 | fi
--------------------------------------------------------------------------------
/files/fluidd-logos/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "blacklist": [
3 | "fluidd.xyz",
4 | "fluidd.net"
5 | ],
6 | "endpoints": [
7 | ],
8 | "hosted": false,
9 | "themePresets": [
10 | {
11 | "name": "Fluidd",
12 | "color": "#2196F3",
13 | "isDark": true,
14 | "logo": {
15 | "src": "logo_fluidd.svg"
16 | }
17 | },
18 | {
19 | "name": "Annex",
20 | "color": "#96CC4A",
21 | "isDark": true,
22 | "logo": {
23 | "src": "logo_annex.svg"
24 | }
25 | },
26 | {
27 | "name": "BTT",
28 | "color": "#475A91",
29 | "isDark": true,
30 | "logo": {
31 | "src": "logo_btt.svg"
32 | }
33 | },
34 | {
35 | "name": "Creality V1",
36 | "color": "#2196F3",
37 | "isDark": true,
38 | "logo": {
39 | "src": "logo_creality_v1.svg"
40 | }
41 | },
42 | {
43 | "name": "Creality V2",
44 | "color": "#2196F3",
45 | "isDark": true,
46 | "logo": {
47 | "src": "logo_creality_v2.svg"
48 | }
49 | },
50 | {
51 | "name": "EVA",
52 | "color": "#76FB00",
53 | "isDark": true,
54 | "logo": {
55 | "src": "logo_eva.svg",
56 | "dark": "#232323",
57 | "light": "#ffffff"
58 | }
59 | },
60 | {
61 | "name": "HevORT",
62 | "color": "#dfff3e",
63 | "isDark": true,
64 | "logo": {
65 | "src": "logo_hevort.svg"
66 | }
67 | },
68 | {
69 | "name": "Kingroon",
70 | "color": "#DA7A2C",
71 | "isDark": true,
72 | "logo": {
73 | "src": "logo_kingroon.svg"
74 | }
75 | },
76 | {
77 | "name": "Klipper",
78 | "color": "#B12F36",
79 | "isDark": true,
80 | "logo": {
81 | "src": "logo_klipper.svg"
82 | }
83 | },
84 | {
85 | "name": "LDO",
86 | "color": "#326799",
87 | "isDark": true,
88 | "logo": {
89 | "src": "logo_ldo.svg"
90 | }
91 | },
92 | {
93 | "name": "Peopoly",
94 | "color": "#007CC2",
95 | "isDark": true,
96 | "logo": {
97 | "src": "logo_peopoly.svg"
98 | }
99 | },
100 | {
101 | "name": "Prusa",
102 | "color": "#E05D2D",
103 | "isDark": false,
104 | "logo": {
105 | "src": "logo_prusa.svg"
106 | }
107 | },
108 | {
109 | "name": "Qidi Tech",
110 | "color": "#5B7AEA",
111 | "isDark": true,
112 | "logo": {
113 | "src": "logo_qidi.svg"
114 | }
115 | },
116 | {
117 | "name": "RatRig",
118 | "color": "#76FB00",
119 | "isDark": true,
120 | "logo": {
121 | "src": "logo_ratrig.svg",
122 | "dark": "#232323",
123 | "light": "#ffffff"
124 | }
125 | },
126 | {
127 | "name": "Siboor",
128 | "color": "#32E0DF",
129 | "isDark": true,
130 | "logo": {
131 | "src": "logo_siboor.svg"
132 | }
133 | },
134 | {
135 | "name": "Voron",
136 | "color": "#FF2300",
137 | "isDark": true,
138 | "logo": {
139 | "src": "logo_voron.svg"
140 | }
141 | },
142 | {
143 | "name": "VzBot",
144 | "color": "#FF2300",
145 | "isDark": true,
146 | "logo": {
147 | "src": "logo_vzbot.svg"
148 | }
149 | },
150 | {
151 | "name": "ZeroG",
152 | "color": "#e34234",
153 | "isDark": true,
154 | "logo": {
155 | "src": "logo_zerog.svg"
156 | }
157 | },
158 | {
159 | "name": "SnakeOil",
160 | "color": "#4bc3ca",
161 | "isDark": true,
162 | "logo": {
163 | "src": "logo_snakeoil.svg"
164 | }
165 | }
166 | ]
167 | }
168 |
--------------------------------------------------------------------------------
/files/fluidd-logos/logo_creality_v1.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/files/gcode-shell-command/gcode_shell_command.py:
--------------------------------------------------------------------------------
1 | # Run a shell command via gcode
2 | #
3 | # Copyright (C) 2019 Eric Callahan
4 | #
5 | # This file may be distributed under the terms of the GNU GPLv3 license.
6 | import os
7 | import shlex
8 | import subprocess
9 | import logging
10 |
11 | class ShellCommand:
12 | def __init__(self, config):
13 | self.name = config.get_name().split()[-1]
14 | self.printer = config.get_printer()
15 | self.gcode = self.printer.lookup_object('gcode')
16 | cmd = config.get('command')
17 | cmd = os.path.expanduser(cmd)
18 | self.command = shlex.split(cmd)
19 | self.timeout = config.getfloat('timeout', 2., above=0.)
20 | self.verbose = config.getboolean('verbose', True)
21 | self.proc_fd = None
22 | self.partial_output = ""
23 | self.gcode.register_mux_command(
24 | "RUN_SHELL_COMMAND", "CMD", self.name,
25 | self.cmd_RUN_SHELL_COMMAND,
26 | desc=self.cmd_RUN_SHELL_COMMAND_help)
27 |
28 | def _process_output(self, eventime):
29 | if self.proc_fd is None:
30 | return
31 | try:
32 | data = os.read(self.proc_fd, 4096)
33 | except Exception:
34 | pass
35 | data = self.partial_output + data.decode()
36 | if '\n' not in data:
37 | self.partial_output = data
38 | return
39 | elif data[-1] != '\n':
40 | split = data.rfind('\n') + 1
41 | self.partial_output = data[split:]
42 | data = data[:split]
43 | else:
44 | self.partial_output = ""
45 | self.gcode.respond_info(data)
46 |
47 | cmd_RUN_SHELL_COMMAND_help = "Run a linux shell command"
48 | def cmd_RUN_SHELL_COMMAND(self, params):
49 | gcode_params = params.get('PARAMS','')
50 | gcode_params = shlex.split(gcode_params)
51 | reactor = self.printer.get_reactor()
52 | try:
53 | proc = subprocess.Popen(
54 | self.command + gcode_params, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
55 | except Exception:
56 | logging.exception(
57 | "shell_command: Command {%s} failed" % (self.name))
58 | raise self.gcode.error("Error running command {%s}" % (self.name))
59 | if self.verbose:
60 | self.proc_fd = proc.stdout.fileno()
61 | self.gcode.respond_info("Running Command {%s}...:" % (self.name))
62 | hdl = reactor.register_fd(self.proc_fd, self._process_output)
63 | eventtime = reactor.monotonic()
64 | endtime = eventtime + self.timeout
65 | complete = False
66 | while eventtime < endtime:
67 | eventtime = reactor.pause(eventtime + .05)
68 | if proc.poll() is not None:
69 | complete = True
70 | break
71 | if not complete:
72 | proc.terminate()
73 | if self.verbose:
74 | if self.partial_output:
75 | self.gcode.respond_info(self.partial_output)
76 | self.partial_output = ""
77 | if complete:
78 | msg = "Command {%s} finished\n" % (self.name)
79 | else:
80 | msg = "Command {%s} timed out" % (self.name)
81 | self.gcode.respond_info(msg)
82 | reactor.unregister_fd(hdl)
83 | self.proc_fd = None
84 |
85 |
86 | def load_config_prefix(config):
87 | return ShellCommand(config)
88 |
--------------------------------------------------------------------------------
/files/git-backup/S52Git-Backup:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | start_git_backup() {
4 | echo "Info: Starting Git Backup..."
5 | /usr/data/helper-script/files/git-backup/git-backup.sh -b "$BRANCH" -t "$IFS" -g origin > /dev/null 2>&1 &
6 | }
7 |
8 | case "$1" in
9 | start)
10 | start_git_backup
11 | ;;
12 | stop)
13 | echo "Info: Stopping Git Backup..."
14 | killall -q git-backup.sh
15 | killall -q inotifywait
16 | ;;
17 | restart)
18 | echo "Info: Restarting Git Backup..."
19 | $0 stop
20 | sleep 1
21 | start_git_backup
22 | ;;
23 | *)
24 | echo "Usage: $0 {start|stop|restart}"
25 | exit 1
26 | ;;
27 | esac
28 |
29 | exit 0
--------------------------------------------------------------------------------
/files/git-backup/git-backup.cfg:
--------------------------------------------------------------------------------
1 | ########################################
2 | # Git Backup
3 | ########################################
4 |
5 | [gcode_shell_command Backup_Stop]
6 | command: sh /usr/data/helper-script/files/git-backup/git-backup.sh -s
7 | timeout: 600.0
8 | verbose: true
9 |
10 |
11 | [gcode_shell_command Backup_Pause]
12 | command: sh /usr/data/helper-script/files/git-backup/git-backup.sh -p
13 | timeout: 600.0
14 | verbose: true
15 |
16 |
17 | [gcode_shell_command Backup_Resume]
18 | command: sh /usr/data/helper-script/files/git-backup/git-backup.sh -r
19 | timeout: 600.0
20 | verbose: true
21 |
22 |
23 | [gcode_macro _GIT_STOP]
24 | description: Stop pushing to GitHub until manually resumed
25 | gcode:
26 | RUN_SHELL_COMMAND CMD=Backup_Stop
27 | RESPOND TYPE=command MSG="action:prompt_end"
28 |
29 |
30 | [gcode_macro _GIT_PAUSE]
31 | description: Stop pushing to GitHub until next reboot or until manually resumed
32 | gcode:
33 | RUN_SHELL_COMMAND CMD=Backup_Pause
34 | RESPOND TYPE=command MSG="action:prompt_end"
35 |
36 |
37 | [gcode_macro _GIT_RESUME]
38 | description: Resume pushing to GitHub
39 | gcode:
40 | RUN_SHELL_COMMAND CMD=Backup_Resume
41 | RESPOND TYPE=command MSG="action:prompt_end"
42 |
43 |
44 | [gcode_macro GIT_BACKUP_STOP]
45 | description: Stop pushing to GitHub until manually resumed
46 | gcode:
47 | RESPOND TYPE=command MSG="action:prompt_begin Git Backup"
48 | RESPOND TYPE=command MSG="action:prompt_text Do you want to stop pushing to GitHub until manually resumed?"
49 | RESPOND TYPE=command MSG="action:prompt_footer_button NO|RESPOND TYPE=command MSG="action:prompt_end"|error"
50 | RESPOND TYPE=command MSG="action:prompt_footer_button YES|_GIT_STOP|primary"
51 | RESPOND TYPE=command MSG="action:prompt_show"
52 |
53 |
54 | [gcode_macro GIT_BACKUP_PAUSE]
55 | description: Stop pushing to GitHub until next reboot or until manually resumed
56 | gcode:
57 | RESPOND TYPE=command MSG="action:prompt_begin Git Backup"
58 | RESPOND TYPE=command MSG="action:prompt_text Do you want to stop pushing to GitHub until next reboot or until manually resumed?"
59 | RESPOND TYPE=command MSG="action:prompt_footer_button NO|RESPOND TYPE=command MSG="action:prompt_end"|error"
60 | RESPOND TYPE=command MSG="action:prompt_footer_button YES|_GIT_PAUSE|primary"
61 | RESPOND TYPE=command MSG="action:prompt_show"
62 |
63 |
64 | [gcode_macro GIT_BACKUP_RESUME]
65 | description: Resume pushing to GitHub
66 | gcode:
67 | RESPOND TYPE=command MSG="action:prompt_begin Git Backup"
68 | RESPOND TYPE=command MSG="action:prompt_text Do you want to resume pushing to GitHub?"
69 | RESPOND TYPE=command MSG="action:prompt_footer_button NO|RESPOND TYPE=command MSG="action:prompt_end"|error"
70 | RESPOND TYPE=command MSG="action:prompt_footer_button YES|_GIT_RESUME|primary"
71 | RESPOND TYPE=command MSG="action:prompt_show"
72 |
--------------------------------------------------------------------------------
/files/guppy-screen/guppy-update.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | GUPPY_DIR="/usr/data/guppyscreen"
4 | CURL="/usr/data/helper-script/files/fixes/curl"
5 | VERSION_FILE="$GUPPY_DIR/.version"
6 | CUSTOM_UPGRADE_SCRIPT="$GUPPY_DIR/custom_upgrade.sh"
7 |
8 | if [ -f "$VERSION_FILE" ]; then
9 | CURRENT_VERSION=$(jq -r '.version' "$VERSION_FILE")
10 | THEME=$(jq -r '.theme' "$VERSION_FILE")
11 | ASSET_NAME=$(jq '.asset_name' "$VERSION_FILE")
12 | fi
13 |
14 | "$CURL" -s https://api.github.com/repos/ballaswag/guppyscreen/releases -o /tmp/guppy-releases.json
15 | latest_version=$(jq -r '.[0].tag_name' /tmp/guppy-releases.json)
16 | if [ "$(printf '%s\n' "$CURRENT_VERSION" "$latest_version" | sort -V | head -n1)" = "$latest_version" ]; then
17 | echo "Guppy Screen $CURRENT_VERSION is already up to date!"
18 | rm -f /tmp/guppy-releases.json
19 | exit 0
20 | else
21 | asset_url=$(jq -r ".[0].assets[] | select(.name == $ASSET_NAME).browser_download_url" /tmp/guppy-releases.json)
22 | echo "Downloading latest version $latest_version from $asset_url"
23 | "$CURL" -L "$asset_url" -o /usr/data/guppyscreen.tar.gz
24 | fi
25 |
26 | tar -xvf /usr/data/guppyscreen.tar.gz -C "$GUPPY_DIR/.."
27 |
28 | if [ -f "$CUSTOM_UPGRADE_SCRIPT" ]; then
29 | echo "Running custom_upgrade.sh for release $latest_version..."
30 | "$CUSTOM_UPGRADE_SCRIPT"
31 | fi
32 |
33 | echo "Guppy Screen have been updated to version $latest_version!"
34 |
35 | if grep -Fqs "ID=buildroot" /etc/os-release
36 | then
37 | [ -f /etc/init.d/S99guppyscreen ] && /etc/init.d/S99guppyscreen stop &> /dev/null
38 | killall -q guppyscreen
39 | /etc/init.d/S99guppyscreen restart &> /dev/null
40 | rm -f /usr/data/guppyscreen.tar.gz
41 | rm -f /tmp/guppy-releases.json
42 | fi
43 |
44 | exit 0
45 |
--------------------------------------------------------------------------------
/files/guppy-screen/guppy_update-3v3.cfg:
--------------------------------------------------------------------------------
1 | ########################################
2 | # Guppy Screen Update
3 | ########################################
4 |
5 | [gcode_shell_command guppy_update]
6 | command: sh /usr/data/helper-script/files/guppy-screen/guppy-update.sh
7 | timeout: 600.0
8 | verbose: True
9 |
10 |
11 | [gcode_macro GUPPY_UPDATE]
12 | description: Check for Guppy Screen Updates
13 | gcode:
14 | {% if printer.idle_timeout.state == "Printing" %}
15 | RESPOND TYPE=error MSG="It's not possible to update Guppy Screen while printing!"
16 | {% else %}
17 | RUN_SHELL_COMMAND CMD=guppy_update
18 | {% endif %}
19 |
20 |
21 | [gcode_macro INPUT_SHAPER_CALIBRATION]
22 | description: Measure X and Y Axis Resonances and Save values
23 | gcode:
24 | SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=30
25 | {% if printer.toolhead.homed_axes != "xyz" %}
26 | RESPOND TYPE=command MSG="Homing..."
27 | G28
28 | {% endif %}
29 | RESPOND TYPE=command MSG="Measuring X and Y Resonances..."
30 | SHAPER_CALIBRATE
31 | M400
32 | SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=45
33 | CXSAVE_CONFIG
--------------------------------------------------------------------------------
/files/guppy-screen/guppy_update.cfg:
--------------------------------------------------------------------------------
1 | ########################################
2 | # Guppy Screen Update
3 | ########################################
4 |
5 | [gcode_shell_command guppy_update]
6 | command: sh /usr/data/helper-script/files/guppy-screen/guppy-update.sh
7 | timeout: 600.0
8 | verbose: True
9 |
10 |
11 | [gcode_macro GUPPY_UPDATE]
12 | description: Check for Guppy Screen Updates
13 | gcode:
14 | {% if printer.idle_timeout.state == "Printing" %}
15 | RESPOND TYPE=error MSG="It's not possible to update Guppy Screen while printing!"
16 | {% else %}
17 | RUN_SHELL_COMMAND CMD=guppy_update
18 | {% endif %}
19 |
20 |
21 | [gcode_macro INPUT_SHAPER_CALIBRATION]
22 | description: Measure X and Y Axis Resonances and Save values
23 | gcode:
24 | {% if printer["configfile"].config["temperature_fan soc_fan"] %}
25 | SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=30
26 | {% endif %}
27 | {% if printer.toolhead.homed_axes != "xyz" %}
28 | RESPOND TYPE=command MSG="Homing..."
29 | G28
30 | {% endif %}
31 | RESPOND TYPE=command MSG="Measuring X and Y Resonances..."
32 | SHAPER_CALIBRATE
33 | M400
34 | {% if printer["configfile"].config["temperature_fan soc_fan"] %}
35 | SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=45
36 | {% endif %}
37 | CXSAVE_CONFIG
--------------------------------------------------------------------------------
/files/guppy-screen/guppyconfig-3v3.json:
--------------------------------------------------------------------------------
1 | {
2 | "config_path": "/usr/data/guppyscreen/guppyconfig.json",
3 | "default_printer": "Ender-3 V3",
4 | "display_rotate": 3,
5 | "display_sleep_sec": -1,
6 | "guppy_init_script": "/etc/init.d/S99guppyscreen",
7 | "invert_z_icon": true,
8 | "log_path": "/usr/data/printer_data/logs/guppyscreen.log",
9 | "printers": {
10 | "Ender-3 V3": {
11 | "default_macros": {
12 | "cooldown": "SET_HEATER_TEMPERATURE HEATER=extruder TARGET=0\nSET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=0",
13 | "load_filament": "LOAD_MATERIAL",
14 | "unload_filament": "QUIT_MATERIAL"
15 | },
16 | "fans": [
17 | {
18 | "display_name": "Model Cooling",
19 | "id": "output_pin fan0"
20 | },
21 | {
22 | "display_name": "Auxiliary Cooling",
23 | "id": "output_pin fan2"
24 | }
25 | ],
26 | "leds": null,
27 | "log_level": "debug",
28 | "monitored_sensors": [
29 | {
30 | "color": "red",
31 | "controllable": true,
32 | "display_name": "Extruder",
33 | "id": "extruder"
34 | },
35 | {
36 | "color": "purple",
37 | "controllable": true,
38 | "display_name": "Bed",
39 | "id": "heater_bed"
40 | }
41 | ],
42 | "moonraker_api_key": false,
43 | "moonraker_host": "127.0.0.1",
44 | "moonraker_port": 7125
45 | }
46 | },
47 | "prompt_emergency_stop": true,
48 | "thumbnail_path": "/usr/data/printer_data/thumbnails",
49 | "touch_calibrated": false,
50 | "wpa_supplicant": "/var/run/wpa_supplicant"
51 | }
52 |
--------------------------------------------------------------------------------
/files/improved-shapers/calibrate_shaper_config.py:
--------------------------------------------------------------------------------
1 | class CalibrateShaperConfig:
2 | def __init__(self, config):
3 | self.printer = config.get_printer();
4 |
5 | shaper_type = config.get('shaper_type', 'mzv')
6 | self.shaper_type_x = config.get('shaper_type_x' , shaper_type)
7 | self.shaper_freq_x = config.getfloat('shaper_freq_x', 0., minval=0.)
8 |
9 | self.shaper_type_y = config.get('shaper_type_y' , shaper_type)
10 | self.shaper_freq_y = config.getfloat('shaper_freq_y', 0., minval=0.)
11 |
12 | # Register commands
13 | gcode = config.get_printer().lookup_object('gcode')
14 | gcode.register_command("SAVE_INPUT_SHAPER", self.cmd_save_input_shaper)
15 |
16 | def get_status(self, eventtime):
17 | return {}
18 |
19 | def cmd_save_input_shaper(self, gcmd):
20 | self.shaper_freq_x = gcmd.get_float('SHAPER_FREQ_X',
21 | self.shaper_freq_x, minval=0.)
22 | self.shaper_type_x = gcmd.get('SHAPER_TYPE_X', self.shaper_type_x)
23 |
24 | self.shaper_freq_y = gcmd.get_float('SHAPER_FREQ_Y',
25 | self.shaper_freq_y, minval=0.)
26 | self.shaper_type_y = gcmd.get('SHAPER_TYPE_Y', self.shaper_type_y)
27 |
28 | configfile = self.printer.lookup_object('configfile')
29 |
30 | configfile.set('input_shaper', 'shaper_type_x', self.shaper_type_x)
31 | configfile.set('input_shaper', 'shaper_freq_x',
32 | '%.1f' % (self.shaper_freq_x,))
33 |
34 | configfile.set('input_shaper', 'shaper_type_y', self.shaper_type_y)
35 | configfile.set('input_shaper', 'shaper_freq_y',
36 | '%.1f' % (self.shaper_freq_y,))
37 |
38 | def load_config(config):
39 | return CalibrateShaperConfig(config)
40 |
--------------------------------------------------------------------------------
/files/improved-shapers/delete_csv.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | rm -f /tmp/calibration_data_*.csv
4 | rm -f /tmp/resonances_*.csv
5 | rm -f /tmp/raw_data_axis*.csv
6 |
7 | exit 0
--------------------------------------------------------------------------------
/files/improved-shapers/delete_graph.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ -f /usr/data/printer_data/config/Helper-Script/improved-shapers/resonances_x.png ]; then
4 | rm -f /usr/data/printer_data/config/Helper-Script/improved-shapers/resonances_x.png
5 | fi
6 | if [ -f /usr/data/printer_data/config/Helper-Script/improved-shapers/resonances_y.png ]; then
7 | rm -f /usr/data/printer_data/config/Helper-Script/improved-shapers/resonances_y.png
8 | fi
9 | if [ -f /usr/data/printer_data/config/Helper-Script/improved-shapers/belts_calibration.png ]; then
10 | rm -f /usr/data/printer_data/config/Helper-Script/improved-shapers/belts_calibration.png
11 | fi
12 |
13 | exit 0
--------------------------------------------------------------------------------
/files/improved-shapers/ft2font.cpython-38-mipsel-linux-gnu.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script/b46787a61b3ce2f04ec04d115a73a46c26814057/files/improved-shapers/ft2font.cpython-38-mipsel-linux-gnu.so
--------------------------------------------------------------------------------
/files/improved-shapers/scripts/shaper_defs.py:
--------------------------------------------------------------------------------
1 | # Definitions of the supported input shapers
2 | #
3 | # Copyright (C) 2020-2021 Dmitry Butyugin
4 | #
5 | # This file may be distributed under the terms of the GNU GPLv3 license.
6 | import collections, math
7 |
8 | SHAPER_VIBRATION_REDUCTION=20.
9 | DEFAULT_DAMPING_RATIO = 0.1
10 |
11 | InputShaperCfg = collections.namedtuple(
12 | 'InputShaperCfg', ('name', 'init_func', 'min_freq'))
13 |
14 | def get_none_shaper():
15 | return ([], [])
16 |
17 | def get_zv_shaper(shaper_freq, damping_ratio):
18 | df = math.sqrt(1. - damping_ratio**2)
19 | K = math.exp(-damping_ratio * math.pi / df)
20 | t_d = 1. / (shaper_freq * df)
21 | A = [1., K]
22 | T = [0., .5*t_d]
23 | return (A, T)
24 |
25 | def get_zvd_shaper(shaper_freq, damping_ratio):
26 | df = math.sqrt(1. - damping_ratio**2)
27 | K = math.exp(-damping_ratio * math.pi / df)
28 | t_d = 1. / (shaper_freq * df)
29 | A = [1., 2.*K, K**2]
30 | T = [0., .5*t_d, t_d]
31 | return (A, T)
32 |
33 | def get_mzv_shaper(shaper_freq, damping_ratio):
34 | df = math.sqrt(1. - damping_ratio**2)
35 | K = math.exp(-.75 * damping_ratio * math.pi / df)
36 | t_d = 1. / (shaper_freq * df)
37 |
38 | a1 = 1. - 1. / math.sqrt(2.)
39 | a2 = (math.sqrt(2.) - 1.) * K
40 | a3 = a1 * K * K
41 |
42 | A = [a1, a2, a3]
43 | T = [0., .375*t_d, .75*t_d]
44 | return (A, T)
45 |
46 | def get_ei_shaper(shaper_freq, damping_ratio):
47 | v_tol = 1. / SHAPER_VIBRATION_REDUCTION # vibration tolerance
48 | df = math.sqrt(1. - damping_ratio**2)
49 | K = math.exp(-damping_ratio * math.pi / df)
50 | t_d = 1. / (shaper_freq * df)
51 |
52 | a1 = .25 * (1. + v_tol)
53 | a2 = .5 * (1. - v_tol) * K
54 | a3 = a1 * K * K
55 |
56 | A = [a1, a2, a3]
57 | T = [0., .5*t_d, t_d]
58 | return (A, T)
59 |
60 | def get_2hump_ei_shaper(shaper_freq, damping_ratio):
61 | v_tol = 1. / SHAPER_VIBRATION_REDUCTION # vibration tolerance
62 | df = math.sqrt(1. - damping_ratio**2)
63 | K = math.exp(-damping_ratio * math.pi / df)
64 | t_d = 1. / (shaper_freq * df)
65 |
66 | V2 = v_tol**2
67 | X = pow(V2 * (math.sqrt(1. - V2) + 1.), 1./3.)
68 | a1 = (3.*X*X + 2.*X + 3.*V2) / (16.*X)
69 | a2 = (.5 - a1) * K
70 | a3 = a2 * K
71 | a4 = a1 * K * K * K
72 |
73 | A = [a1, a2, a3, a4]
74 | T = [0., .5*t_d, t_d, 1.5*t_d]
75 | return (A, T)
76 |
77 | def get_3hump_ei_shaper(shaper_freq, damping_ratio):
78 | v_tol = 1. / SHAPER_VIBRATION_REDUCTION # vibration tolerance
79 | df = math.sqrt(1. - damping_ratio**2)
80 | K = math.exp(-damping_ratio * math.pi / df)
81 | t_d = 1. / (shaper_freq * df)
82 |
83 | K2 = K*K
84 | a1 = 0.0625 * (1. + 3. * v_tol + 2. * math.sqrt(2. * (v_tol + 1.) * v_tol))
85 | a2 = 0.25 * (1. - v_tol) * K
86 | a3 = (0.5 * (1. + v_tol) - 2. * a1) * K2
87 | a4 = a2 * K2
88 | a5 = a1 * K2 * K2
89 |
90 | A = [a1, a2, a3, a4, a5]
91 | T = [0., .5*t_d, t_d, 1.5*t_d, 2.*t_d]
92 | return (A, T)
93 |
94 | # min_freq for each shaper is chosen to have projected max_accel ~= 1500
95 | INPUT_SHAPERS = [
96 | InputShaperCfg('zv', get_zv_shaper, min_freq=21.),
97 | InputShaperCfg('mzv', get_mzv_shaper, min_freq=23.),
98 | InputShaperCfg('zvd', get_zvd_shaper, min_freq=29.),
99 | InputShaperCfg('ei', get_ei_shaper, min_freq=29.),
100 | InputShaperCfg('2hump_ei', get_2hump_ei_shaper, min_freq=39.),
101 | InputShaperCfg('3hump_ei', get_3hump_ei_shaper, min_freq=48.),
102 | ]
103 |
--------------------------------------------------------------------------------
/files/kamp/Adaptive_Meshing.cfg:
--------------------------------------------------------------------------------
1 | ###########################################
2 | # Adaptive Bed Meshing Macros
3 | ###########################################
4 |
5 | [gcode_macro BED_MESH_CALIBRATE]
6 | rename_existing: _BED_MESH_CALIBRATE
7 | gcode:
8 | {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %}
9 | {% set bed_mesh_min = printer.configfile.settings.bed_mesh.mesh_min %}
10 | {% set bed_mesh_max = printer.configfile.settings.bed_mesh.mesh_max %}
11 | {% set probe_count = printer.configfile.settings.bed_mesh.probe_count %}
12 | {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %}
13 | {% set verbose_enable = kamp_settings.verbose_enable | abs %}
14 | {% set mesh_margin = kamp_settings.mesh_margin | float %}
15 | {% set fuzz_amount = kamp_settings.fuzz_amount | float %}
16 | {% set probe_count = probe_count if probe_count|length > 1 else probe_count * 2 %}
17 | {% set max_probe_point_distance_x = ( bed_mesh_max[0] - bed_mesh_min[0] ) / (probe_count[0] - 1) %}
18 | {% set max_probe_point_distance_y = ( bed_mesh_max[1] - bed_mesh_min[1] ) / (probe_count[1] - 1) %}
19 | {% set x_min = all_points | map(attribute=0) | min | default(bed_mesh_min[0]) %}
20 | {% set y_min = all_points | map(attribute=1) | min | default(bed_mesh_min[1]) %}
21 | {% set x_max = all_points | map(attribute=0) | max | default(bed_mesh_max[0]) %}
22 | {% set y_max = all_points | map(attribute=1) | max | default(bed_mesh_max[1]) %}
23 | {% set fuzz_range = range((0) | int, (fuzz_amount * 100) | int + 1) %}
24 | {% set adapted_x_min = x_min - mesh_margin - (fuzz_range | random / 100.0) %}
25 | {% set adapted_y_min = y_min - mesh_margin - (fuzz_range | random / 100.0) %}
26 | {% set adapted_x_max = x_max + mesh_margin + (fuzz_range | random / 100.0) %}
27 | {% set adapted_y_max = y_max + mesh_margin + (fuzz_range | random / 100.0) %}
28 | {% set adapted_x_min = [adapted_x_min , bed_mesh_min[0]] | max %}
29 | {% set adapted_y_min = [adapted_y_min , bed_mesh_min[1]] | max %}
30 | {% set adapted_x_max = [adapted_x_max , bed_mesh_max[0]] | min %}
31 | {% set adapted_y_max = [adapted_y_max , bed_mesh_max[1]] | min %}
32 | {% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %}
33 | {% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %}
34 | {% if (points_x > points_y) %}
35 | {% set points_y = points_x %}
36 | {% endif %}
37 | {% if (points_x < points_y) %}
38 | {% set points_x = points_y %}
39 | {% endif %}
40 | {% if (([points_x, points_y]|max) > 6) %}
41 | {% set algorithm = "bicubic" %}
42 | {% set min_points = 4 %}
43 | {% else %}
44 | {% set algorithm = "lagrange" %}
45 | {% set min_points = 3 %}
46 | {% endif %}
47 | {% set points_x = [points_x , min_points]|max %}
48 | {% set points_y = [points_y , min_points]|max %}
49 | {% set points_x = [points_x , probe_count[0]]|min %}
50 | {% set points_y = [points_y , probe_count[1]]|min %}
51 |
52 | {% if verbose_enable == True %}
53 | {% if printer.exclude_object.objects != [] %}
54 | RESPOND TYPE=command MSG="Algorithm: {algorithm}"
55 | RESPOND TYPE=command MSG="Default probe count: {probe_count[0]},{probe_count[1]}"
56 | RESPOND TYPE=command MSG="Adapted probe count: {points_x},{points_y}"
57 | RESPOND TYPE=command MSG="Default mesh bounds: {bed_mesh_min[0]},{bed_mesh_min[1]}, {bed_mesh_max[0]},{bed_mesh_max[1]}"
58 | {% if mesh_margin > 0 %}
59 | RESPOND TYPE=command MSG="Mesh margin is {mesh_margin}, mesh bounds extended by {mesh_margin}mm."
60 | {% else %}
61 | RESPOND TYPE=command MSG="Mesh margin is 0, margin not increased."
62 | {% endif %}
63 | {% if fuzz_amount > 0 %}
64 | RESPOND TYPE=command MSG="Mesh point fuzzing enabled, points fuzzed up to {fuzz_amount}mm"
65 | {% else %}
66 | RESPOND TYPE=command MSG="Fuzz amount is 0, mesh points not fuzzed."
67 | {% endif %}
68 | RESPOND TYPE=command MSG="Adapted mesh bounds: {adapted_x_min},{adapted_y_min}, {adapted_x_max},{adapted_y_max}"
69 | RESPOND TYPE=command MSG="KAMP adjustments successful. Happy KAMPing!"
70 | {% else %}
71 | RESPOND TYPE=command MSG="No object detected! Make sure you have enabled Exclude Objets setting in your slicer. Using Full Bed Mesh."
72 | G4 P5000
73 | {% endif %}
74 | {% endif %}
75 | _BED_MESH_CALIBRATE mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y}
76 |
--------------------------------------------------------------------------------
/files/kamp/KAMP_Settings.cfg:
--------------------------------------------------------------------------------
1 | ###########################################
2 | # KAMP Settings
3 | ###########################################
4 |
5 | # Do not touch this section below:
6 | [respond] # Necessary to receive messages from KAMP
7 | [include Start_Print.cfg] # START_PRINT macro for Creality K1 Series.
8 | [include Adaptive_Meshing.cfg] # Adaptive Meshing configurations.
9 | [include Line_Purge.cfg] # Adaptive Line Purging configurations.
10 | [include Smart_Park.cfg] # Smart Park feature, which parks the printhead near the print area for final heating.
11 | #[include Prusa_Slicer.cfg] # Enable this if you use Prusa Slicer, it's the necessary macros to enable Exclude Objects functionality.
12 |
13 |
14 | [gcode_macro _KAMP_Settings]
15 | description: This macro contains all adjustable settings for KAMP
16 |
17 | # The following variables are settings for KAMP as a whole:
18 |
19 | variable_verbose_enable: True # Set to True to enable KAMP information output when running. This is useful for debugging.
20 |
21 | # The following variables are for adjusting Adaptive Bed Mesh settings:
22 |
23 | variable_mesh_margin: 0 # Expands the mesh size in millimeters if desired. Default is 0 (disabled).
24 | variable_fuzz_amount: 0 # Slightly randomizes mesh points to spread out wear from nozzle-based probes. Default is 0 (disabled). The maximum recommended value is 3.
25 |
26 | # The following variables are for adjusting Adaptive Purge Line settings:
27 |
28 | variable_purge_height: 0.8 # Z position of nozzle during purge. Default is 0.8.
29 | variable_tip_distance: 0 # Distance between tip of filament and nozzle before purge. Default is 0.
30 | variable_purge_margin: 10 # Distance the purge will be in front of the print area. Default is 10.
31 | variable_purge_amount: 50 # Amount of filament to be purged prior to printing. Default is 50.
32 | variable_flow_rate: 12 # Flow rate of purge in mm3/s. Default is 12.
33 |
34 | # The following variables are for adjusting Smart Park feature, which will park the printhead near the print area at a specified height:
35 |
36 | variable_smart_park_height: 10 # Z position for Smart Park. Default is 10.
37 |
38 | gcode:
39 | RESPOND TYPE=command MSG="Running the _KAMP_Settings macro does nothing, it's only used for storing KAMP settings."
40 |
--------------------------------------------------------------------------------
/files/kamp/Prusa_Slicer.cfg:
--------------------------------------------------------------------------------
1 | ###########################################
2 | # PrusaSlicer Macros
3 | ###########################################
4 |
5 | [gcode_macro DEFINE_OBJECT]
6 | description: Needed macro for Exclude Objects
7 | gcode:
8 | EXCLUDE_OBJECT_DEFINE {rawparams}
9 |
10 |
11 | [gcode_macro START_CURRENT_OBJECT]
12 | description: Needed macro for Exclude Objects
13 | gcode:
14 | EXCLUDE_OBJECT_START NAME={params.NAME}
15 |
16 |
17 | [gcode_macro END_CURRENT_OBJECT]
18 | description: Needed macro for Exclude Objects
19 | gcode:
20 | EXCLUDE_OBJECT_END {% if params.NAME %}NAME={params.NAME}{% endif %}
21 |
22 |
23 | [gcode_macro LIST_OBJECTS]
24 | description: Needed macro for Exclude Objects
25 | gcode:
26 | EXCLUDE_OBJECT_DEFINE
27 |
28 |
29 | [gcode_macro LIST_EXCLUDED_OBJECTS]
30 | description: Needed macro for Exclude Objects
31 | gcode:
32 | EXCLUDE_OBJECT
33 |
34 |
35 | [gcode_macro REMOVE_ALL_EXCLUDED]
36 | description: Needed macro for Exclude Objects
37 | gcode:
38 | EXCLUDE_OBJECT RESET=1
39 |
--------------------------------------------------------------------------------
/files/kamp/Smart_Park.cfg:
--------------------------------------------------------------------------------
1 | ###########################################
2 | # Smart Park Macros
3 | ###########################################
4 |
5 | [gcode_macro _SMART_PARK]
6 | description: Parks your printhead near the print area for pre-print hotend heating.
7 | gcode:
8 | {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %}
9 | {% set bed_x_max = printer["gcode_macro PRINTER_PARAM"].max_x_position | float %}
10 | {% set bed_y_max = printer["gcode_macro PRINTER_PARAM"].max_y_position | float %}
11 | {% set z_height = kamp_settings.smart_park_height | float %}
12 | {% set purge_margin = kamp_settings.purge_margin | float %}
13 | {% set purge_amount = kamp_settings.purge_amount | float %}
14 | {% set verbose_enable = kamp_settings.verbose_enable | abs %}
15 | {% set center_x = bed_x_max / 2 %}
16 | {% set center_y = bed_y_max / 2 %}
17 | {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %}
18 | {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %}
19 | {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %}
20 | {% set x_min = (all_points | map(attribute=0) | min | default(0)) %}
21 | {% set x_max = (all_points | map(attribute=0) | max | default(0)) %}
22 | {% set y_min = (all_points | map(attribute=1) | min | default(0)) %}
23 | {% set y_max = (all_points | map(attribute=1) | max | default(0)) %}
24 | {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %}
25 | {% set rapid_move = 10 %}
26 | {% set park_x_center = ([((x_max + x_min) / 2) - (purge_amount / 2), 0] | max) %}
27 | {% set park_y_center = ([((y_max + y_min) / 2) - (purge_amount / 2), 0] | max) %}
28 | {% if (park_x_center + purge_amount + rapid_move) > bed_x_max %}
29 | {% set park_x_center = (bed_x_max - (purge_amount + rapid_move)) %}
30 | {% endif %}
31 | {% if (park_y_center + purge_amount + rapid_move) > bed_y_max %}
32 | {% set park_y_center = (bed_y_max - (purge_amount + rapid_move)) %}
33 | {% endif %}
34 | {% set park_x_origin_low = (x_min - purge_margin) %}
35 | {% set park_x_origin_high = (x_max + purge_margin) %}
36 | {% set park_y_origin_low = (y_min - purge_margin) %}
37 | {% set park_y_origin_high = (y_max + purge_margin) %}
38 | {% set detect_object = (x_min + x_max + y_min + y_max) %}
39 | {% if detect_object == 0 %}
40 | {% set x_min = 10 %}
41 | {% set y_min = 10 %}
42 | {% set z_height = 2 %}
43 | {% elif park_y_origin_low > 0 %}
44 | {% set x_min = park_x_center %}
45 | {% set y_min = park_y_origin_low %}
46 | {% elif park_x_origin_low > 0 %}
47 | {% set x_min = park_x_origin_low %}
48 | {% set y_min = park_y_center %}
49 | {% elif park_y_origin_high < bed_y_max %}
50 | {% set x_min = park_x_center %}
51 | {% set y_min = park_y_origin_high %}
52 | {% elif park_x_origin_high < bed_x_max %}
53 | {% set x_min = park_x_origin_high %}
54 | {% set y_min = park_y_center %}
55 | {% else %}
56 | {% set x_min = 10 %}
57 | {% set y_min = 10 %}
58 | {% set z_height = 2 %}
59 | {% endif %}
60 |
61 | {% if verbose_enable == True %}
62 | RESPOND TYPE=command MSG="Smart Park location: {x_min},{y_min}"
63 | {% endif %}
64 | SAVE_GCODE_STATE NAME=Presmartpark_State
65 | G90
66 | {% if printer.toolhead.position.z < z_height %}
67 | G0 Z{z_height}
68 | {% endif %}
69 | G0 X{x_min} Y{y_min} F{travel_speed}
70 | G0 Z{z_height}
71 | RESTORE_GCODE_STATE NAME=Presmartpark_State
72 |
--------------------------------------------------------------------------------
/files/kamp/Start_Print-3v3.cfg:
--------------------------------------------------------------------------------
1 | ###########################################
2 | # Additional Macros for Creality Ender-3 V3
3 | ###########################################
4 |
5 | [respond]
6 |
7 | [virtual_pins]
8 |
9 | [output_pin ADAPTIVE_BED_MESH]
10 | pin: virtual_pin:ADAPTIVE_BED_MESH_pin
11 | value: 1
12 |
13 | [output_pin FULL_BED_MESH]
14 | pin: virtual_pin:FULL_BED_MESH_pin
15 | value: 0
16 |
17 | [output_pin ADAPTIVE_PURGE_LINE]
18 | pin: virtual_pin:ADAPTIVE_PURGE_LINE_pin
19 | value: 1
20 |
21 |
22 | [gcode_macro _ADAPTIVE_BED_MESH_ON]
23 | description: Enable Adaptive Bed Mesh and Disable Full Bed Mesh
24 | gcode:
25 | SET_PIN PIN=ADAPTIVE_BED_MESH VALUE=1
26 | SET_PIN PIN=FULL_BED_MESH VALUE=0
27 | RESPOND TYPE=command MSG="action:prompt_end"
28 |
29 |
30 | [gcode_macro _FULL_BED_MESH_ON]
31 | description: Disable Adaptive Bed Mesh and Enable Full Bed Mesh
32 | gcode:
33 | SET_PIN PIN=ADAPTIVE_BED_MESH VALUE=0
34 | SET_PIN PIN=FULL_BED_MESH VALUE=1
35 | RESPOND TYPE=command MSG="action:prompt_end"
36 |
37 |
38 | [gcode_macro _BED_MESH_OFF]
39 | description: Disable Adaptive Bed Mesh and Enable Full Bed Mesh
40 | gcode:
41 | SET_PIN PIN=ADAPTIVE_BED_MESH VALUE=0
42 | SET_PIN PIN=FULL_BED_MESH VALUE=0
43 | RESPOND TYPE=command MSG="action:prompt_end"
44 |
45 |
46 | [gcode_macro _ADAPTIVE_PURGE_LINE_ON]
47 | description: Enable Adaptive Purge Line
48 | gcode:
49 | SET_PIN PIN=ADAPTIVE_PURGE_LINE VALUE=1
50 | RESPOND TYPE=command MSG="action:prompt_end"
51 |
52 |
53 | [gcode_macro _ADAPTIVE_PURGE_LINE_OFF]
54 | description: Disable Adaptive Purge Line
55 | gcode:
56 | SET_PIN PIN=ADAPTIVE_PURGE_LINE VALUE=0
57 | RESPOND TYPE=command MSG="action:prompt_end"
58 |
59 |
60 | [gcode_macro KAMP_BED_MESH_SETTINGS]
61 | description: Configure Bed Mesh type
62 | gcode:
63 | RESPOND TYPE=command MSG="action:prompt_begin Bed Mesh Settings"
64 | RESPOND TYPE=command MSG="action:prompt_text What type of bed mesh do you want to use when you start printing?"
65 | RESPOND TYPE=command MSG="action:prompt_button ADAPTIVE BED MESH|_ADAPTIVE_BED_MESH_ON|primary"
66 | RESPOND TYPE=command MSG="action:prompt_button FULL BED MESH|_FULL_BED_MESH_ON|primary"
67 | RESPOND TYPE=command MSG="action:prompt_button NONE|_BED_MESH_OFF|primary"
68 | RESPOND TYPE=command MSG="action:prompt_show"
69 |
70 |
71 | [gcode_macro KAMP_PURGE_LINE_SETTINGS]
72 | description: Configure Purge Line type
73 | gcode:
74 | RESPOND TYPE=command MSG="action:prompt_begin Purge Line Settings"
75 | RESPOND TYPE=command MSG="action:prompt_text What type of purge line do you want to use when you start printing?"
76 | RESPOND TYPE=command MSG="action:prompt_button ADAPTIVE PURGE LINE|_ADAPTIVE_PURGE_LINE_ON|primary"
77 | RESPOND TYPE=command MSG="action:prompt_button CLASSIC PURGE LINE|_ADAPTIVE_PURGE_LINE_OFF|primary"
78 | RESPOND TYPE=command MSG="action:prompt_show"
79 |
80 |
81 | [gcode_macro START_PRINT]
82 | variable_prepare: 0
83 | variable_z_sensorless: 0
84 | gcode:
85 | SET_GCODE_VARIABLE MACRO=M106 VARIABLE=user_flag VALUE=0
86 | WAIT_TEMP_END
87 | CLEAR_PAUSE
88 | SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=30
89 | {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %}
90 | {% set bed_temp = printer.custom_macro.default_bed_temp %}
91 | {% set extruder_temp = printer.custom_macro.default_extruder_temp %}
92 | {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %}
93 | {% set bed_temp = params.BED_TEMP %}
94 | {% endif %}
95 | {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %}
96 | {% set extruder_temp = params.EXTRUDER_TEMP %}
97 | {% endif %}
98 | {% if printer['gcode_macro START_PRINT'].prepare|int == 0 %}
99 | {action_respond_info("not prepare.\n")}
100 | PRINT_PREPARE_CLEAR
101 | CX_ROUGH_G28 EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp}
102 | CX_NOZZLE_CLEAR
103 | Z_SENSORLESS_SET
104 | ACCURATE_G28
105 | {% if printer['output_pin ADAPTIVE_BED_MESH'].value == 1 %}
106 | RESPOND TYPE=command MSG="Starting Adaptative Bed Mesh..."
107 | BED_MESH_CLEAR
108 | BED_MESH_CALIBRATE
109 | BED_MESH_PROFILE SAVE=adaptive
110 | BED_MESH_PROFILE LOAD=adaptive
111 | {% else %}
112 | {% if printer['output_pin FULL_BED_MESH'].value == 0 and (not printer['bed_mesh'].profile_name) %}
113 | RESPOND TYPE=command MSG="No bed mesh found. Starting Full Bed Mesh..."
114 | CX_PRINT_LEVELING_CALIBRATION
115 | {% endif %}
116 | {% if printer['output_pin FULL_BED_MESH'].value == 1 %}
117 | RESPOND TYPE=command MSG="Starting Full Bed Mesh..."
118 | CX_PRINT_LEVELING_CALIBRATION
119 | {% endif %}
120 | BED_MESH_PROFILE LOAD=default
121 | {% endif %}
122 | {% else %}
123 | PRINT_PREPARE_CLEAR
124 | {% endif %}
125 | {% if printer['output_pin ADAPTIVE_PURGE_LINE'].value == 1 %}
126 | _SMART_PARK
127 | M109 S{extruder_temp}
128 | M190 S{bed_temp}
129 | RESPOND TYPE=command MSG="Starting Adaptive Purge Line..."
130 | _LINE_PURGE
131 | {% else %}
132 | RESPOND TYPE=command MSG="Starting Classic Purge Line..."
133 | CX_PRINT_DRAW_ONE_LINE
134 | {% endif %}
135 | SET_VELOCITY_LIMIT ACCEL={printer.configfile.settings.printer.max_accel}
136 |
--------------------------------------------------------------------------------
/files/kamp/Start_Print.cfg:
--------------------------------------------------------------------------------
1 | ###########################################
2 | # Additional Macros for Creality K1 Series
3 | ###########################################
4 |
5 | [respond]
6 |
7 | [virtual_pins]
8 |
9 | [output_pin ADAPTIVE_BED_MESH]
10 | pin: virtual_pin:ADAPTIVE_BED_MESH_pin
11 | value: 1
12 |
13 | [output_pin FULL_BED_MESH]
14 | pin: virtual_pin:FULL_BED_MESH_pin
15 | value: 0
16 |
17 | [output_pin ADAPTIVE_PURGE_LINE]
18 | pin: virtual_pin:ADAPTIVE_PURGE_LINE_pin
19 | value: 1
20 |
21 |
22 | [gcode_macro _ADAPTIVE_BED_MESH_ON]
23 | description: Enable Adaptive Bed Mesh and Disable Full Bed Mesh
24 | gcode:
25 | SET_PIN PIN=ADAPTIVE_BED_MESH VALUE=1
26 | SET_PIN PIN=FULL_BED_MESH VALUE=0
27 | RESPOND TYPE=command MSG="action:prompt_end"
28 |
29 |
30 | [gcode_macro _FULL_BED_MESH_ON]
31 | description: Disable Adaptive Bed Mesh and Enable Full Bed Mesh
32 | gcode:
33 | SET_PIN PIN=ADAPTIVE_BED_MESH VALUE=0
34 | SET_PIN PIN=FULL_BED_MESH VALUE=1
35 | RESPOND TYPE=command MSG="action:prompt_end"
36 |
37 |
38 | [gcode_macro _BED_MESH_OFF]
39 | description: Disable Adaptive Bed Mesh and Enable Full Bed Mesh
40 | gcode:
41 | SET_PIN PIN=ADAPTIVE_BED_MESH VALUE=0
42 | SET_PIN PIN=FULL_BED_MESH VALUE=0
43 | RESPOND TYPE=command MSG="action:prompt_end"
44 |
45 |
46 | [gcode_macro _ADAPTIVE_PURGE_LINE_ON]
47 | description: Enable Adaptive Purge Line
48 | gcode:
49 | SET_PIN PIN=ADAPTIVE_PURGE_LINE VALUE=1
50 | RESPOND TYPE=command MSG="action:prompt_end"
51 |
52 |
53 | [gcode_macro _ADAPTIVE_PURGE_LINE_OFF]
54 | description: Disable Adaptive Purge Line
55 | gcode:
56 | SET_PIN PIN=ADAPTIVE_PURGE_LINE VALUE=0
57 | RESPOND TYPE=command MSG="action:prompt_end"
58 |
59 |
60 | [gcode_macro KAMP_BED_MESH_SETTINGS]
61 | description: Configure Bed Mesh type
62 | gcode:
63 | RESPOND TYPE=command MSG="action:prompt_begin Bed Mesh Settings"
64 | RESPOND TYPE=command MSG="action:prompt_text What type of bed mesh do you want to use when you start printing?"
65 | RESPOND TYPE=command MSG="action:prompt_button ADAPTIVE BED MESH|_ADAPTIVE_BED_MESH_ON|primary"
66 | RESPOND TYPE=command MSG="action:prompt_button FULL BED MESH|_FULL_BED_MESH_ON|primary"
67 | RESPOND TYPE=command MSG="action:prompt_button NONE|_BED_MESH_OFF|primary"
68 | RESPOND TYPE=command MSG="action:prompt_show"
69 |
70 |
71 | [gcode_macro KAMP_PURGE_LINE_SETTINGS]
72 | description: Configure Purge Line type
73 | gcode:
74 | RESPOND TYPE=command MSG="action:prompt_begin Purge Line Settings"
75 | RESPOND TYPE=command MSG="action:prompt_text What type of purge line do you want to use when you start printing?"
76 | RESPOND TYPE=command MSG="action:prompt_button ADAPTIVE PURGE LINE|_ADAPTIVE_PURGE_LINE_ON|primary"
77 | RESPOND TYPE=command MSG="action:prompt_button CLASSIC PURGE LINE|_ADAPTIVE_PURGE_LINE_OFF|primary"
78 | RESPOND TYPE=command MSG="action:prompt_show"
79 |
80 |
81 | [gcode_macro START_PRINT]
82 | variable_prepare: 0
83 | gcode:
84 | WAIT_TEMP_END
85 | CLEAR_PAUSE
86 | {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %}
87 | {% set bed_temp = printer.custom_macro.default_bed_temp %}
88 | {% set extruder_temp = printer.custom_macro.default_extruder_temp %}
89 | {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %}
90 | {% set bed_temp = params.BED_TEMP %}
91 | {% endif %}
92 | {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %}
93 | {% set extruder_temp = params.EXTRUDER_TEMP %}
94 | {% endif %}
95 | {% if printer['gcode_macro START_PRINT'].prepare|int == 0 %}
96 | PRINT_PREPARE_CLEAR
97 | CX_ROUGH_G28 EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp}
98 | CX_NOZZLE_CLEAR
99 | ACCURATE_G28
100 | {% if printer['output_pin ADAPTIVE_BED_MESH'].value == 1 %}
101 | RESPOND TYPE=command MSG="Starting Adaptive Bed Mesh..."
102 | BED_MESH_CLEAR
103 | BED_MESH_CALIBRATE
104 | BED_MESH_PROFILE SAVE=adaptive
105 | BED_MESH_PROFILE LOAD=adaptive
106 | {% else %}
107 | {% if printer['output_pin FULL_BED_MESH'].value == 0 and (not printer['bed_mesh'].profile_name) %}
108 | RESPOND TYPE=command MSG="No bed mesh found. Starting Full Bed Mesh..."
109 | CX_PRINT_LEVELING_CALIBRATION
110 | {% endif %}
111 | {% if printer['output_pin FULL_BED_MESH'].value == 1 %}
112 | RESPOND TYPE=command MSG="Starting Full Bed Mesh..."
113 | CX_PRINT_LEVELING_CALIBRATION
114 | {% endif %}
115 | BED_MESH_PROFILE LOAD=default
116 | {% endif %}
117 | {% else %}
118 | PRINT_PREPARE_CLEAR
119 | {% endif %}
120 | {% if printer['output_pin ADAPTIVE_PURGE_LINE'].value == 1 %}
121 | _SMART_PARK
122 | M109 S{extruder_temp}
123 | M190 S{bed_temp}
124 | RESPOND TYPE=command MSG="Starting Adaptive Purge Line..."
125 | _LINE_PURGE
126 | {% else %}
127 | RESPOND TYPE=command MSG="Starting Classic Purge Line..."
128 | CX_PRINT_DRAW_ONE_LINE
129 | {% endif %}
130 | SET_VELOCITY_LIMIT ACCEL={printer.configfile.settings.printer.max_accel}
131 |
--------------------------------------------------------------------------------
/files/macros/fans-control.cfg:
--------------------------------------------------------------------------------
1 | ########################################
2 | # Fans Control
3 | ########################################
4 |
5 | [respond]
6 |
7 | [duplicate_pin_override]
8 | pins: PC0, PC5, PB2, PC6, ADC_TEMPERATURE
9 |
10 |
11 | [temperature_fan chamber_fan]
12 | pin: PC0
13 | cycle_time: 0.0100
14 | hardware_pwm: false
15 | max_power: 1
16 | shutdown_speed: 0
17 | sensor_type: EPCOS 100K B57560G104F
18 | sensor_pin: PC5
19 | min_temp: 0
20 | max_temp: 70
21 | control: watermark
22 | max_delta: 2
23 | target_temp: 35.0
24 | max_speed: 1.0
25 | min_speed: 0.0
26 |
27 |
28 | [temperature_fan soc_fan]
29 | pin: PB2
30 | cycle_time: 0.0100
31 | kick_start_time: 0.5
32 | hardware_pwm: false
33 | max_power: 1
34 | shutdown_speed: 0
35 | sensor_type: temperature_mcu
36 | min_temp: 0
37 | max_temp: 100
38 | control: watermark
39 | max_delta: 2
40 | target_temp: 45.0
41 | max_speed: 1.0
42 | min_speed: 0.0
43 | tachometer_pin:PC6
44 |
45 |
46 | [gcode_macro M141]
47 | description: Set Chamber Temperature with slicers
48 | gcode:
49 | {% if 'S' in params|upper %}
50 | {% if printer["temperature_fan chamber_fan"].speed > 0.0 %}
51 | SET_PIN PIN=fan1 VALUE=255
52 | {% else %}
53 | SET_PIN PIN=fan1 VALUE=0
54 | {% endif %}
55 | {% if params.S|int > 0 %}
56 | SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET={params.S|default(35)}
57 | {% else %}
58 | SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET=35
59 | {% if params.S|int == 0 %}
60 | SET_PIN PIN=fan1 VALUE=0
61 | {% endif %}
62 | {% endif %}
63 | {% endif %}
64 |
65 |
66 | [gcode_macro M191]
67 | description: Wait for Chamber Temperature to heat up
68 | gcode:
69 | {% set s = params.S|float %}
70 | {% set chamber_temp = printer["temperature_sensor chamber_temp"].temperature|float %}
71 | {% if s > 0 %}
72 | M141 S{s}
73 | {% endif %}
74 | {% if s > chamber_temp and s <= 90 %}
75 | M140 S100
76 | RESPOND TYPE=command MSG="Waiting for the bed to heat up the chamber..."
77 | TEMPERATURE_WAIT SENSOR="temperature_fan chamber_fan" MINIMUM={s-1}
78 | RESPOND TYPE=command MSG="Chamber target temperature reached: {s}°C"
79 | M140 S{s}
80 | {% endif %}
81 |
82 |
83 | [gcode_macro M106]
84 | gcode:
85 | {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %}
86 | {% set fan = 0 %}
87 | {% set value = 0 %}
88 | {% if params.P is defined %}
89 | {% set tmp = params.P|int %}
90 | {% if tmp < fans %}
91 | {% set fan = tmp %}
92 | {% endif %}
93 | {% endif %}
94 | {% if params.S is defined %}
95 | {% set tmp = params.S|float %}
96 | {% else %}
97 | {% set tmp = 255 %}
98 | {% endif %}
99 | {% if tmp > 0 %}
100 | {% if fan == 0 %}
101 | {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %}
102 | {% if printer['gcode_macro Qmode'].flag | int == 1 %}
103 | SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan0_min + value}
104 | {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %}
105 | {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %}
106 | {% else %}
107 | {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %}
108 | {% endif %}
109 | {% else %}
110 | {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %}
111 | {% endif %}
112 | {% endif %}
113 | {% if fan == 1 %}
114 | {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %}
115 | {% if printer['gcode_macro Qmode'].flag | int == 1 %}
116 | SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan1_min + value}
117 | {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %}
118 | {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %}
119 | {% else %}
120 | {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %}
121 | {% endif %}
122 | {% else %}
123 | {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %}
124 | {% endif %}
125 | {% endif %}
126 | {% if fan == 2 %}
127 | {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %}
128 | {% if printer['gcode_macro Qmode'].flag | int == 1 %}
129 | SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan2_min + value}
130 | {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %}
131 | {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %}
132 | {% else %}
133 | {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %}
134 | {% endif %}
135 | {% else %}
136 | {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %}
137 | {% endif %}
138 | {% endif %}
139 | {% endif %}
140 | {% if value >= 255 %}
141 | {% set value = 255 %}
142 | {% endif %}
143 | {% if params.P is defined and params.P|int == 3 %}
144 | {% set fan = 1 %}
145 | {% endif %}
146 | SET_PIN PIN=fan{fan} VALUE={value}
147 |
--------------------------------------------------------------------------------
/files/macros/save-zoffset.cfg:
--------------------------------------------------------------------------------
1 | ########################################
2 | # Save Z-Offset
3 | ########################################
4 |
5 | [save_variables]
6 | filename: /usr/data/printer_data/config/Helper-Script/variables.cfg
7 |
8 | [respond]
9 |
10 |
11 | [gcode_macro SET_GCODE_OFFSET]
12 | description: Saving Z-Offset
13 | rename_existing: _SET_GCODE_OFFSET
14 | gcode:
15 | {% if printer.save_variables.variables.zoffset %}
16 | {% set zoffset = printer.save_variables.variables.zoffset %}
17 | {% else %}
18 | {% set zoffset = {'z': None} %}
19 | {% endif %}
20 | {% set ns = namespace(zoffset={'z': zoffset.z}) %}
21 | _SET_GCODE_OFFSET {% for p in params %}{'%s=%s '% (p, params[p])}{% endfor %}
22 | {%if 'Z' in params %}
23 | {% set null = ns.zoffset.update({'z': params.Z}) %}
24 | {% endif %}
25 | {%if 'Z_ADJUST' in params %}
26 | {%if ns.zoffset.z == None %}
27 | {% set null = ns.zoffset.update({'z': 0}) %}
28 | {% endif %}
29 | {% set null = ns.zoffset.update({'z': (ns.zoffset.z | float) + (params.Z_ADJUST | float)}) %}
30 | {% endif %}
31 | SAVE_VARIABLE VARIABLE=zoffset VALUE="{ns.zoffset}"
32 |
33 |
34 | [delayed_gcode LOAD_GCODE_OFFSETS]
35 | initial_duration: 2
36 | gcode:
37 | {% if printer.save_variables.variables.zoffset %}
38 | {% set zoffset = printer.save_variables.variables.zoffset %}
39 | _SET_GCODE_OFFSET {% for axis, offset in zoffset.items() if zoffset[axis] %}{ "%s=%s " % (axis, offset) }{% endfor %}
40 | RESPOND TYPE=command MSG="Loaded Z-Offset from variables.cfg: {zoffset.z}mm"
41 | {% endif %}
42 |
--------------------------------------------------------------------------------
/files/moonraker/moonraker.asvc:
--------------------------------------------------------------------------------
1 | klipper_mcu
2 | webcamd
3 | MoonCord
4 | KlipperScreen
5 | moonraker-telegram-bot
6 | moonraker-obico
7 | sonar
8 | crowsnest
9 | octoeverywhere
10 | ratos-configurator
11 | mobileraker
12 | octoapp
13 | guppyscreen
14 | guppyflo
15 | Git-Backup
--------------------------------------------------------------------------------
/files/moonraker/moonraker.conf:
--------------------------------------------------------------------------------
1 | [server]
2 | host: 0.0.0.0
3 | port: 7125
4 | klippy_uds_address: /tmp/klippy_uds
5 | max_upload_size: 2048
6 |
7 | [file_manager]
8 | queue_gcode_uploads: False
9 | enable_object_processing: True
10 |
11 | [database]
12 |
13 | [data_store]
14 | temperature_store_size: 600
15 | gcode_store_size: 1000
16 |
17 | [machine]
18 | provider: supervisord_cli
19 | validate_service: False
20 | validate_config: False
21 |
22 | [authorization]
23 | force_logins: False
24 | cors_domains:
25 | *.lan
26 | *.local
27 | *://localhost
28 | *://localhost:*
29 | *://my.mainsail.xyz
30 | *://app.fluidd.xyz
31 |
32 | trusted_clients:
33 | 10.0.0.0/8
34 | 127.0.0.0/8
35 | 169.254.0.0/16
36 | 172.16.0.0/12
37 | 192.168.0.0/16
38 | FE80::/10
39 | ::1/128
40 |
41 | [octoprint_compat]
42 |
43 | [history]
44 |
45 | [update_manager]
46 | enable_auto_refresh: True
47 | refresh_interval: 24
48 | enable_system_updates: False
49 |
50 | # Remove '#' after this line to keep Creality Helper Script up to date
51 | [update_manager Creality-Helper-Script]
52 | type: git_repo
53 | channel: dev
54 | path: /usr/data/helper-script
55 | origin: https://github.com/Guilouz/Creality-Helper-Script.git
56 | primary_branch: main
57 | managed_services: klipper
58 |
59 | # Remove '#' after this line to enable camera configuration with Moonraker and replace 'xxx.xxx.xxx.xxx' by your IP addresses
60 | #[webcam Camera]
61 | #location: printer
62 | #enabled: True
63 | #service: mjpegstreamer
64 | #target_fps: 15
65 | #target_fps_idle: 5
66 | #stream_url: http://xxx.xxx.xxx.xxx:8080/?action=stream
67 | #snapshot_url: http://xxx.xxx.xxx.xxx:8080/?action=snapshot
68 | #flip_horizontal: False
69 | #flip_vertical: False
70 | #rotation: 0
71 | #aspect_ratio: 4:3
72 |
73 | # Remove '#' after this line if you use Timelapse function and replace port '4408' by '4409' in snapshoturl if you use Mainsail
74 | #[timelapse]
75 | #output_path: /usr/data/printer_data/timelapse/
76 | #frame_path: /usr/data/printer_data/frames/
77 | #ffmpeg_binary_path: /opt/bin/ffmpeg
78 | #snapshoturl: http://localhost:8080/?action=snapshot
79 |
80 | # Remove '#' after this line if you use Fluidd
81 | #[update_manager fluidd]
82 | #type: web
83 | #channel: beta
84 | #repo: fluidd-core/fluidd
85 | #path: /usr/data/fluidd
86 |
87 | # Remove '#' after this line if you use Mainsail
88 | #[update_manager mainsail]
89 | #type: web
90 | #channel: beta
91 | #repo: mainsail-crew/mainsail
92 | #path: /usr/data/mainsail
93 |
94 | # Remove '#' after this line if you use Mobileraker Companion
95 | #[update_manager mobileraker]
96 | #type: git_repo
97 | #path: /usr/data/mobileraker_companion
98 | #origin: https://github.com/Clon1998/mobileraker_companion.git
99 | #virtualenv: /usr/data/mobileraker-env
100 | #primary_branch:main
101 | #requirements: scripts/mobileraker-requirements.txt
102 | #install_script: scripts/install.sh
103 | #managed_services: mobileraker
104 |
--------------------------------------------------------------------------------
/files/moonraker/moonraker.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script/b46787a61b3ce2f04ec04d115a73a46c26814057/files/moonraker/moonraker.tar.gz
--------------------------------------------------------------------------------
/files/moonraker/nginx.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script/b46787a61b3ce2f04ec04d115a73a46c26814057/files/moonraker/nginx.tar.gz
--------------------------------------------------------------------------------
/files/nozzle-cleaning-fan-control/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | from .prtouch_v2_fan import PRTouchFan
3 |
4 | def load_config(config):
5 | return PRTouchFan(config)
6 |
--------------------------------------------------------------------------------
/files/nozzle-cleaning-fan-control/nozzle-cleaning-fan-control.cfg:
--------------------------------------------------------------------------------
1 | ########################################
2 | # Nozzle Cleaning Fan Control
3 | ########################################
4 |
5 | [prtouch_v2_fan]
6 | max_speed: 0.5
7 |
--------------------------------------------------------------------------------
/files/nozzle-cleaning-fan-control/prtouch_v2_fan.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guilouz/Creality-Helper-Script/b46787a61b3ce2f04ec04d115a73a46c26814057/files/nozzle-cleaning-fan-control/prtouch_v2_fan.pyc
--------------------------------------------------------------------------------
/files/screws-tilt-adjust/screws-tilt-adjust-3ke.cfg:
--------------------------------------------------------------------------------
1 | ########################################
2 | # Screws Tilt Adjust for Ender-3 V3 KE
3 | ########################################
4 |
5 | [screws_tilt_adjust]
6 | screw1: 27.5, -0.5
7 | screw1_name: front left screw
8 | screw2: 196.5, -0.5
9 | screw2_name: front right screw
10 | screw3: 196.5, 169.5
11 | screw3_name: rear right screw
12 | screw4: 27.5, 169.5
13 | screw4_name: rear left screw
14 | horizontal_move_z: 5
15 | speed: 150
16 | screw_thread: CCW-M4
17 |
18 |
19 | [gcode_macro SCREWS_CALIBRATION]
20 | description: Start Bed Screws Calibration
21 | gcode:
22 | {% if printer.toolhead.homed_axes != "xyz" %}
23 | G28
24 | {% endif %}
25 | SCREWS_TILT_CALCULATE
--------------------------------------------------------------------------------
/files/screws-tilt-adjust/screws-tilt-adjust-e5m.cfg:
--------------------------------------------------------------------------------
1 |
2 | [screws_tilt_adjust]
3 | screw1: 340, 345
4 | screw1_name: rear right screw
5 | screw2: 80, 345
6 | screw2_name: rear left screw
7 | screw3: 80, 75
8 | screw3_name: front left screw
9 | screw4: 340, 75
10 | screw4_name: front right screw
11 | horizontal_move_z: 5
12 | speed: 150
13 | screw_thread: CW-M4
14 |
15 |
16 |
17 | [gcode_macro SCREWS_CALIBRATION]
18 | description: Start Bed Screws Calibration
19 | gcode:
20 | {% if printer.toolhead.homed_axes != "xyz" %}
21 | G28
22 | {% endif %}
23 | SCREWS_TILT_CALCULATE
24 |
--------------------------------------------------------------------------------
/files/screws-tilt-adjust/screws-tilt-adjust-k1.cfg:
--------------------------------------------------------------------------------
1 | ########################################
2 | # Screws Tilt Adjust for K1
3 | ########################################
4 |
5 | [screws_tilt_adjust]
6 | screw1: 25,20
7 | screw1_name: front left screw
8 | screw2: 195,20
9 | screw2_name: front right screw
10 | screw3: 195,190
11 | screw3_name: rear right screw
12 | screw4: 25,190
13 | screw4_name: rear left screw
14 | speed: 100
15 | horizontal_move_z: 5
16 | screw_thread: CW-M4
17 |
18 |
19 | [gcode_macro SCREWS_CALIBRATION]
20 | description: Start Bed Screws Calibration
21 | gcode:
22 | {% if printer.toolhead.homed_axes != "xyz" %}
23 | G28
24 | {% endif %}
25 | SCREWS_TILT_CALCULATE
--------------------------------------------------------------------------------
/files/screws-tilt-adjust/screws-tilt-adjust-k1max.cfg:
--------------------------------------------------------------------------------
1 | ########################################
2 | # Screws Tilt Adjust for K1 Max
3 | ########################################
4 |
5 | [screws_tilt_adjust]
6 | screw1: 19,23
7 | screw1_name: front left screw
8 | screw2: 278,23
9 | screw2_name: front right screw
10 | screw3: 248,272
11 | screw3_name: rear right screw
12 | screw4: 48,272
13 | screw4_name: rear left screw
14 | horizontal_move_z: 5
15 | speed: 150
16 | screw_thread: CW-M4
17 |
18 |
19 | [gcode_macro SCREWS_CALIBRATION]
20 | description: Start Bed Screws Calibration
21 | gcode:
22 | {% if printer.toolhead.homed_axes != "xyz" %}
23 | G28
24 | {% endif %}
25 | SCREWS_TILT_CALCULATE
26 |
--------------------------------------------------------------------------------
/files/scripts/useful_macros.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function backup_klipper(){
6 | if [ -f /usr/data/printer_data/config/backup_config.tar.gz ]; then
7 | rm -f /usr/data/printer_data/config/backup_config.tar.gz
8 | fi
9 | cd /usr/data/printer_data
10 | echo -e "Info: Compressing files..."
11 | tar -czvf /usr/data/printer_data/config/backup_config.tar.gz config
12 | echo -e "Info: Klipper configuration files have been saved successfully!"
13 | exit 0
14 | }
15 |
16 | function restore_klipper(){
17 | if [ ! -f /usr/data/printer_data/config/backup_config.tar.gz ]; then
18 | echo -e "Info: Please backup Klipper configuration files before restore!"
19 | exit 1
20 | fi
21 | cd /usr/data/printer_data
22 | mv config/backup_config.tar.gz backup_config.tar.gz
23 | if [ -d config ]; then
24 | rm -rf config
25 | fi
26 | echo -e "Info: Restoring files..."
27 | tar -xvf backup_config.tar.gz
28 | mv backup_config.tar.gz config/backup_config.tar.gz
29 | echo -e "Info: Klipper configuration files have been restored successfully!"
30 | exit 0
31 | }
32 |
33 | function backup_moonraker(){
34 | if [ -f /usr/data/printer_data/config/backup_database.tar.gz ]; then
35 | rm -f /usr/data/printer_data/config/backup_database.tar.gz
36 | fi
37 | cd /usr/data/printer_data
38 | echo -e "Info: Compressing files..."
39 | tar -czvf /usr/data/printer_data/config/backup_database.tar.gz database
40 | echo -e "Info: Moonraker database has been saved successfully!"
41 | exit 0
42 | }
43 |
44 | function restore_moonraker(){
45 | if [ ! -f /usr/data/printer_data/config/backup_database.tar.gz ]; then
46 | echo -e "Info: Please backup Moonraker database before restore!"
47 | exit 1
48 | fi
49 | cd /usr/data/printer_data
50 | mv config/backup_database.tar.gz backup_database.tar.gz
51 | if [ -d database ]; then
52 | rm -rf database
53 | fi
54 | echo -e "Info: Restoring files..."
55 | tar -xvf backup_database.tar.gz
56 | mv backup_database.tar.gz config/backup_database.tar.gz
57 | echo -e "Info: Moonraker database has been restored successfully!"
58 | exit 0
59 | }
60 |
61 | function reload_camera(){
62 | echo -e "Info: Reloading camera config..."
63 | ACTION=reload /usr/bin/auto_uvc.sh
64 | exit 0
65 | }
66 |
67 | if [ "$1" == "-backup_klipper" ]; then
68 | backup_klipper
69 | elif [ "$1" == "-restore_klipper" ]; then
70 | restore_klipper
71 | elif [ "$1" == "-backup_moonraker" ]; then
72 | backup_moonraker
73 | elif [ "$1" == "-restore_moonraker" ]; then
74 | restore_moonraker
75 | elif [ "$1" == "-reload_camera" ]; then
76 | reload_camera
77 | else
78 | echo -e "Invalid argument. Usage: $0 [-backup_klipper | -restore_klipper | -backup_moonraker | -restore_moonraker | -reload_camera]"
79 | exit 1
80 | fi
--------------------------------------------------------------------------------
/files/services/S50nginx:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Nginx Service
4 | #
5 |
6 | NGINX="/usr/data/nginx/sbin/nginx"
7 | PIDFILE="/var/run/nginx.pid"
8 | NGINX_ARGS="-c /usr/data/nginx/nginx/nginx.conf"
9 |
10 | case "$1" in
11 | start)
12 | echo "Starting nginx..."
13 | mkdir -p /var/log/nginx /var/tmp/nginx
14 | start-stop-daemon -S -p "$PIDFILE" --exec "$NGINX" -- $NGINX_ARGS
15 | ;;
16 | stop)
17 | echo "Stopping nginx..."
18 | start-stop-daemon -K -x "$NGINX" -p "$PIDFILE" -o
19 | ;;
20 | reload|force-reload)
21 | echo "Reloading nginx..."
22 | "$NGINX" -s reload
23 | ;;
24 | restart)
25 | "$0" stop
26 | sleep 1
27 | "$0" start
28 | ;;
29 | *)
30 | echo "Usage: $0 {start|stop|restart|reload|force-reload}"
31 | exit 1
32 | esac
33 |
--------------------------------------------------------------------------------
/files/services/S50usb_camera-dual:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # USB Camera Service
3 | # Credit: destinal & Guilouz
4 |
5 | case "$1" in
6 | start)
7 | echo "Starting USB Camera..."
8 | V4L_DEVS=$(v4l2-ctl --list-devices | grep -A1 usb | sed 's/^[[:space:]]*//g' | grep '^/dev')
9 | CREALITY_CAMS=$(v4l2-ctl --list-devices | grep -E 'CREALITY' | wc -l)
10 | if [ "x$V4L_DEVS" = "x" -o $CREALITY_CAMS -gt 0 ]; then
11 | /opt/bin/mjpg_streamer -b -i "/opt/lib/mjpg-streamer/input_uvc.so -d /dev/video4 -r 1280x720 -f 15" -o "/opt/lib/mjpg-streamer/output_http.so -p 8080"
12 | /opt/bin/mjpg_streamer -b -i "/opt/lib/mjpg-streamer/input_uvc.so -d /dev/video6 -r 1280x720 -f 15" -o "/opt/lib/mjpg-streamer/output_http.so -p 8081"
13 | else
14 | /opt/bin/mjpg_streamer -b -i "/opt/lib/mjpg-streamer/input_uvc.so -d /dev/video4 -r 1280x720 -f 15" -o "/opt/lib/mjpg-streamer/output_http.so -p 8080"
15 | fi
16 | ;;
17 | stop)
18 | echo "Stopping USB Camera..."
19 | killall -q mjpg_streamer && killall -q cam_app && killall -q cx_ai_middleware
20 | ;;
21 | restart|reload)
22 | "$0" stop
23 | sleep 1
24 | "$0" start
25 | ;;
26 | *)
27 | echo "Usage: /etc/init.d/S50usb_camera {start|stop|restart}"
28 | exit 1
29 | esac
30 |
31 | exit $?
32 |
--------------------------------------------------------------------------------
/files/services/S50usb_camera-single:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # USB Camera Service
3 | # Credit: destinal & Guilouz
4 |
5 | case "$1" in
6 | start)
7 | echo "Starting USB Camera..."
8 | V4L_DEVS=$(v4l2-ctl --list-devices | grep -A1 usb | sed 's/^[[:space:]]*//g' | grep '^/dev')
9 | CREALITY_CAMS=$(v4l2-ctl --list-devices | grep -E 'CREALITY|CCX2F3298' | wc -l)
10 | if [ "x$V4L_DEVS" = "x" -o $CREALITY_CAMS -gt 0 ]; then
11 | echo "Error: No third party camera found or you use a Creality camera!"
12 | exit 1
13 | fi
14 | PORT=8080
15 | for V4L_DEV in $V4L_DEVS; do
16 | /opt/bin/mjpg_streamer -b -i "/opt/lib/mjpg-streamer/input_uvc.so -d $V4L_DEV -r 1280x720 -f 15" -o "/opt/lib/mjpg-streamer/output_http.so -p $PORT"
17 | PORT=`expr $PORT + 1`
18 | done
19 | ;;
20 | stop)
21 | echo "Stopping USB Camera..."
22 | killall -q mjpg_streamer && killall -q cam_app && killall -q cx_ai_middleware
23 | ;;
24 | restart|reload)
25 | "$0" stop
26 | sleep 1
27 | "$0" start
28 | ;;
29 | *)
30 | echo "Usage: /etc/init.d/S50usb_camera {start|stop|restart}"
31 | exit 1
32 | esac
33 |
34 | exit $?
35 |
--------------------------------------------------------------------------------
/files/services/S55klipper_service:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Klipper Service
4 | #
5 |
6 | USER_DATA="/usr/data"
7 | PROG="/usr/share/klippy-env/bin/python"
8 | PY_SCRIPT="/usr/share/klipper/klippy/klippy.py"
9 | PRINTER_DATA_DIR="$USER_DATA/printer_data"
10 | PRINTER_CONFIG_DIR="$PRINTER_DATA_DIR/config"
11 | PRINTER_LOGS_DIR="$PRINTER_DATA_DIR/logs"
12 | PID_FILE="/var/run/klippy.pid"
13 |
14 | mcu_reset()
15 | {
16 | [ -z "$(pidof klipper_mcu)" ] || /etc/init.d/S57klipper_mcu restart
17 | }
18 |
19 | start() {
20 | mcu_reset
21 | HOME="/root" start-stop-daemon -S -q -b -m -p "$PID_FILE" \
22 | --exec "$PROG" -- "$PY_SCRIPT" \
23 | "$PRINTER_CONFIG_DIR"/printer.cfg \
24 | -l "$PRINTER_LOGS_DIR"/klippy.log \
25 | -a "/tmp/klippy_uds"
26 | }
27 |
28 | stop() {
29 | start-stop-daemon -K -q -p $PID_FILE
30 | }
31 |
32 | restart() {
33 | stop
34 | start
35 | }
36 |
37 | case "$1" in
38 | start)
39 | start
40 | ;;
41 | stop)
42 | stop
43 | ;;
44 | restart|reload)
45 | restart
46 | ;;
47 | *)
48 | echo "Usage: $0 {start|stop|restart}"
49 | exit 1
50 | esac
51 |
52 | exit $?
53 |
--------------------------------------------------------------------------------
/files/services/S56moonraker_service:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Moonraker Service
4 | #
5 |
6 | USER_DATA=/usr/data
7 | PROG=$USER_DATA/moonraker/moonraker-env/bin/python
8 | PY_SCRIPT=$USER_DATA/moonraker/moonraker/moonraker/moonraker.py
9 | MOONRAKER_TMP_DIR=$USER_DATA/moonraker/tmp
10 | PRINTER_DATA_DIR=$USER_DATA/printer_data
11 | PRINTER_CONFIG_DIR=$PRINTER_DATA_DIR/config
12 | PRINTER_LOGS_DIR=$PRINTER_DATA_DIR/logs
13 | PID_FILE=/var/run/moonraker.pid
14 |
15 | start() {
16 | [ -d $PRINTER_DATA_DIR ] || mkdir -p $PRINTER_DATA_DIR
17 | [ -d $PRINTER_CONFIG_DIR ] || mkdir -p $PRINTER_CONFIG_DIR
18 | [ -d $PRINTER_LOGS_DIR ] || mkdir -p $PRINTER_LOGS_DIR
19 | rm -rf $MOONRAKER_TMP_DIR && mkdir -p $MOONRAKER_TMP_DIR
20 | export TMPDIR=$MOONRAKER_TMP_DIR
21 | HOME=/root start-stop-daemon -S -q -b -m -p $PID_FILE \
22 | --exec $PROG -- $PY_SCRIPT -d $PRINTER_DATA_DIR
23 | }
24 | stop() {
25 | start-stop-daemon -K -q -p $PID_FILE
26 | }
27 | restart() {
28 | stop
29 | sleep 1
30 | start
31 | }
32 |
33 | case "$1" in
34 | start)
35 | start
36 | ;;
37 | stop)
38 | stop
39 | ;;
40 | restart|reload)
41 | restart
42 | ;;
43 | *)
44 | echo "Usage: $0 {start|stop|restart}"
45 | exit 1
46 | esac
47 |
48 | exit $?
49 |
--------------------------------------------------------------------------------
/files/services/S58factoryreset:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # This script does the equivalent of `echo "all" | nc -U /var/run/wipe.sock`
5 | #
6 |
7 | factory_reset() {
8 | /usr/bin/mcu_reset.sh >/dev/null 2>&1
9 | ACTION=stop /usr/bin/auto_uvc.sh >/dev/null 2>&1
10 | echo "Info: Factory reset was executed successfully, the printer will restart..."
11 | /etc/init.d/rcK >/dev/null 2>&1
12 | /usr/bin/find /overlay/upper/ \
13 | -path '/overlay/upper/etc/dropbear' -prune -o \
14 | -path /overlay/upper/etc/localtime -prune -o \
15 | -path /overlay/upper/etc/init.d/S58factoryreset -prune -o \
16 | -exec rm {} \; >/dev/null 2>&1
17 | /usr/bin/find /overlay/upper/ -type d \
18 | -depth -print \
19 | -exec rmdir {} \; >/dev/null 2>&1
20 | /usr/bin/find /usr/data/ \
21 | -path '/usr/data/creality' -prune -o \
22 | -path '/usr/data/wpa_supplicant.conf' -prune -o \
23 | -path '/usr/data/machine_production_info' -prune -o \
24 | -path '/usr/data/' -o -print \
25 | -exec rm -rf {} \; >/dev/null 2>&1
26 | /usr/bin/find /usr/data/creality/userdata \
27 | -path '/usr/data/creality/userdata/config/system_config.json' -prune -o \
28 | -path '/usr/data/creality/userdata/user_agree_root' -prune -o \
29 | -path '/usr/data/creality/userdata' -o -type d -o -print \
30 | -exec rm {} \; >/dev/null 2>&1
31 | /usr/bin/find /usr/data/creality/ \
32 | -depth -print \
33 | -exec rmdir {} \; >/dev/null 2>&1
34 | /bin/sync >/dev/null 2>&1
35 | /sbin/swapoff -a >/dev/null 2>&1
36 | /sbin/reboot -f >/dev/null 2>&1
37 | }
38 |
39 | case "$1" in
40 | start)
41 | FLAG_FILE=$(ls /tmp/udisk/sda*/factory_reset 2> /dev/null)
42 | if [ $? -eq 0 ] && [ "x$FLAG_FILE" != "x" ]; then
43 | FLAG_FILE=$(echo $FLAG_FILE | awk '{print $1}')
44 | echo "Info: Executing factory reset..."
45 | mv "$FLAG_FILE" "${FLAG_FILE}.old" >/dev/null 2>&1
46 | factory_reset
47 | else
48 | echo "Info: No 'factory_reset' file found on the USB drive!"
49 | exit 1
50 | fi
51 | ;;
52 | reset)
53 | echo "Info: Executing factory reset..."
54 | factory_reset
55 | ;;
56 | *)
57 | echo "Usage: $0 {start|reset}"
58 | exit 1
59 | ;;
60 | esac
61 |
62 | exit 0
63 |
--------------------------------------------------------------------------------
/helper.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 | clear
5 |
6 | HELPER_SCRIPT_FOLDER="$(dirname "$(readlink -f "$0")")"
7 | for script in "${HELPER_SCRIPT_FOLDER}/scripts/"*.sh; do . "${script}"; done
8 | for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/"*.sh; do . "${script}"; done
9 | for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/K1/"*.sh; do . "${script}"; done
10 | for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/3V3/"*.sh; do . "${script}"; done
11 | for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/3KE/"*.sh; do . "${script}"; done
12 | for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/10SE/"*.sh; do . "${script}"; done
13 | for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/E5M/"*.sh; do . "${script}"; done
14 |
15 | function update_helper_script() {
16 | echo -e "${white}"
17 | echo -e "Info: Updating Creality Helper Script..."
18 | cd "${HELPER_SCRIPT_FOLDER}"
19 | git reset --hard && git pull
20 | ok_msg "Creality Helper Script has been updated!"
21 | echo -e " ${green}Please restart script to load the new version.${white}"
22 | echo
23 | exit 0
24 | }
25 |
26 | function update_available() {
27 | [[ ! -d "${HELPER_SCRIPT_FOLDER}/.git" ]] && return
28 | local remote current
29 | cd "${HELPER_SCRIPT_FOLDER}"
30 | ! git branch -a | grep -q "\* main" && return
31 | git fetch -q > /dev/null 2>&1
32 | remote=$(git rev-parse --short=8 FETCH_HEAD)
33 | current=$(git rev-parse --short=8 HEAD)
34 | if [[ ${remote} != "${current}" ]]; then
35 | echo "true"
36 | fi
37 | }
38 |
39 | function update_menu() {
40 | local update_available=$(update_available)
41 | if [[ "$update_available" == "true" ]]; then
42 | top_line
43 | title "A new script version is available!" "${green}"
44 | inner_line
45 | hr
46 | echo -e " │ ${cyan}It's recommended to keep script up to date. Updates usually ${white}│"
47 | echo -e " │ ${cyan}contain bug fixes, important changes or new features. ${white}│"
48 | echo -e " │ ${cyan}Please consider updating! ${white}│"
49 | hr
50 | echo -e " │ See changelog here: ${yellow}https://tinyurl.com/3sf3bzck ${white}│"
51 | hr
52 | bottom_line
53 | local yn
54 | while true; do
55 | read -p " Do you want to update now? (${yellow}y${white}/${yellow}n${white}): ${yellow}" yn
56 | case "${yn}" in
57 | Y|y)
58 | run "update_helper_script"
59 | if [ ! -x "$HELPER_SCRIPT_FOLDER"/helper.sh ]; then
60 | chmod +x "$HELPER_SCRIPT_FOLDER"/helper.sh >/dev/null 2>&1
61 | fi
62 | break;;
63 | N|n)
64 | break;;
65 | *)
66 | error_msg "Please select a correct choice!";;
67 | esac
68 | done
69 | fi
70 | }
71 |
72 | if [ ! -L /usr/bin/helper ]; then
73 | ln -sf "$HELPER_SCRIPT_FOLDER"/helper.sh /usr/bin/helper > /dev/null 2>&1
74 | fi
75 | rm -rf /root/.cache
76 | set_paths
77 | set_permissions
78 | update_menu
79 | main_menu
80 |
--------------------------------------------------------------------------------
/scripts/backup_klipper_config.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function backup_klipper_config_files_message(){
6 | top_line
7 | title 'Backup Klipper configuration files' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}This allows to backup Klipper configuration files in a ${white}│"
11 | echo -e " │ ${cyan}backup_config.tar.gz compressed file. ${white}│"
12 | hr
13 | bottom_line
14 | }
15 |
16 | function restore_klipper_config_files_message(){
17 | top_line
18 | title 'Restore Klipper configuration files' "${yellow}"
19 | inner_line
20 | hr
21 | echo -e " │ ${cyan}This allows to restore Klipper configuration files from a ${white}│"
22 | echo -e " │ ${cyan}backup_config.tar.gz compressed file. ${white}│"
23 | hr
24 | bottom_line
25 | }
26 |
27 | function backup_klipper_config_files(){
28 | backup_klipper_config_files_message
29 | local yn
30 | while true; do
31 | backup_msg "Klipper configuration files" yn
32 | case "${yn}" in
33 | Y|y)
34 | echo -e "${white}"
35 | if [ -f "$KLIPPER_CONFIG_FOLDER"/backup_config.tar.gz ]; then
36 | rm -f "$KLIPPER_CONFIG_FOLDER"/backup_config.tar.gz
37 | fi
38 | cd "$PRINTER_DATA_FOLDER"
39 | echo -e "Info: Compressing files..."
40 | tar -czvf "$KLIPPER_CONFIG_FOLDER"/backup_config.tar.gz config
41 | ok_msg "Klipper configuration files have been saved successfully in ${yellow}/usr/data/printer_data/config ${green}folder!"
42 | return;;
43 | N|n)
44 | error_msg "Backup canceled!"
45 | return;;
46 | *)
47 | error_msg "Please select a correct choice!";;
48 | esac
49 | done
50 | }
51 |
52 | function restore_klipper_config_files(){
53 | restore_klipper_config_files_message
54 | local yn
55 | while true; do
56 | restore_msg "Klipper configuration files" yn
57 | case "${yn}" in
58 | Y|y)
59 | echo -e "${white}"
60 | cd "$PRINTER_DATA_FOLDER"
61 | if [ -f config/backup_config.tar.gz ]; then
62 | mv config/backup_config.tar.gz backup_config.tar.gz
63 | fi
64 | if [ -d config ]; then
65 | rm -rf config
66 | fi
67 | echo -e "Info: Restoring files..."
68 | tar -xvf backup_config.tar.gz
69 | mv backup_config.tar.gz config/backup_config.tar.gz
70 | ok_msg "Klipper configuration files have been restored successfully!"
71 | return;;
72 | N|n)
73 | error_msg "Restoration canceled!"
74 | return;;
75 | *)
76 | error_msg "Please select a correct choice!";;
77 | esac
78 | done
79 | }
--------------------------------------------------------------------------------
/scripts/backup_moonraker_database.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function backup_moonraker_database_message(){
6 | top_line
7 | title 'Backup Moonraker database' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}This allows to backup Moonraker database in a ${white}│"
11 | echo -e " │ ${cyan}backup_database.tar.gz compressed file. ${white}│"
12 | hr
13 | bottom_line
14 | }
15 |
16 | function restore_moonraker_database_message(){
17 | top_line
18 | title 'Restore Moonraker database' "${yellow}"
19 | inner_line
20 | hr
21 | echo -e " │ ${cyan}This allows to restore Moonraker database from a ${white}│"
22 | echo -e " │ ${cyan}backup_database.tar.gz compressed file. ${white}│"
23 | hr
24 | bottom_line
25 | }
26 |
27 | function backup_moonraker_database(){
28 | backup_moonraker_database_message
29 | local yn
30 | while true; do
31 | backup_msg "Moonraker database" yn
32 | case "${yn}" in
33 | Y|y)
34 | echo -e "${white}"
35 | if [ -f "$KLIPPER_CONFIG_FOLDER"/backup_database.tar.gz ]; then
36 | rm -f "$KLIPPER_CONFIG_FOLDER"/backup_database.tar.gz
37 | fi
38 | cd "$PRINTER_DATA_FOLDER"
39 | echo -e "Info: Compressing files..."
40 | tar -czvf "$KLIPPER_CONFIG_FOLDER"/backup_database.tar.gz database
41 | ok_msg "Moonraker database has been saved successfully in ${yellow}/usr/data/printer_data/config ${green}folder!"
42 | return;;
43 | N|n)
44 | error_msg "Backup canceled!"
45 | return;;
46 | *)
47 | error_msg "Please select a correct choice!";;
48 | esac
49 | done
50 | }
51 |
52 | function restore_moonraker_database(){
53 | restore_moonraker_database_message
54 | local yn
55 | while true; do
56 | restore_msg "Moonraker database" yn
57 | case "${yn}" in
58 | Y|y)
59 | echo -e "${white}"
60 | cd "$PRINTER_DATA_FOLDER"
61 | if [ -f config/backup_database.tar.gz ]; then
62 | mv config/backup_database.tar.gz backup_database.tar.gz
63 | fi
64 | if [ -d database ]; then
65 | rm -rf database
66 | fi
67 | echo -e "Info: Restoring files..."
68 | tar -xvf backup_database.tar.gz
69 | mv backup_database.tar.gz config/backup_database.tar.gz
70 | ok_msg "Moonraker database has been restored successfully!"
71 | return;;
72 | N|n)
73 | error_msg "Restoration canceled!"
74 | return;;
75 | *)
76 | error_msg "Please select a correct choice!";;
77 | esac
78 | done
79 | }
--------------------------------------------------------------------------------
/scripts/buzzer_support.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function buzzer_support_message(){
6 | top_line
7 | title 'Buzzer Support' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}It allows to play sounds using the motherboard buzzer. ${white}│"
11 | hr
12 | bottom_line
13 | }
14 |
15 | function install_buzzer_support(){
16 | buzzer_support_message
17 | local yn
18 | while true; do
19 | install_msg "Buzzer Support" yn
20 | case "${yn}" in
21 | Y|y)
22 | echo -e "${white}"
23 | if [ -f "$HS_CONFIG_FOLDER"/buzzer-support.cfg ]; then
24 | rm -f "$HS_CONFIG_FOLDER"/buzzer-support.cfg
25 | fi
26 | if [ ! -d "$HS_CONFIG_FOLDER" ]; then
27 | mkdir -p "$HS_CONFIG_FOLDER"
28 | fi
29 | echo -e "Info: Linking file..."
30 | ln -sf "$BUZZER_URL" "$HS_CONFIG_FOLDER"/buzzer-support.cfg
31 | if grep -q "include Helper-Script/buzzer-support" "$PRINTER_CFG" ; then
32 | echo -e "Info: Buzzer Support configurations are already enabled in printer.cfg file..."
33 | else
34 | echo -e "Info: Adding Buzzer Support configurations in printer.cfg file..."
35 | sed -i '/\[include printer_params\.cfg\]/a \[include Helper-Script/buzzer-support\.cfg\]' "$PRINTER_CFG"
36 | fi
37 | echo -e "Info: Restarting Klipper service..."
38 | restart_klipper
39 | ok_msg "Buzzer Support has been installed successfully!"
40 | echo -e " You can now use ${yellow}BEEP ${white}command in your macros to play sound."
41 | return;;
42 | N|n)
43 | error_msg "Installation canceled!"
44 | return;;
45 | *)
46 | error_msg "Please select a correct choice!";;
47 | esac
48 | done
49 | }
50 |
51 | function remove_buzzer_support(){
52 | buzzer_support_message
53 | local yn
54 | while true; do
55 | remove_msg "Buzzer Support" yn
56 | case "${yn}" in
57 | Y|y)
58 | echo -e "${white}"
59 | echo -e "Info: Removing file..."
60 | rm -f "$HS_CONFIG_FOLDER"/buzzer-support.cfg
61 | if grep -q "include Helper-Script/buzzer-support" "$PRINTER_CFG" ; then
62 | echo -e "Info: Removing Buzzer Support configurations in printer.cfg file..."
63 | sed -i '/include Helper-Script\/buzzer-support\.cfg/d' "$PRINTER_CFG"
64 | else
65 | echo -e "Info: Buzzer Support configurations are already removed in printer.cfg file..."
66 | fi
67 | if [ ! -n "$(ls -A "$HS_CONFIG_FOLDER")" ]; then
68 | rm -rf "$HS_CONFIG_FOLDER"
69 | fi
70 | echo -e "Info: Restarting Klipper service..."
71 | restart_klipper
72 | ok_msg "Buzzer Support has been removed successfully!"
73 | return;;
74 | N|n)
75 | error_msg "Deletion canceled!"
76 | return;;
77 | *)
78 | error_msg "Please select a correct choice!";;
79 | esac
80 | done
81 | }
--------------------------------------------------------------------------------
/scripts/camera_settings_control.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function camera_settings_control_message(){
6 | top_line
7 | title 'Camera Settings Control' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}It allows to install needed macros to adjust camera ${white}│"
11 | echo -e " │ ${cyan}settings like brightness, saturation, contrast, etc... ${white}│"
12 | hr
13 | bottom_line
14 | }
15 |
16 | function install_camera_settings_control(){
17 | camera_settings_control_message
18 | local yn
19 | while true; do
20 | install_msg "Camera Settings Control" yn
21 | case "${yn}" in
22 | Y|y)
23 | echo -e "${white}"
24 | if [ -f "$HS_CONFIG_FOLDER"/camera-settings.cfg ]; then
25 | rm -f "$HS_CONFIG_FOLDER"/camera-settings.cfg
26 | fi
27 | if [ ! -d "$HS_CONFIG_FOLDER" ]; then
28 | mkdir -p "$HS_CONFIG_FOLDER"
29 | fi
30 | echo -e "Info: Linking file..."
31 | if v4l2-ctl --list-devices | grep -q 'CCX2F3298'; then
32 | cp "$CAMERA_SETTINGS_NEBULA_URL" "$HS_CONFIG_FOLDER"/camera-settings.cfg
33 | else
34 | cp "$CAMERA_SETTINGS_URL" "$HS_CONFIG_FOLDER"/camera-settings.cfg
35 | fi
36 | if grep -q "include Helper-Script/camera-settings" "$PRINTER_CFG" ; then
37 | echo -e "Info: Camera Settings configurations are already enabled in printer.cfg file..."
38 | else
39 | echo -e "Info: Adding Camera Settings configurations in printer.cfg file..."
40 | sed -i '/\[include printer_params\.cfg\]/a \[include Helper-Script/camera-settings\.cfg\]' "$PRINTER_CFG"
41 | fi
42 | echo -e "Info: Restarting Klipper service..."
43 | restart_klipper
44 | ok_msg "Camera Settings Control has been installed successfully!"
45 | return;;
46 | N|n)
47 | error_msg "Installation canceled!"
48 | return;;
49 | *)
50 | error_msg "Please select a correct choice!";;
51 | esac
52 | done
53 | }
54 |
55 | function remove_camera_settings_control(){
56 | camera_settings_control_message
57 | local yn
58 | while true; do
59 | remove_msg "Camera Settings Control" yn
60 | case "${yn}" in
61 | Y|y)
62 | echo -e "${white}"
63 | echo -e "Info: Removing file..."
64 | rm -f "$HS_CONFIG_FOLDER"/camera-settings.cfg
65 | if grep -q "include Helper-Script/camera-settings" "$PRINTER_CFG" ; then
66 | echo -e "Info: Removing Camera Settings configurations in printer.cfg file..."
67 | sed -i '/include Helper-Script\/camera-settings\.cfg/d' "$PRINTER_CFG"
68 | else
69 | echo -e "Info: Camera Settings configurations are already removed in printer.cfg file..."
70 | fi
71 | if [ ! -n "$(ls -A "$HS_CONFIG_FOLDER")" ]; then
72 | rm -rf "$HS_CONFIG_FOLDER"
73 | fi
74 | echo -e "Info: Restarting Klipper service..."
75 | restart_klipper
76 | ok_msg "Camera Settings Control has been removed successfully!"
77 | return;;
78 | N|n)
79 | error_msg "Deletion canceled!"
80 | return;;
81 | *)
82 | error_msg "Please select a correct choice!";;
83 | esac
84 | done
85 | }
--------------------------------------------------------------------------------
/scripts/creality_dynamic_logos.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function creality_dynamic_logos_message(){
6 | top_line
7 | title 'Creality Dynamic Logos for Fluidd' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}This allows to have the dynamic Creality logos on the Fluidd ${white}│"
11 | echo -e " │ ${cyan}Web interface. ${white}│"
12 | hr
13 | bottom_line
14 | }
15 |
16 | function install_creality_dynamic_logos(){
17 | creality_dynamic_logos_message
18 | local yn
19 | while true; do
20 | install_msg "Creality Dynamic Logos for Fluidd" yn
21 | case "${yn}" in
22 | Y|y)
23 | echo -e "${white}"
24 | echo -e "Info: Copying files..."
25 | cp "$FLUIDD_LOGO_URL1" "$FLUIDD_FOLDER"/logo_creality_v1.svg
26 | cp "$FLUIDD_LOGO_URL2" "$FLUIDD_FOLDER"/logo_creality_v2.svg
27 | rm -f "$FLUIDD_FOLDER"/config.json
28 | cp "$FLUIDD_LOGO_URL3" "$FLUIDD_FOLDER"/config.json
29 | ok_msg "Creality Dynamic Logos for Fluidd have been installed successfully!"
30 | echo -e " You can now select ${yellow}Creality V1 ${white}or ${yellow}Creality V2 ${white}theme in Fluidd settings."
31 | echo -e " Note: In some cases, it's necessary to clear your web browser's cache to see themes appear."
32 | return;;
33 | N|n)
34 | error_msg "Installation canceled!"
35 | return;;
36 | *)
37 | error_msg "Please select a correct choice!";;
38 | esac
39 | done
40 | }
--------------------------------------------------------------------------------
/scripts/custom_boot_display.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function install_custom_boot_display_message(){
6 | top_line
7 | title 'Install Custom Boot Display' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}This allows to install a custom Creality-themed boot ${white}│"
11 | echo -e " │ ${cyan}display. ${white}│"
12 | hr
13 | bottom_line
14 | }
15 |
16 | function remove_custom_boot_display_message(){
17 | top_line
18 | title 'Remove Custom Boot Display' "${yellow}"
19 | inner_line
20 | hr
21 | echo -e " │ ${cyan}This allows to restore stock boot display. ${white}│"
22 | hr
23 | bottom_line
24 | }
25 |
26 | function install_custom_boot_display(){
27 | install_custom_boot_display_message
28 | local yn
29 | while true; do
30 | install_msg "Custom Boot Display" yn
31 | case "${yn}" in
32 | Y|y)
33 | echo -e "${white}"
34 | local printer_choice
35 | while true; do
36 | 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
37 | case "${printer_choice}" in
38 | K1|k1)
39 | echo -e "${white}"
40 | echo -e "Info: Removing stock files..."
41 | rm -rf "$BOOT_DISPLAY_FOLDER"/part0
42 | rm -f "$BOOT_DISPLAY_FOLDER"/boot-display.conf
43 | echo -e "Info: Extracting custom files..."
44 | tar -xvf "$BOOT_DISPLAY_K1_URL" -C "$BOOT_DISPLAY_FOLDER"
45 | break;;
46 | K1MAX|k1max)
47 | echo -e "${white}"
48 | echo -e "Info: Removing stock files..."
49 | rm -rf "$BOOT_DISPLAY_FOLDER"/part0
50 | rm -f "$BOOT_DISPLAY_FOLDER"/boot-display.conf
51 | echo -e "Info: Extracting custom files..."
52 | tar -xvf "$BOOT_DISPLAY_K1M_URL" -C "$BOOT_DISPLAY_FOLDER"
53 | break;;
54 | *)
55 | error_msg "Please select a correct choice!";;
56 | esac
57 | done
58 | ok_msg "Custom Boot Display has been installed successfully!"
59 | return;;
60 | N|n)
61 | error_msg "Installation canceled!"
62 | return;;
63 | *)
64 | error_msg "Please select a correct choice!";;
65 | esac
66 | done
67 | }
68 |
69 | function remove_custom_boot_display(){
70 | remove_custom_boot_display_message
71 | local yn
72 | while true; do
73 | remove_msg "Custom Boot Display" yn
74 | case "${yn}" in
75 | Y|y)
76 | echo -e "${white}"
77 | echo -e "Info: Removing custom files..."
78 | rm -rf "$BOOT_DISPLAY_FOLDER"/part0
79 | rm -f "$BOOT_DISPLAY_FOLDER"/boot-display.conf
80 | echo -e "Info: Extracting stock files..."
81 | tar -xvf "$BOOT_DISPLAY_STOCK_URL" -C "$BOOT_DISPLAY_FOLDER"
82 | ok_msg "Custom Boot Display has been removed successfully!"
83 | return;;
84 | N|n)
85 | error_msg "Deletion canceled!"
86 | return;;
87 | *)
88 | error_msg "Please select a correct choice!";;
89 | esac
90 | done
91 | }
--------------------------------------------------------------------------------
/scripts/entware.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function entware_message(){
6 | top_line
7 | title 'Entware' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}Entware is a software repository for devices which use Linux ${white}│"
11 | echo -e " │ ${cyan}kernel. It allows packages to be added to your printer. ${white}│"
12 | hr
13 | bottom_line
14 | }
15 |
16 | function install_entware(){
17 | entware_message
18 | local yn
19 | while true; do
20 | install_msg "Entware" yn
21 | case "${yn}" in
22 | Y|y)
23 | echo -e "${white}"
24 | echo -e "Info: Running Entware installer..."
25 | set +e
26 | chmod 755 "$ENTWARE_URL"
27 | sh "$ENTWARE_URL"
28 | set -e
29 | ok_msg "Entware has been installed successfully!"
30 | echo -e " Disconnect and reconnect SSH session, and you can now install packages with: ${yellow}opkg install ${white}"
31 | return;;
32 | N|n)
33 | error_msg "Installation canceled!"
34 | return;;
35 | *)
36 | error_msg "Please select a correct choice!";;
37 | esac
38 | done
39 | }
40 |
41 | function remove_entware(){
42 | entware_message
43 | local yn
44 | while true; do
45 | remove_msg "Entware" yn
46 | case "${yn}" in
47 | Y|y)
48 | echo -e "${white}"
49 | echo -e "Info: Removing startup script..."
50 | rm -f /etc/init.d/S50unslung
51 | echo -e "Info: Removing directories..."
52 | rm -rf /usr/data/opt
53 | if [ -L /opt ]; then
54 | rm /opt
55 | mkdir -p /opt
56 | chmod 755 /opt
57 | fi
58 | echo -e "Info: Removing SFTP server symlink..."
59 | [ -L /usr/libexec/sftp-server ] && rm /usr/libexec/sftp-server
60 | echo -e "Info: Removing changes in system profile..."
61 | rm -f /etc/profile.d/entware.sh
62 | sed -i 's/\/opt\/bin:\/opt\/sbin:\/bin:/\/bin:/' /etc/profile
63 | ok_msg "Entware has been removed successfully!"
64 | return;;
65 | N|n)
66 | error_msg "Deletion canceled!"
67 | return;;
68 | *)
69 | error_msg "Please select a correct choice!";;
70 | esac
71 | done
72 | }
--------------------------------------------------------------------------------
/scripts/gcode_shell_command.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function gcode_shell_command_message(){
6 | top_line
7 | title 'Klipper Gcode Shell Command' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}After installing this extension you can execute Linux ${white}│"
11 | echo -e " │ ${cyan}commands or even scripts from Klipper with custom commands ${white}│"
12 | echo -e " │ ${cyan}defined in your configuration files. ${white}│"
13 | hr
14 | bottom_line
15 | }
16 |
17 | function install_gcode_shell_command(){
18 | gcode_shell_command_message
19 | local yn
20 | while true; do
21 | install_msg "Klipper Gcode Shell Command" yn
22 | case "${yn}" in
23 | Y|y)
24 | echo -e "${white}"
25 | echo -e "Info: Linking file..."
26 | ln -sf "$KLIPPER_SHELL_URL" "$KLIPPER_EXTRAS_FOLDER"/gcode_shell_command.py
27 | echo -e "Info: Restarting Klipper service..."
28 | restart_klipper
29 | ok_msg "Klipper Gcode Shell Command has been installed successfully!"
30 | return;;
31 | N|n)
32 | error_msg "Installation canceled!"
33 | return;;
34 | *)
35 | error_msg "Please select a correct choice!";;
36 | esac
37 | done
38 | }
39 |
40 | function remove_gcode_shell_command(){
41 | gcode_shell_command_message
42 | local yn
43 | while true; do
44 | remove_msg "Klipper Gcode Shell Command" yn
45 | case "${yn}" in
46 | Y|y)
47 | echo -e "${white}"
48 | echo -e "Info: Removing files..."
49 | rm -f "$KLIPPER_EXTRAS_FOLDER"/gcode_shell_command.py
50 | rm -f "$KLIPPER_EXTRAS_FOLDER"/gcode_shell_command.pyc
51 | echo -e "Info: Restarting Klipper service..."
52 | restart_klipper
53 | ok_msg "Klipper Gcode Shell Command has been removed successfully!"
54 | return;;
55 | N|n)
56 | error_msg "Deletion canceled!"
57 | return;;
58 | *)
59 | error_msg "Please select a correct choice!";;
60 | esac
61 | done
62 | }
--------------------------------------------------------------------------------
/scripts/git_backup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function git_backup_message(){
6 | top_line
7 | title 'Git Backup' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}It allows to watch Klipper configuration folder and ${white}│"
11 | echo -e " │ ${cyan}automatically backup to GitHub whenever a change is made in ${white}│"
12 | echo -e " │ ${cyan}that directory. ${white}│"
13 | hr
14 | bottom_line
15 | }
16 |
17 | function install_git_backup(){
18 | git_backup_message
19 | local yn
20 | while true; do
21 | install_msg "Git Backup" yn
22 | case "${yn}" in
23 | Y|y)
24 | echo -e "${white}"
25 | if [ -f "$HS_CONFIG_FOLDER"/git-backup.cfg ]; then
26 | rm -f "$HS_CONFIG_FOLDER"/git-backup.cfg
27 | fi
28 | if [ -d "$KLIPPER_CONFIG_FOLDER"/.git ]; then
29 | rm -rf "$KLIPPER_CONFIG_FOLDER"/.git
30 | fi
31 | if [ -d "$HS_BACKUP_FOLDER"/git-backup ]; then
32 | rm -rf "$HS_BACKUP_FOLDER"/git-backup
33 | fi
34 | if [ ! -d "$HS_CONFIG_FOLDER" ]; then
35 | mkdir -p "$HS_CONFIG_FOLDER"
36 | fi
37 | echo -e "Info: Running Git Backup installer..."
38 | chmod 755 "$GIT_BACKUP_INSTALLER"
39 | sh "$GIT_BACKUP_INSTALLER" -i
40 | return;;
41 | N|n)
42 | error_msg "Installation canceled!"
43 | return;;
44 | *)
45 | error_msg "Please select a correct choice!";;
46 | esac
47 | done
48 | }
49 |
50 | function remove_git_backup(){
51 | git_backup_message
52 | local yn
53 | while true; do
54 | remove_msg "Git Backup" yn
55 | case "${yn}" in
56 | Y|y)
57 | echo -e "${white}"
58 | echo -e "Info: Stopping services..."
59 | set +e
60 | /etc/init.d/S52Git-Backup stop >/dev/null 2>&1
61 | killall -q git-backup.sh
62 | killall -q inotifywait
63 | set -e
64 | echo -e "Info: Removing files..."
65 | rm -f "$HS_CONFIG_FOLDER"/git-backup.cfg
66 | if [ -f "$INITD_FOLDER"/S52Git-Backup ];then
67 | rm -f "$INITD_FOLDER"/S52Git-Backup
68 | fi
69 | if [ -f "$INITD_FOLDER"/disabled.S52Git-Backup ];then
70 | rm -f "$INITD_FOLDER"/disabled.S52Git-Backup
71 | fi
72 | rm -rf "$KLIPPER_CONFIG_FOLDER"/.git
73 | rm -rf "$HS_BACKUP_FOLDER"/git-backup
74 | if [ ! -n "$(ls -A "$HS_BACKUP_FOLDER")" ]; then
75 | rm -rf "$HS_BACKUP_FOLDER"
76 | fi
77 | if grep -q "include Helper-Script/git-backup" "$PRINTER_CFG" ; then
78 | echo -e "Info: Removing Git Backup configurations in printer.cfg file..."
79 | sed -i '/include Helper-Script\/git-backup\.cfg/d' "$PRINTER_CFG"
80 | else
81 | echo -e "Info: Git Backup configurations are already removed in printer.cfg file..."
82 | fi
83 | if [ -f "$ENTWARE_FILE" ]; then
84 | echo -e "Info: Removing packages..."
85 | set +e
86 | "$ENTWARE_FILE" --autoremove remove inotifywait
87 | set -e
88 | fi
89 | if [ ! -n "$(ls -A "$HS_CONFIG_FOLDER")" ]; then
90 | rm -rf "$HS_CONFIG_FOLDER"
91 | fi
92 | echo -e "Info: Restarting Klipper service..."
93 | restart_klipper
94 | ok_msg "Git Backup has been removed successfully!"
95 | return;;
96 | N|n)
97 | error_msg "Deletion canceled!"
98 | return;;
99 | *)
100 | error_msg "Please select a correct choice!";;
101 | esac
102 | done
103 | }
104 |
--------------------------------------------------------------------------------
/scripts/guppyflo.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function guppyflo_message(){
6 | top_line
7 | title 'GuppyFLO' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}GuppyFLO is a self-hosted service that enables local/remote ${white}│"
11 | echo -e " │ ${cyan}management of multiple Klipper printers using Moonraker. ${white}│"
12 | hr
13 | bottom_line
14 | }
15 |
16 | function install_guppyflo(){
17 | guppyflo_message
18 | local yn
19 | while true; do
20 | install_msg "GuppyFLO" yn
21 | case "${yn}" in
22 | Y|y)
23 | echo -e "${white}"
24 | if [ -f "$INITD_FOLDER"/S99guppyflo ]; then
25 | echo -e "Info: Stopping GuppyFLO service..."
26 | /etc/init.d/S99guppyflo stop &> /dev/null
27 | fi
28 | if [ -f "$GUPPYFLO_FOLDER"/guppytunnel.json ]; then
29 | mv "$GUPPYFLO_FOLDER"/guppytunnel.json "$USR_DATA"/guppytunnel.json
30 | fi
31 | if [ -d "$GUPPYFLO_FOLDER" ]; then
32 | rm -rf "$GUPPYFLO_FOLDER"
33 | fi
34 | if [ -f "$INITD_FOLDER"/S99guppyflo ]; then
35 | rm -f "$INITD_FOLDER"/S99guppyflo
36 | fi
37 | if [ -f /lib/libeinfo.so.1 ]; then
38 | rm -f /lib/libeinfo.so.1
39 | fi
40 | if [ -f /lib/librc.so.1 ]; then
41 | rm -f /lib/librc.so.1
42 | fi
43 | echo -e "Info: Downloading GuppyFLO file..."
44 | "$CURL" -L "$GUPPYFLO_URL" -o "$USR_DATA"/guppyflo.zip
45 | echo -e "Info: Creating directory..."
46 | mkdir -p "$GUPPYFLO_FOLDER"
47 | echo -e "Info: Extracting files..."
48 | unzip "$USR_DATA"/guppyflo.zip -d "$GUPPYFLO_FOLDER"
49 | rm -f "$USR_DATA"/guppyflo.zip
50 | echo -e "Info: Linking files..."
51 | ln -sf "$GUPPYFLO_FOLDER"/services/S99guppyflo "$INITD_FOLDER"/S99guppyflo
52 | ln -sf "$GUPPYFLO_FOLDER"/services/respawn/libeinfo.so.1 /lib/libeinfo.so.1
53 | ln -sf "$GUPPYFLO_FOLDER"/services/respawn/librc.so.1 /lib/librc.so.1
54 | if [ -f "$USR_DATA"/guppytunnel.json ]; then
55 | mv "$USR_DATA"/guppytunnel.json "$GUPPYFLO_FOLDER"/guppytunnel.json
56 | fi
57 | echo -e "Info: Starting GuppyFLO service..."
58 | /etc/init.d/S99guppyflo start &> /dev/null
59 | ok_msg "GuppyFLO has been installed successfully!"
60 | echo -e " You can now connect to GuppyFLO Web Interface with ${yellow}http://$(check_ipaddress):9873${white}"
61 | return;;
62 | N|n)
63 | error_msg "Installation canceled!"
64 | return;;
65 | *)
66 | error_msg "Please select a correct choice!";;
67 | esac
68 | done
69 | }
70 |
71 | function remove_guppyflo(){
72 | guppyflo_message
73 | local yn
74 | while true; do
75 | remove_msg "GuppyFLO" yn
76 | case "${yn}" in
77 | Y|y)
78 | echo -e "${white}"
79 | if [ -f "$INITD_FOLDER"/S99guppyflo ]; then
80 | echo -e "Info: Stopping GuppyFLO service..."
81 | /etc/init.d/S99guppyflo stop &> /dev/null
82 | fi
83 | echo -e "Info: Removing files..."
84 | rm -rf "$GUPPYFLO_FOLDER"
85 | rm -f "$INITD_FOLDER"/S99guppyflo
86 | rm -f /lib/libeinfo.so.1
87 | rm -f /lib/librc.so.1
88 | ok_msg "GuppyFLO has been removed successfully!"
89 | return;;
90 | N|n)
91 | error_msg "Deletion canceled!"
92 | return;;
93 | *)
94 | error_msg "Please select a correct choice!";;
95 | esac
96 | done
97 | }
--------------------------------------------------------------------------------
/scripts/mainsail.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function mainsail_message(){
6 | top_line
7 | title 'Mainsail' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}Mainsail makes Klipper more accessible by adding a ${white}│"
11 | echo -e " │ ${cyan}lightweight, responsive web user interface, centred around ${white}│"
12 | echo -e " │ ${cyan}an intuitive and consistent design philosophy. ${white}│"
13 | echo -e " │ ${cyan}It will be accessible on port 4409. ${white}│"
14 | hr
15 | bottom_line
16 | }
17 |
18 | function install_mainsail(){
19 | mainsail_message
20 | local yn
21 | while true; do
22 | install_msg "Mainsail" yn
23 | case "${yn}" in
24 | Y|y)
25 | echo -e "${white}"
26 | echo -e "Info: Downloading Mainsail file..."
27 | "$CURL" -L "$MAINSAIL_URL" -o "$USR_DATA"/mainsail.zip
28 | echo -e "Info: Creating directory..."
29 | if [ -d "$MAINSAIL_FOLDER" ]; then
30 | rm -rf "$MAINSAIL_FOLDER"
31 | fi
32 | mkdir -p "$MAINSAIL_FOLDER"
33 | mv "$USR_DATA"/mainsail.zip "$MAINSAIL_FOLDER"
34 | echo -e "Info: Extracting files..."
35 | unzip "$MAINSAIL_FOLDER"/mainsail.zip -d "$MAINSAIL_FOLDER"
36 | echo -e "Info: Removing file..."
37 | rm -f "$MAINSAIL_FOLDER"/mainsail.zip
38 | if grep -q "#\[update_manager mainsail\]" "$MOONRAKER_CFG" ; then
39 | echo -e "Info: Enabling Mainsail configurations for Update Manager..."
40 | sed -i -e 's/^\s*#[[:space:]]*\[update_manager mainsail\]/[update_manager mainsail]/' -e '/^\[update_manager mainsail\]/,/^\s*$/ s/^\(\s*\)#/\1/' "$MOONRAKER_CFG"
41 | else
42 | echo -e "Info: Mainsail configurations are already enabled for Update Manager..."
43 | fi
44 | echo -e "Info: Restarting Nginx service..."
45 | restart_nginx
46 | echo -e "Info: Restarting Moonraker service..."
47 | stop_moonraker
48 | start_moonraker
49 | ok_msg "Mainsail has been installed successfully!"
50 | echo -e " You can now connect to Mainsail Web Interface with ${yellow}http://$(check_ipaddress):4409${white}"
51 | return;;
52 | N|n)
53 | error_msg "Installation canceled!"
54 | return;;
55 | *)
56 | error_msg "Please select a correct choice!";;
57 | esac
58 | done
59 | }
60 |
61 | function remove_mainsail(){
62 | mainsail_message
63 | local yn
64 | while true; do
65 | remove_msg "Mainsail" yn
66 | case "${yn}" in
67 | Y|y)
68 | echo -e "${white}"
69 | echo -e "Info: Removing files..."
70 | rm -rf "$MAINSAIL_FOLDER"
71 | if grep -q "\[update_manager mainsail\]" "$MOONRAKER_CFG" ; then
72 | echo -e "Info: Disabling Mainsail configurations for Update Manager..."
73 | sed -i '/^\[update_manager mainsail\]/,/^\s*$/ s/^\(\s*\)\([^#]\)/#\1\2/' "$MOONRAKER_CFG"
74 | echo -e "Info: Restarting Nginx service..."
75 | restart_nginx
76 | echo -e "Info: Restarting Moonraker service..."
77 | stop_moonraker
78 | start_moonraker
79 | else
80 | echo -e "Info: Mainsail configurations are already disabled for Update Manager..."
81 | fi
82 | ok_msg "Mainsail has been removed successfully!"
83 | return;;
84 | N|n)
85 | error_msg "Deletion canceled!"
86 | return;;
87 | *)
88 | error_msg "Please select a correct choice!";;
89 | esac
90 | done
91 | }
--------------------------------------------------------------------------------
/scripts/menu/10SE/customize_menu_10SE.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function customize_menu_ui_10se() {
6 | top_line
7 | title '[ CUSTOMIZE MENU ]' "${yellow}"
8 | inner_line
9 | hr
10 | menu_option '1' 'Remove' 'Creality Web Interface'
11 | menu_option '2' 'Restore' 'Creality Web Interface'
12 | hr
13 | menu_option '3' 'Install' 'Guppy Screen'
14 | menu_option '4' 'Remove' 'Guppy Screen'
15 | hr
16 | menu_option '5' 'Install' 'Creality Dynamic Logos for Fluidd'
17 | hr
18 | inner_line
19 | hr
20 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
21 | bottom_menu_option 'q' 'Exit' "${darkred}"
22 | hr
23 | version_line "$(get_script_version)"
24 | bottom_line
25 | }
26 |
27 | function customize_menu_10se() {
28 | clear
29 | customize_menu_ui_10se
30 | local customize_menu_opt
31 | while true; do
32 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" customize_menu_opt
33 | case "${customize_menu_opt}" in
34 | 1)
35 | if [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then
36 | error_msg "Fluidd or Mainsail is needed, please install one of them first!"
37 | elif [ ! -f "$CREALITY_WEB_FILE" ]; then
38 | error_msg "Creality Web Interface is already removed!"
39 | echo -e " ${darkred}Please restore Creality Web Interface first if you want to change the default Web Interface.${white}"
40 | echo
41 | else
42 | run "remove_creality_web_interface" "customize_menu_ui_10se"
43 | fi;;
44 | 2)
45 | if [ -f "$CREALITY_WEB_FILE" ]; then
46 | error_msg "Creality Web Interface is already present!"
47 | elif [ ! -f "$INITD_FOLDER"/S99start_app ]; then
48 | error_msg "Guppy Screen need to be removed first to restore Creality Web Interface!"
49 | else
50 | run "restore_creality_web_interface" "customize_menu_ui_10se"
51 | fi;;
52 | 3)
53 | if [ -d "$GUPPY_SCREEN_FOLDER" ]; then
54 | error_msg "Guppy Screen is already installed!"
55 | elif [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then
56 | error_msg "Moonraker and Nginx are needed, please install them first!"
57 | elif [ "$(curl -s localhost:7125/server/info | jq .result.klippy_connected)" != "true" ]; then
58 | error_msg "Moonraker and Klipper do not seem to be functional. Please check this!"
59 | elif [ ! -f /lib/ld-2.29.so ]; then
60 | error_msg "Make sure you're running latest firmware version!"
61 | elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then
62 | error_msg "Klipper Gcode Shell Command is needed, please install it first!"
63 | elif [ -d "$IMP_SHAPERS_FOLDER" ]; then
64 | error_msg "Please remove Improved Shapers Calibrations first, Guppy Screen already use it!"
65 | else
66 | run "install_guppy_screen" "customize_menu_ui_10se"
67 | fi;;
68 | 4)
69 | if [ ! -d "$GUPPY_SCREEN_FOLDER" ]; then
70 | error_msg "Guppy Screen is not installed!"
71 | else
72 | run "remove_guppy_screen" "customize_menu_ui_10se"
73 | fi;;
74 | 5)
75 | if [ -f "$FLUIDD_LOGO_FILE" ]; then
76 | error_msg "Creality Dynamic Logos for Fluidd are already installed!"
77 | elif [ ! -d "$FLUIDD_FOLDER" ]; then
78 | error_msg "Fluidd is needed, please install it first!"
79 | else
80 | run "install_creality_dynamic_logos" "customize_menu_ui_10se"
81 | fi;;
82 | B|b)
83 | clear; main_menu; break;;
84 | Q|q)
85 | clear; exit 0;;
86 | *)
87 | error_msg "Please select a correct choice!";;
88 | esac
89 | done
90 | customize_menu_10se
91 | }
92 |
--------------------------------------------------------------------------------
/scripts/menu/10SE/info_menu_10SE.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function check_folder_10se() {
6 | local folder_path="$1"
7 | if [ -d "$folder_path" ]; then
8 | echo -e "${green}✓"
9 | else
10 | echo -e "${red}✗"
11 | fi
12 | }
13 |
14 | function check_file_10se() {
15 | local file_path="$1"
16 | if [ -f "$file_path" ]; then
17 | echo -e "${green}✓"
18 | else
19 | echo -e "${red}✗"
20 | fi
21 | }
22 |
23 | function check_simplyprint_10se() {
24 | if [ ! -f "$MOONRAKER_CFG" ]; then
25 | echo -e "${red}✗"
26 | elif grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
27 | echo -e "${green}✓"
28 | else
29 | echo -e "${red}✗"
30 | fi
31 | }
32 |
33 | function info_menu_ui_10se() {
34 | top_line
35 | title '[ INFORMATION MENU ]' "${yellow}"
36 | inner_line
37 | hr
38 | subtitle '•ESSENTIALS:'
39 | info_line "$(check_folder_10se "$MOONRAKER_FOLDER")" 'Moonraker & Nginx'
40 | info_line "$(check_folder_10se "$FLUIDD_FOLDER")" 'Fluidd'
41 | info_line "$(check_folder_10se "$MAINSAIL_FOLDER")" 'Mainsail'
42 | hr
43 | subtitle '•UTILITIES:'
44 | info_line "$(check_file_10se "$ENTWARE_FILE")" 'Entware'
45 | info_line "$(check_file_10se "$KLIPPER_SHELL_FILE")" 'Klipper Gcode Shell Command'
46 | hr
47 | subtitle '•IMPROVEMENTS:'
48 | info_line "$(check_folder_10se "$IMP_SHAPERS_FOLDER")" 'Improved Shapers Calibrations'
49 | info_line "$(check_file_10se "$SAVE_ZOFFSET_FILE")" 'Save Z-Offset Macros'
50 | info_line "$(check_file_10se "$GIT_BACKUP_FILE")" 'Git Backup'
51 | hr
52 | subtitle '•CAMERA:'
53 | info_line "$(check_file_10se "$TIMELAPSE_FILE")" 'Moonraker Timelapse'
54 | info_line "$(check_file_10se "$CAMERA_SETTINGS_FILE")" 'Nebula Camera Settings Control'
55 | info_line "$(check_file_10se "$USB_CAMERA_FILE")" 'USB Camera Support'
56 | hr
57 | subtitle '•REMOTE ACCESS:'
58 | info_line "$(check_folder_10se "$OCTOEVERYWHERE_FOLDER")" 'OctoEverywhere'
59 | info_line "$(check_folder_10se "$MOONRAKER_OBICO_FOLDER")" 'Obico'
60 | info_line "$(check_folder_10se "$GUPPYFLO_FOLDER")" 'GuppyFLO'
61 | info_line "$(check_folder_10se "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion'
62 | info_line "$(check_folder_10se "$OCTOAPP_COMPANION_FOLDER")" 'OctoApp Companion'
63 | info_line "$(check_simplyprint_10se)" 'SimplyPrint'
64 | hr
65 | subtitle '•CUSTOMIZATION:'
66 | info_line "$(check_file_10se "$CREALITY_WEB_FILE")" 'Creality Web Interface'
67 | info_line "$(check_folder_10se "$GUPPY_SCREEN_FOLDER")" 'Guppy Screen'
68 | info_line "$(check_file_10se "$FLUIDD_LOGO_FILE")" 'Creality Dynamic Logos for Fluidd'
69 | hr
70 | inner_line
71 | hr
72 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
73 | bottom_menu_option 'q' 'Exit' "${darkred}"
74 | hr
75 | version_line "$(get_script_version)"
76 | bottom_line
77 | }
78 |
79 | function info_menu_10se() {
80 | clear
81 | info_menu_ui_10se
82 | local info_menu_opt
83 | while true; do
84 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" info_menu_opt
85 | case "${info_menu_opt}" in
86 | B|b)
87 | clear; main_menu; break;;
88 | Q|q)
89 | clear; exit 0;;
90 | *)
91 | error_msg "Please select a correct choice!";;
92 | esac
93 | done
94 | info_menu_10se
95 | }
96 |
--------------------------------------------------------------------------------
/scripts/menu/10SE/tools_menu_10SE.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function tools_menu_ui_10se() {
6 | top_line
7 | title '[ TOOLS MENU ]' "${yellow}"
8 | inner_line
9 | hr
10 | menu_option ' 1' 'Prevent updating' 'Klipper configuration files'
11 | menu_option ' 2' 'Allow updating' 'Klipper configuration files'
12 | hr
13 | menu_option ' 3' 'Enable' 'camera settings in Moonraker'
14 | menu_option ' 4' 'Disable' 'camera settings in Moonraker'
15 | hr
16 | menu_option ' 5' 'Restart' 'Nginx service'
17 | menu_option ' 6' 'Restart' 'Moonraker service'
18 | menu_option ' 7' 'Restart' 'Klipper service'
19 | hr
20 | menu_option ' 8' 'Update' 'Entware packages'
21 | hr
22 | menu_option ' 9' 'Clear' 'cache'
23 | menu_option '10' 'Clear' 'logs files'
24 | hr
25 | menu_option '11' 'Restore' 'a previous firmware'
26 | hr
27 | menu_option '12' 'Reset' 'factory settings'
28 | hr
29 | inner_line
30 | hr
31 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
32 | bottom_menu_option 'q' 'Exit' "${darkred}"
33 | hr
34 | version_line "$(get_script_version)"
35 | bottom_line
36 | }
37 |
38 | function tools_menu_10se() {
39 | clear
40 | tools_menu_ui_10se
41 | local tools_menu_opt
42 | while true; do
43 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" tools_menu_opt
44 | case "${tools_menu_opt}" in
45 | 1)
46 | if [ -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then
47 | error_msg "Updating Klipper configuration files is already prevented!"
48 | else
49 | run "prevent_updating_klipper_files" "tools_menu_ui_10se"
50 | fi;;
51 | 2)
52 | if [ ! -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then
53 | error_msg "Updating Klipper configuration files is already allowed!"
54 | else
55 | run "allow_updating_klipper_files" "tools_menu_ui_10se"
56 | fi;;
57 | 3)
58 | if grep -q "^\[webcam Camera\]$" "$MOONRAKER_CFG"; then
59 | error_msg "Camera settings are alredy enabled in Moonraker!"
60 | else
61 | run "enable_camera_settings" "tools_menu_ui_10se"
62 | fi;;
63 | 4)
64 | if grep -q "^#\[webcam Camera\]" "$MOONRAKER_CFG"; then
65 | error_msg "Camera settings are alredy disabled in Moonraker!"
66 | else
67 | run "disable_camera_settings" "tools_menu_ui_10se"
68 | fi;;
69 | 5)
70 | if [ ! -d "$NGINX_FOLDER" ]; then
71 | error_msg "Nginx is not installed!"
72 | else
73 | run "restart_nginx_action" "tools_menu_ui_10se"
74 | fi;;
75 | 6)
76 | if [ ! -d "$MOONRAKER_FOLDER" ]; then
77 | error_msg "Moonraker is not installed!"
78 | else
79 | run "restart_moonraker_action" "tools_menu_ui_10se"
80 | fi;;
81 | 7)
82 | if [ ! -f "$INITD_FOLDER"/S55klipper_service ]; then
83 | error_msg "Klipper service is not present!"
84 | else
85 | run "restart_klipper_action" "tools_menu_ui_10se"
86 | fi;;
87 | 8)
88 | if [ ! -f "$ENTWARE_FILE" ]; then
89 | error_msg "Entware is not installed!"
90 | else
91 | run "update_entware_packages" "tools_menu_ui_10se"
92 | fi;;
93 | 9)
94 | run "clear_cache" "tools_menu_ui_10see";;
95 | 10)
96 | run "clear_logs" "tools_menu_ui_10se";;
97 | 11)
98 | run "restore_previous_firmware" "tools_menu_ui_10se";;
99 | 12)
100 | run "reset_factory_settings" "tools_menu_ui_10se";;
101 | B|b)
102 | clear; main_menu; break;;
103 | Q|q)
104 | clear; exit 0;;
105 | *)
106 | error_msg "Please select a correct choice!";;
107 | esac
108 | done
109 | tools_menu_10se
110 | }
111 |
--------------------------------------------------------------------------------
/scripts/menu/3KE/customize_menu_3KE.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function customize_menu_ui_3ke() {
6 | top_line
7 | title '[ CUSTOMIZE MENU ]' "${yellow}"
8 | inner_line
9 | hr
10 | menu_option '1' 'Remove' 'Creality Web Interface'
11 | menu_option '2' 'Restore' 'Creality Web Interface'
12 | hr
13 | menu_option '3' 'Install' 'Guppy Screen'
14 | menu_option '4' 'Remove' 'Guppy Screen'
15 | hr
16 | menu_option '5' 'Install' 'Creality Dynamic Logos for Fluidd'
17 | hr
18 | inner_line
19 | hr
20 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
21 | bottom_menu_option 'q' 'Exit' "${darkred}"
22 | hr
23 | version_line "$(get_script_version)"
24 | bottom_line
25 | }
26 |
27 | function customize_menu_3ke() {
28 | clear
29 | customize_menu_ui_3ke
30 | local customize_menu_opt
31 | while true; do
32 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" customize_menu_opt
33 | case "${customize_menu_opt}" in
34 | 1)
35 | if [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then
36 | error_msg "Fluidd or Mainsail is needed, please install one of them first!"
37 | elif [ ! -f "$CREALITY_WEB_FILE" ]; then
38 | error_msg "Creality Web Interface is already removed!"
39 | echo -e " ${darkred}Please restore Creality Web Interface first if you want to change the default Web Interface.${white}"
40 | echo
41 | else
42 | run "remove_creality_web_interface" "customize_menu_ui_3ke"
43 | fi;;
44 | 2)
45 | if [ -f "$CREALITY_WEB_FILE" ]; then
46 | error_msg "Creality Web Interface is already present!"
47 | elif [ ! -f "$INITD_FOLDER"/S99start_app ]; then
48 | error_msg "Guppy Screen need to be removed first to restore Creality Web Interface!"
49 | else
50 | run "restore_creality_web_interface" "customize_menu_ui_3ke"
51 | fi;;
52 | 3)
53 | if [ -d "$GUPPY_SCREEN_FOLDER" ]; then
54 | error_msg "Guppy Screen is already installed!"
55 | elif [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then
56 | error_msg "Moonraker and Nginx are needed, please install them first!"
57 | elif [ "$(curl -s localhost:7125/server/info | jq .result.klippy_connected)" != "true" ]; then
58 | error_msg "Moonraker and Klipper do not seem to be functional. Please check this!"
59 | elif [ ! -f /lib/ld-2.29.so ]; then
60 | error_msg "Make sure you're running latest firmware version!"
61 | elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then
62 | error_msg "Klipper Gcode Shell Command is needed, please install it first!"
63 | elif [ -d "$IMP_SHAPERS_FOLDER" ]; then
64 | error_msg "Please remove Improved Shapers Calibrations first, Guppy Screen already use it!"
65 | else
66 | run "install_guppy_screen" "customize_menu_ui_3ke"
67 | fi;;
68 | 4)
69 | if [ ! -d "$GUPPY_SCREEN_FOLDER" ]; then
70 | error_msg "Guppy Screen is not installed!"
71 | else
72 | run "remove_guppy_screen" "customize_menu_ui_3ke"
73 | fi;;
74 | 5)
75 | if [ -f "$FLUIDD_LOGO_FILE" ]; then
76 | error_msg "Creality Dynamic Logos for Fluidd are already installed!"
77 | elif [ ! -d "$FLUIDD_FOLDER" ]; then
78 | error_msg "Fluidd is needed, please install it first!"
79 | else
80 | run "install_creality_dynamic_logos" "customize_menu_ui_3ke"
81 | fi;;
82 | B|b)
83 | clear; main_menu; break;;
84 | Q|q)
85 | clear; exit 0;;
86 | *)
87 | error_msg "Please select a correct choice!";;
88 | esac
89 | done
90 | customize_menu_3ke
91 | }
92 |
--------------------------------------------------------------------------------
/scripts/menu/3KE/info_menu_3KE.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function check_folder_3ke() {
6 | local folder_path="$1"
7 | if [ -d "$folder_path" ]; then
8 | echo -e "${green}✓"
9 | else
10 | echo -e "${red}✗"
11 | fi
12 | }
13 |
14 | function check_file_3ke() {
15 | local file_path="$1"
16 | if [ -f "$file_path" ]; then
17 | echo -e "${green}✓"
18 | else
19 | echo -e "${red}✗"
20 | fi
21 | }
22 |
23 | function check_simplyprint_3ke() {
24 | if [ ! -f "$MOONRAKER_CFG" ]; then
25 | echo -e "${red}✗"
26 | elif grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
27 | echo -e "${green}✓"
28 | else
29 | echo -e "${red}✗"
30 | fi
31 | }
32 |
33 | function info_menu_ui_3ke() {
34 | top_line
35 | title '[ INFORMATION MENU ]' "${yellow}"
36 | inner_line
37 | hr
38 | subtitle '•ESSENTIALS:'
39 | info_line "$(check_folder_3ke "$MOONRAKER_FOLDER")" 'Moonraker & Nginx'
40 | info_line "$(check_folder_3ke "$FLUIDD_FOLDER")" 'Fluidd'
41 | info_line "$(check_folder_3ke "$MAINSAIL_FOLDER")" 'Mainsail'
42 | hr
43 | subtitle '•UTILITIES:'
44 | info_line "$(check_file_3ke "$ENTWARE_FILE")" 'Entware'
45 | info_line "$(check_file_3ke "$KLIPPER_SHELL_FILE")" 'Klipper Gcode Shell Command'
46 | hr
47 | subtitle '•IMPROVEMENTS:'
48 | info_line "$(check_folder_3ke "$IMP_SHAPERS_FOLDER")" 'Improved Shapers Calibrations'
49 | info_line "$(check_file_3ke "$SAVE_ZOFFSET_FILE")" 'Save Z-Offset Macros'
50 | info_line "$(check_file_3ke "$SCREWS_ADJUST_FILE")" 'Screws Tilt Adjust Support'
51 | info_line "$(check_file_3ke "$M600_SUPPORT_FILE")" 'M600 Support'
52 | info_line "$(check_file_3ke "$GIT_BACKUP_FILE")" 'Git Backup'
53 | hr
54 | subtitle '•CAMERA:'
55 | info_line "$(check_file_3ke "$TIMELAPSE_FILE")" 'Moonraker Timelapse'
56 | info_line "$(check_file_3ke "$CAMERA_SETTINGS_FILE")" 'Nebula Camera Settings Control'
57 | info_line "$(check_file_3ke "$USB_CAMERA_FILE")" 'USB Camera Support'
58 | hr
59 | subtitle '•REMOTE ACCESS:'
60 | info_line "$(check_folder_3ke "$OCTOEVERYWHERE_FOLDER")" 'OctoEverywhere'
61 | info_line "$(check_folder_3ke "$MOONRAKER_OBICO_FOLDER")" 'Obico'
62 | info_line "$(check_folder_3ke "$GUPPYFLO_FOLDER")" 'GuppyFLO'
63 | info_line "$(check_folder_3ke "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion'
64 | info_line "$(check_folder_3ke "$OCTOAPP_COMPANION_FOLDER")" 'OctoApp Companion'
65 | info_line "$(check_simplyprint_3ke)" 'SimplyPrint'
66 | hr
67 | subtitle '•CUSTOMIZATION:'
68 | info_line "$(check_file_3ke "$CREALITY_WEB_FILE")" 'Creality Web Interface'
69 | info_line "$(check_folder_3ke "$GUPPY_SCREEN_FOLDER")" 'Guppy Screen'
70 | info_line "$(check_file_3ke "$FLUIDD_LOGO_FILE")" 'Creality Dynamic Logos for Fluidd'
71 | hr
72 | inner_line
73 | hr
74 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
75 | bottom_menu_option 'q' 'Exit' "${darkred}"
76 | hr
77 | version_line "$(get_script_version)"
78 | bottom_line
79 | }
80 |
81 | function info_menu_3ke() {
82 | clear
83 | info_menu_ui_3ke
84 | local info_menu_opt
85 | while true; do
86 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" info_menu_opt
87 | case "${info_menu_opt}" in
88 | B|b)
89 | clear; main_menu; break;;
90 | Q|q)
91 | clear; exit 0;;
92 | *)
93 | error_msg "Please select a correct choice!";;
94 | esac
95 | done
96 | info_menu_3ke
97 | }
98 |
--------------------------------------------------------------------------------
/scripts/menu/3KE/tools_menu_3KE.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function tools_menu_ui_3ke() {
6 | top_line
7 | title '[ TOOLS MENU ]' "${yellow}"
8 | inner_line
9 | hr
10 | menu_option ' 1' 'Prevent updating' 'Klipper configuration files'
11 | menu_option ' 2' 'Allow updating' 'Klipper configuration files'
12 | hr
13 | menu_option ' 3' 'Enable' 'camera settings in Moonraker'
14 | menu_option ' 4' 'Disable' 'camera settings in Moonraker'
15 | hr
16 | menu_option ' 5' 'Restart' 'Nginx service'
17 | menu_option ' 6' 'Restart' 'Moonraker service'
18 | menu_option ' 7' 'Restart' 'Klipper service'
19 | hr
20 | menu_option ' 8' 'Update' 'Entware packages'
21 | hr
22 | menu_option ' 9' 'Clear' 'cache'
23 | menu_option '10' 'Clear' 'logs files'
24 | hr
25 | menu_option '11' 'Restore' 'a previous firmware'
26 | hr
27 | menu_option '12' 'Reset' 'factory settings'
28 | hr
29 | inner_line
30 | hr
31 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
32 | bottom_menu_option 'q' 'Exit' "${darkred}"
33 | hr
34 | version_line "$(get_script_version)"
35 | bottom_line
36 | }
37 |
38 | function tools_menu_3ke() {
39 | clear
40 | tools_menu_ui_3ke
41 | local tools_menu_opt
42 | while true; do
43 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" tools_menu_opt
44 | case "${tools_menu_opt}" in
45 | 1)
46 | if [ -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then
47 | error_msg "Updating Klipper configuration files is already prevented!"
48 | else
49 | run "prevent_updating_klipper_files" "tools_menu_ui_3ke"
50 | fi;;
51 | 2)
52 | if [ ! -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then
53 | error_msg "Updating Klipper configuration files is already allowed!"
54 | else
55 | run "allow_updating_klipper_files" "tools_menu_ui_3ke"
56 | fi;;
57 | 3)
58 | if grep -q "^\[webcam Camera\]$" "$MOONRAKER_CFG"; then
59 | error_msg "Camera settings are alredy enabled in Moonraker!"
60 | else
61 | run "enable_camera_settings" "tools_menu_ui_3ke"
62 | fi;;
63 | 4)
64 | if grep -q "^#\[webcam Camera\]" "$MOONRAKER_CFG"; then
65 | error_msg "Camera settings are alredy disabled in Moonraker!"
66 | else
67 | run "disable_camera_settings" "tools_menu_ui_3ke"
68 | fi;;
69 | 5)
70 | if [ ! -d "$NGINX_FOLDER" ]; then
71 | error_msg "Nginx is not installed!"
72 | else
73 | run "restart_nginx_action" "tools_menu_ui_3ke"
74 | fi;;
75 | 6)
76 | if [ ! -d "$MOONRAKER_FOLDER" ]; then
77 | error_msg "Moonraker is not installed!"
78 | else
79 | run "restart_moonraker_action" "tools_menu_ui_3ke"
80 | fi;;
81 | 7)
82 | if [ ! -f "$INITD_FOLDER"/S55klipper_service ]; then
83 | error_msg "Klipper service is not present!"
84 | else
85 | run "restart_klipper_action" "tools_menu_ui_3ke"
86 | fi;;
87 | 8)
88 | if [ ! -f "$ENTWARE_FILE" ]; then
89 | error_msg "Entware is not installed!"
90 | else
91 | run "update_entware_packages" "tools_menu_ui_3ke"
92 | fi;;
93 | 9)
94 | run "clear_cache" "tools_menu_ui_3ke";;
95 | 10)
96 | run "clear_logs" "tools_menu_ui_3ke";;
97 | 11)
98 | run "restore_previous_firmware" "tools_menu_ui_3ke";;
99 | 12)
100 | run "reset_factory_settings" "tools_menu_ui_3ke";;
101 | B|b)
102 | clear; main_menu; break;;
103 | Q|q)
104 | clear; exit 0;;
105 | *)
106 | error_msg "Please select a correct choice!";;
107 | esac
108 | done
109 | tools_menu_3ke
110 | }
111 |
--------------------------------------------------------------------------------
/scripts/menu/3V3/customize_menu_3V3.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function customize_menu_ui_3v3() {
6 | top_line
7 | title '[ CUSTOMIZE MENU ]' "${yellow}"
8 | inner_line
9 | hr
10 | menu_option '1' 'Remove' 'Creality Web Interface'
11 | menu_option '2' 'Restore' 'Creality Web Interface'
12 | hr
13 | menu_option '3' 'Install' 'Guppy Screen'
14 | menu_option '4' 'Remove' 'Guppy Screen'
15 | hr
16 | menu_option '5' 'Install' 'Creality Dynamic Logos for Fluidd'
17 | hr
18 | inner_line
19 | hr
20 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
21 | bottom_menu_option 'q' 'Exit' "${darkred}"
22 | hr
23 | version_line "$(get_script_version)"
24 | bottom_line
25 | }
26 |
27 | function customize_menu_3v3() {
28 | clear
29 | customize_menu_ui_3v3
30 | local customize_menu_opt
31 | while true; do
32 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" customize_menu_opt
33 | case "${customize_menu_opt}" in
34 | 1)
35 | if [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then
36 | error_msg "Updated Fluidd or Mainsail is needed, please install one of them first!"
37 | elif [ ! -f "$CREALITY_WEB_FILE" ]; then
38 | error_msg "Creality Web Interface is already removed!"
39 | echo -e " ${darkred}Please restore Creality Web Interface first if you want to change the default Web Interface.${white}"
40 | echo
41 | else
42 | run "remove_creality_web_interface" "customize_menu_ui_3v3"
43 | fi;;
44 | 2)
45 | if [ -f "$CREALITY_WEB_FILE" ]; then
46 | error_msg "Creality Web Interface is already present!"
47 | elif [ ! -f "$INITD_FOLDER"/S99start_app ]; then
48 | error_msg "Guppy Screen need to be removed first to restore Creality Web Interface!"
49 | else
50 | run "restore_creality_web_interface" "customize_menu_ui_3v3"
51 | fi;;
52 | 3)
53 | if [ -d "$GUPPY_SCREEN_FOLDER" ]; then
54 | error_msg "Guppy Screen is already installed!"
55 | elif [ ! -d "$MOONRAKER_FOLDER" ]; then
56 | error_msg "Updated Moonraker is needed, please install it first!"
57 | elif [ "$(curl -s localhost:7125/server/info | jq .result.klippy_connected)" != "true" ]; then
58 | error_msg "Moonraker and Klipper do not seem to be functional. Please check this!"
59 | elif [ ! -f /lib/ld-2.29.so ]; then
60 | error_msg "Make sure you're running latest firmware version!"
61 | elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then
62 | error_msg "Klipper Gcode Shell Command is needed, please install it first!"
63 | elif [ -d "$IMP_SHAPERS_FOLDER" ]; then
64 | error_msg "Please remove Improved Shapers Calibrations first, Guppy Screen already use it!"
65 | else
66 | run "install_guppy_screen" "customize_menu_ui_3v3"
67 | fi;;
68 | 4)
69 | if [ ! -d "$GUPPY_SCREEN_FOLDER" ]; then
70 | error_msg "Guppy Screen is not installed!"
71 | else
72 | run "remove_guppy_screen" "customize_menu_ui_3v3"
73 | fi;;
74 | 5)
75 | if [ -f "$FLUIDD_LOGO_FILE" ]; then
76 | error_msg "Creality Dynamic Logos for Fluidd are already installed!"
77 | elif [ ! -d "$FLUIDD_FOLDER" ]; then
78 | error_msg "Updated Fluidd is needed, please install it first!"
79 | else
80 | run "install_creality_dynamic_logos" "customize_menu_ui_3v3"
81 | fi;;
82 | B|b)
83 | clear; main_menu; break;;
84 | Q|q)
85 | clear; exit 0;;
86 | *)
87 | error_msg "Please select a correct choice!";;
88 | esac
89 | done
90 | customize_menu_3v3
91 | }
92 |
--------------------------------------------------------------------------------
/scripts/menu/3V3/info_menu_3V3.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function check_folder_3v3() {
6 | local folder_path="$1"
7 | if [ -d "$folder_path" ]; then
8 | echo -e "${green}✓"
9 | else
10 | echo -e "${red}✗"
11 | fi
12 | }
13 |
14 | function check_file_3v3() {
15 | local file_path="$1"
16 | if [ -f "$file_path" ]; then
17 | echo -e "${green}✓"
18 | else
19 | echo -e "${red}✗"
20 | fi
21 | }
22 |
23 | function check_simplyprint_3v3() {
24 | if [ ! -f "$MOONRAKER_CFG" ]; then
25 | echo -e "${red}✗"
26 | elif grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
27 | echo -e "${green}✓"
28 | else
29 | echo -e "${red}✗"
30 | fi
31 | }
32 |
33 | function info_menu_ui_3v3() {
34 | top_line
35 | title '[ INFORMATION MENU ]' "${yellow}"
36 | inner_line
37 | hr
38 | subtitle '•ESSENTIALS:'
39 | info_line "$(check_folder_3v3 "$MOONRAKER_FOLDER")" 'Updated Moonraker'
40 | info_line "$(check_folder_3v3 "$FLUIDD_FOLDER")" 'Updated Fluidd'
41 | info_line "$(check_folder_3v3 "$MAINSAIL_FOLDER")" 'Mainsail'
42 | hr
43 | subtitle '•UTILITIES:'
44 | info_line "$(check_file_3v3 "$ENTWARE_FILE")" 'Entware'
45 | info_line "$(check_file_3v3 "$KLIPPER_SHELL_FILE")" 'Klipper Gcode Shell Command'
46 | hr
47 | subtitle '•IMPROVEMENTS:'
48 | info_line "$(check_folder_3v3 "$KAMP_FOLDER")" 'Klipper Adaptive Meshing & Purging'
49 | info_line "$(check_file_3v3 "$BUZZER_FILE")" 'Buzzer Support'
50 | info_line "$(check_folder_3v3 "$IMP_SHAPERS_FOLDER")" 'Improved Shapers Calibrations'
51 | info_line "$(check_file_3v3 "$USEFUL_MACROS_FILE")" 'Useful Macros'
52 | info_line "$(check_file_3v3 "$SAVE_ZOFFSET_FILE")" 'Save Z-Offset Macros'
53 | info_line "$(check_file_3v3 "$M600_SUPPORT_FILE")" 'M600 Support'
54 | info_line "$(check_file_3v3 "$GIT_BACKUP_FILE")" 'Git Backup'
55 | hr
56 | subtitle '•CAMERA:'
57 | info_line "$(check_file_3v3 "$TIMELAPSE_FILE")" 'Moonraker Timelapse'
58 | info_line "$(check_file_3v3 "$CAMERA_SETTINGS_FILE")" 'Nebula Camera Settings Control'
59 | info_line "$(check_file_3v3 "$USB_CAMERA_FILE")" 'USB Camera Support'
60 | hr
61 | subtitle '•REMOTE ACCESS:'
62 | info_line "$(check_folder_3v3 "$OCTOEVERYWHERE_FOLDER")" 'OctoEverywhere'
63 | info_line "$(check_folder_3v3 "$MOONRAKER_OBICO_FOLDER")" 'Obico'
64 | info_line "$(check_folder_3v3 "$GUPPYFLO_FOLDER")" 'GuppyFLO'
65 | info_line "$(check_folder_3v3 "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion'
66 | info_line "$(check_folder_3v3 "$OCTOAPP_COMPANION_FOLDER")" 'OctoApp Companion'
67 | info_line "$(check_simplyprint_3v3)" 'SimplyPrint'
68 | hr
69 | subtitle '•CUSTOMIZATION:'
70 | info_line "$(check_file_3v3 "$CREALITY_WEB_FILE")" 'Creality Web Interface'
71 | info_line "$(check_folder_3v3 "$GUPPY_SCREEN_FOLDER")" 'Guppy Screen'
72 | info_line "$(check_file_3v3 "$FLUIDD_LOGO_FILE")" 'Creality Dynamic Logos for Fluidd'
73 | hr
74 | inner_line
75 | hr
76 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
77 | bottom_menu_option 'q' 'Exit' "${darkred}"
78 | hr
79 | version_line "$(get_script_version)"
80 | bottom_line
81 | }
82 |
83 | function info_menu_3v3() {
84 | clear
85 | info_menu_ui_3v3
86 | local info_menu_opt
87 | while true; do
88 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" info_menu_opt
89 | case "${info_menu_opt}" in
90 | B|b)
91 | clear; main_menu; break;;
92 | Q|q)
93 | clear; exit 0;;
94 | *)
95 | error_msg "Please select a correct choice!";;
96 | esac
97 | done
98 | info_menu_3v3
99 | }
100 |
--------------------------------------------------------------------------------
/scripts/menu/3V3/tools_menu_3V3.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function tools_menu_ui_3v3() {
6 | top_line
7 | title '[ TOOLS MENU ]' "${yellow}"
8 | inner_line
9 | hr
10 | menu_option ' 1' 'Prevent updating' 'Klipper configuration files'
11 | menu_option ' 2' 'Allow updating' 'Klipper configuration files'
12 | menu_option ' 3' 'Fix' 'printing Gcode files from folder'
13 | hr
14 | menu_option ' 4' 'Enable' 'camera settings in Moonraker'
15 | menu_option ' 5' 'Disable' 'camera settings in Moonraker'
16 | hr
17 | menu_option ' 6' 'Restart' 'Nginx service'
18 | menu_option ' 7' 'Restart' 'Moonraker service'
19 | menu_option ' 8' 'Restart' 'Klipper service'
20 | hr
21 | menu_option ' 9' 'Update' 'Entware packages'
22 | hr
23 | menu_option '10' 'Clear' 'cache'
24 | menu_option '11' 'Clear' 'logs files'
25 | hr
26 | menu_option '12' 'Restore' 'a previous firmware'
27 | hr
28 | menu_option '13' 'Reset' 'factory settings'
29 | hr
30 | inner_line
31 | hr
32 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
33 | bottom_menu_option 'q' 'Exit' "${darkred}"
34 | hr
35 | version_line "$(get_script_version)"
36 | bottom_line
37 | }
38 |
39 | function tools_menu_3v3() {
40 | clear
41 | tools_menu_ui_3v3
42 | local tools_menu_opt
43 | while true; do
44 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" tools_menu_opt
45 | case "${tools_menu_opt}" in
46 | 1)
47 | if [ -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then
48 | error_msg "Updating Klipper configuration files is already prevented!"
49 | else
50 | run "prevent_updating_klipper_files" "tools_menu_ui_3v3"
51 | fi;;
52 | 2)
53 | if [ ! -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then
54 | error_msg "Updating Klipper configuration files is already allowed!"
55 | else
56 | run "allow_updating_klipper_files" "tools_menu_ui_3v3"
57 | fi;;
58 | 3)
59 | if [ -f "$KLIPPER_KLIPPY_FOLDER"/gcode.py ]; then
60 | run "printing_gcode_from_folder" "tools_menu_ui_3v3"
61 | fi;;
62 | 4)
63 | if grep -q "^\[webcam Camera\]$" "$MOONRAKER_CFG"; then
64 | error_msg "Camera settings are alredy enabled in Moonraker!"
65 | else
66 | run "enable_camera_settings" "tools_menu_ui_3v3"
67 | fi;;
68 | 5)
69 | if grep -q "^#\[webcam Camera\]" "$MOONRAKER_CFG"; then
70 | error_msg "Camera settings are alredy disabled in Moonraker!"
71 | else
72 | run "disable_camera_settings" "tools_menu_ui_3v3"
73 | fi;;
74 | 6)
75 | if [ ! -d "$NGINX_FOLDER" ]; then
76 | error_msg "Nginx is not installed!"
77 | else
78 | run "restart_nginx_action" "tools_menu_ui_3v3"
79 | fi;;
80 | 7)
81 | if [ ! -d "$MOONRAKER_FOLDER" ]; then
82 | error_msg "Moonraker is not installed!"
83 | else
84 | run "restart_moonraker_action" "tools_menu_ui_3v3"
85 | fi;;
86 | 8)
87 | if [ ! -f "$INITD_FOLDER"/S55klipper_service ]; then
88 | error_msg "Klipper service is not present!"
89 | else
90 | run "restart_klipper_action" "tools_menu_ui_3v3"
91 | fi;;
92 | 9)
93 | if [ ! -f "$ENTWARE_FILE" ]; then
94 | error_msg "Entware is not installed!"
95 | else
96 | run "update_entware_packages" "tools_menu_ui_3v3"
97 | fi;;
98 | 10)
99 | run "clear_cache" "tools_menu_ui_3v3";;
100 | 11)
101 | run "clear_logs" "tools_menu_ui_3v3";;
102 | 12)
103 | run "restore_previous_firmware" "tools_menu_ui_3v3";;
104 | 13)
105 | run "reset_factory_settings" "tools_menu_ui_3v3";;
106 | B|b)
107 | clear; main_menu; break;;
108 | Q|q)
109 | clear; exit 0;;
110 | *)
111 | error_msg "Please select a correct choice!";;
112 | esac
113 | done
114 | tools_menu_3v3
115 | }
116 |
--------------------------------------------------------------------------------
/scripts/menu/E5M/customize_menu_E5M.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function customize_menu_ui_e5m() {
6 | top_line
7 | title '[ CUSTOMIZE MENU ]' "${yellow}"
8 | inner_line
9 | hr
10 | menu_option '1' 'Remove' 'Creality Web Interface'
11 | menu_option '2' 'Restore' 'Creality Web Interface'
12 | hr
13 | menu_option '3' 'Install' 'Guppy Screen'
14 | menu_option '4' 'Remove' 'Guppy Screen'
15 | hr
16 | menu_option '5' 'Install' 'Creality Dynamic Logos for Fluidd'
17 | hr
18 | inner_line
19 | hr
20 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
21 | bottom_menu_option 'q' 'Exit' "${darkred}"
22 | hr
23 | version_line "$(get_script_version)"
24 | bottom_line
25 | }
26 |
27 | function customize_menu_e5m() {
28 | clear
29 | customize_menu_ui_e5m
30 | local customize_menu_opt
31 | while true; do
32 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" customize_menu_opt
33 | case "${customize_menu_opt}" in
34 | 1)
35 | if [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then
36 | error_msg "Fluidd or Mainsail is needed, please install one of them first!"
37 | elif [ ! -f "$CREALITY_WEB_FILE" ]; then
38 | error_msg "Creality Web Interface is already removed!"
39 | echo -e " ${darkred}Please restore Creality Web Interface first if you want to change the default Web Interface.${white}"
40 | echo
41 | else
42 | run "remove_creality_web_interface" "customize_menu_ui_e5m"
43 | fi;;
44 | 2)
45 | if [ -f "$CREALITY_WEB_FILE" ]; then
46 | error_msg "Creality Web Interface is already present!"
47 | elif [ ! -f "$INITD_FOLDER"/S99start_app ]; then
48 | error_msg "Guppy Screen need to be removed first to restore Creality Web Interface!"
49 | else
50 | run "restore_creality_web_interface" "customize_menu_ui_e5m"
51 | fi;;
52 | 3)
53 | if [ -d "$GUPPY_SCREEN_FOLDER" ]; then
54 | error_msg "Guppy Screen is already installed!"
55 | elif [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then
56 | error_msg "Moonraker and Nginx are needed, please install them first!"
57 | elif [ "$(curl -s localhost:7125/server/info | jq .result.klippy_connected)" != "true" ]; then
58 | error_msg "Moonraker and Klipper do not seem to be functional. Please check this!"
59 | elif [ ! -f /lib/ld-2.29.so ]; then
60 | error_msg "Make sure you're running latest firmware version!"
61 | elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then
62 | error_msg "Klipper Gcode Shell Command is needed, please install it first!"
63 | elif [ -d "$IMP_SHAPERS_FOLDER" ]; then
64 | error_msg "Please remove Improved Shapers Calibrations first, Guppy Screen already use it!"
65 | else
66 | run "install_guppy_screen" "customize_menu_ui_e5m"
67 | fi;;
68 | 4)
69 | if [ ! -d "$GUPPY_SCREEN_FOLDER" ]; then
70 | error_msg "Guppy Screen is not installed!"
71 | else
72 | run "remove_guppy_screen" "customize_menu_ui_e5m"
73 | fi;;
74 | 5)
75 | if [ -f "$FLUIDD_LOGO_FILE" ]; then
76 | error_msg "Creality Dynamic Logos for Fluidd are already installed!"
77 | elif [ ! -d "$FLUIDD_FOLDER" ]; then
78 | error_msg "Fluidd is needed, please install it first!"
79 | else
80 | run "install_creality_dynamic_logos" "customize_menu_ui_e5m"
81 | fi;;
82 | B|b)
83 | clear; main_menu; break;;
84 | Q|q)
85 | clear; exit 0;;
86 | *)
87 | error_msg "Please select a correct choice!";;
88 | esac
89 | done
90 | customize_menu_e5m
91 | }
92 |
--------------------------------------------------------------------------------
/scripts/menu/E5M/info_menu_E5M.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function check_folder_e5m() {
6 | local folder_path="$1"
7 | if [ -d "$folder_path" ]; then
8 | echo -e "${green}✓"
9 | else
10 | echo -e "${red}✗"
11 | fi
12 | }
13 |
14 | function check_file_e5m() {
15 | local file_path="$1"
16 | if [ -f "$file_path" ]; then
17 | echo -e "${green}✓"
18 | else
19 | echo -e "${red}✗"
20 | fi
21 | }
22 |
23 | function check_simplyprint_e5m() {
24 | if [ ! -f "$MOONRAKER_CFG" ]; then
25 | echo -e "${red}✗"
26 | elif grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
27 | echo -e "${green}✓"
28 | else
29 | echo -e "${red}✗"
30 | fi
31 | }
32 |
33 | function info_menu_ui_e5m() {
34 | top_line
35 | title '[ INFORMATION MENU ]' "${yellow}"
36 | inner_line
37 | hr
38 | subtitle '•ESSENTIALS:'
39 | info_line "$(check_folder_e5m "$MOONRAKER_FOLDER")" 'Moonraker & Nginx'
40 | info_line "$(check_folder_e5m "$FLUIDD_FOLDER")" 'Fluidd'
41 | info_line "$(check_folder_e5m "$MAINSAIL_FOLDER")" 'Mainsail'
42 | hr
43 | subtitle '•UTILITIES:'
44 | info_line "$(check_file_e5m "$ENTWARE_FILE")" 'Entware'
45 | info_line "$(check_file_e5m "$KLIPPER_SHELL_FILE")" 'Klipper Gcode Shell Command'
46 | hr
47 | subtitle '•IMPROVEMENTS:'
48 | info_line "$(check_folder_e5m "$KAMP_FOLDER")" 'Klipper Adaptive Meshing & Purging'
49 | info_line "$(check_file_e5m "$BUZZER_FILE")" 'Buzzer Support'
50 | info_line "$(check_folder_e5m "$NOZZLE_CLEANING_FOLDER")" 'Nozzle Cleaning Fan Control'
51 | info_line "$(check_file_e5m "$FAN_CONTROLS_FILE")" 'Fans Control Macros'
52 | info_line "$(check_folder_e5m "$IMP_SHAPERS_FOLDER")" 'Improved Shapers Calibrations'
53 | info_line "$(check_file_e5m "$USEFUL_MACROS_FILE")" 'Useful Macros'
54 | info_line "$(check_file_e5m "$SAVE_ZOFFSET_FILE")" 'Save Z-Offset Macros'
55 | info_line "$(check_file_e5m "$SCREWS_ADJUST_FILE")" 'Screws Tilt Adjust Support'
56 | info_line "$(check_file_e5m "$M600_SUPPORT_FILE")" 'M600 Support'
57 | info_line "$(check_file_e5m "$GIT_BACKUP_FILE")" 'Git Backup'
58 | hr
59 | subtitle '•CAMERA:'
60 | info_line "$(check_file_e5m "$TIMELAPSE_FILE")" 'Moonraker Timelapse'
61 | info_line "$(check_file_e5m "$CAMERA_SETTINGS_FILE")" 'Camera Settings Control'
62 | info_line "$(check_file_e5m "$USB_CAMERA_FILE")" 'USB Camera Support'
63 | hr
64 | subtitle '•REMOTE ACCESS:'
65 | info_line "$(check_folder_e5m "$OCTOEVERYWHERE_FOLDER")" 'OctoEverywhere'
66 | info_line "$(check_folder_e5m "$MOONRAKER_OBICO_FOLDER")" 'Obico'
67 | info_line "$(check_folder_e5m "$GUPPYFLO_FOLDER")" 'GuppyFLO'
68 | info_line "$(check_folder_e5m "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion'
69 | info_line "$(check_folder_e5m "$OCTOAPP_COMPANION_FOLDER")" 'OctoApp Companion'
70 | info_line "$(check_simplyprint_e5m)" 'SimplyPrint'
71 | hr
72 | subtitle '•CUSTOMIZATION:'
73 | info_line "$(check_file_e5m "$BOOT_DISPLAY_FILE")" 'Custom Boot Display'
74 | info_line "$(check_file_e5m "$CREALITY_WEB_FILE")" 'Creality Web Interface'
75 | info_line "$(check_folder_e5m "$GUPPY_SCREEN_FOLDER")" 'Guppy Screen'
76 | info_line "$(check_file_e5m "$FLUIDD_LOGO_FILE")" 'Creality Dynamic Logos for Fluidd'
77 | hr
78 | inner_line
79 | hr
80 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
81 | bottom_menu_option 'q' 'Exit' "${darkred}"
82 | hr
83 | version_line "$(get_script_version)"
84 | bottom_line
85 | }
86 |
87 | function info_menu_e5m() {
88 | clear
89 | info_menu_ui_e5m
90 | local info_menu_opt
91 | while true; do
92 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" info_menu_opt
93 | case "${info_menu_opt}" in
94 | B|b)
95 | clear; main_menu; break;;
96 | Q|q)
97 | clear; exit 0;;
98 | *)
99 | error_msg "Please select a correct choice!";;
100 | esac
101 | done
102 | info_menu_e5m
103 | }
104 |
--------------------------------------------------------------------------------
/scripts/menu/E5M/tools_menu_E5M.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function tools_menu_ui_e5m() {
6 | top_line
7 | title '[ TOOLS MENU ]' "${yellow}"
8 | inner_line
9 | hr
10 | menu_option ' 1' 'Prevent updating' 'Klipper configuration files'
11 | menu_option ' 2' 'Allow updating' 'Klipper configuration files'
12 | menu_option ' 3' 'Fix' 'printing Gcode files from folder'
13 | hr
14 | menu_option ' 4' 'Enable' 'camera settings in Moonraker'
15 | menu_option ' 5' 'Disable' 'camera settings in Moonraker'
16 | hr
17 | menu_option ' 6' 'Restart' 'Nginx service'
18 | menu_option ' 7' 'Restart' 'Moonraker service'
19 | menu_option ' 8' 'Restart' 'Klipper service'
20 | hr
21 | menu_option ' 9' 'Update' 'Entware packages'
22 | hr
23 | menu_option '10' 'Clear' 'cache'
24 | menu_option '11' 'Clear' 'logs files'
25 | hr
26 | menu_option '12' 'Restore' 'a previous firmware'
27 | hr
28 | menu_option '13' 'Reset' 'factory settings'
29 | hr
30 | inner_line
31 | hr
32 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
33 | bottom_menu_option 'q' 'Exit' "${darkred}"
34 | hr
35 | version_line "$(get_script_version)"
36 | bottom_line
37 | }
38 |
39 | function tools_menu_e5m() {
40 | clear
41 | tools_menu_ui_e5m
42 | local tools_menu_opt
43 | while true; do
44 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" tools_menu_opt
45 | case "${tools_menu_opt}" in
46 | 1)
47 | if [ -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then
48 | error_msg "Updating Klipper configuration files is already prevented!"
49 | else
50 | run "prevent_updating_klipper_files" "tools_menu_ui_e5m"
51 | fi;;
52 | 2)
53 | if [ ! -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then
54 | error_msg "Updating Klipper configuration files is already allowed!"
55 | else
56 | run "allow_updating_klipper_files" "tools_menu_ui_e5m"
57 | fi;;
58 | 3)
59 | if [ -f "$KLIPPER_KLIPPY_FOLDER"/gcode.py ]; then
60 | run "printing_gcode_from_folder" "tools_menu_ui_e5m"
61 | fi;;
62 | 4)
63 | if grep -q "^\[webcam Camera\]$" "$MOONRAKER_CFG"; then
64 | error_msg "Camera settings are alredy enabled in Moonraker!"
65 | else
66 | run "enable_camera_settings" "tools_menu_ui_e5m"
67 | fi;;
68 | 5)
69 | if grep -q "^#\[webcam Camera\]" "$MOONRAKER_CFG"; then
70 | error_msg "Camera settings are alredy disabled in Moonraker!"
71 | else
72 | run "disable_camera_settings" "tools_menu_ui_e5m"
73 | fi;;
74 | 6)
75 | if [ ! -d "$NGINX_FOLDER" ]; then
76 | error_msg "Nginx is not installed!"
77 | else
78 | run "restart_nginx_action" "tools_menu_ui_e5m"
79 | fi;;
80 | 7)
81 | if [ ! -d "$MOONRAKER_FOLDER" ]; then
82 | error_msg "Moonraker is not installed!"
83 | else
84 | run "restart_moonraker_action" "tools_menu_ui_e5m"
85 | fi;;
86 | 8)
87 | if [ ! -f "$INITD_FOLDER"/S55klipper_service ]; then
88 | error_msg "Klipper service is not present!"
89 | else
90 | run "restart_klipper_action" "tools_menu_ui_e5m"
91 | fi;;
92 | 9)
93 | if [ ! -f "$ENTWARE_FILE" ]; then
94 | error_msg "Entware is not installed!"
95 | else
96 | run "update_entware_packages" "tools_menu_ui_e5m"
97 | fi;;
98 | 10)
99 | run "clear_cache" "tools_menu_ui_e5m";;
100 | 11)
101 | run "clear_logs" "tools_menu_ui_e5m";;
102 | 12)
103 | run "restore_previous_firmware" "tools_menu_ui_e5m";;
104 | 13)
105 | run "reset_factory_settings" "tools_menu_ui_e5m";;
106 | B|b)
107 | clear; main_menu; break;;
108 | Q|q)
109 | clear; exit 0;;
110 | *)
111 | error_msg "Please select a correct choice!";;
112 | esac
113 | done
114 | tools_menu_e5m
115 | }
116 |
--------------------------------------------------------------------------------
/scripts/menu/K1/customize_menu_K1.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function customize_menu_ui_k1() {
6 | top_line
7 | title '[ CUSTOMIZE MENU ]' "${yellow}"
8 | inner_line
9 | hr
10 | menu_option '1' 'Install' 'Custom Boot Display'
11 | menu_option '2' 'Remove' 'Custom Boot Display'
12 | hr
13 | menu_option '3' 'Remove' 'Creality Web Interface'
14 | menu_option '4' 'Restore' 'Creality Web Interface'
15 | hr
16 | menu_option '5' 'Install' 'Guppy Screen'
17 | menu_option '6' 'Remove' 'Guppy Screen'
18 | hr
19 | menu_option '7' 'Install' 'Creality Dynamic Logos for Fluidd'
20 | hr
21 | inner_line
22 | hr
23 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
24 | bottom_menu_option 'q' 'Exit' "${darkred}"
25 | hr
26 | version_line "$(get_script_version)"
27 | bottom_line
28 | }
29 |
30 | function customize_menu_k1() {
31 | clear
32 | customize_menu_ui_k1
33 | local customize_menu_opt
34 | while true; do
35 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" customize_menu_opt
36 | case "${customize_menu_opt}" in
37 | 1)
38 | if [ -f "$BOOT_DISPLAY_FILE" ]; then
39 | error_msg "Custom Boot Display is already installed!"
40 | elif [ ! -d "$BOOT_DISPLAY_FOLDER" ]; then
41 | error_msg "Please use latest firmware to install Custom Boot Display!"
42 | else
43 | run "install_custom_boot_display" "customize_menu_ui_k1"
44 | fi;;
45 | 2)
46 | if [ ! -f "$BOOT_DISPLAY_FILE" ]; then
47 | error_msg "Custom Boot Display is not installed!"
48 | elif [ ! -d "$BOOT_DISPLAY_FOLDER" ]; then
49 | error_msg "Please use latest firmware to restore Stock Boot Display!"
50 | else
51 | run "remove_custom_boot_display" "customize_menu_ui_k1"
52 | fi;;
53 | 3)
54 | if [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then
55 | error_msg "Fluidd or Mainsail is needed, please install one of them first!"
56 | elif [ ! -f "$CREALITY_WEB_FILE" ]; then
57 | error_msg "Creality Web Interface is already removed!"
58 | echo -e " ${darkred}Please restore Creality Web Interface first if you want to change the default Web Interface.${white}"
59 | echo
60 | else
61 | run "remove_creality_web_interface" "customize_menu_ui_k1"
62 | fi;;
63 | 4)
64 | if [ -f "$CREALITY_WEB_FILE" ]; then
65 | error_msg "Creality Web Interface is already present!"
66 | elif [ ! -f "$INITD_FOLDER"/S99start_app ]; then
67 | error_msg "Guppy Screen need to be removed first to restore Creality Web Interface!"
68 | else
69 | run "restore_creality_web_interface" "customize_menu_ui_k1"
70 | fi;;
71 | 5)
72 | if [ -d "$GUPPY_SCREEN_FOLDER" ]; then
73 | error_msg "Guppy Screen is already installed!"
74 | elif [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then
75 | error_msg "Moonraker and Nginx are needed, please install them first!"
76 | elif [ "$(curl -s localhost:7125/server/info | jq .result.klippy_connected)" != "true" ]; then
77 | error_msg "Moonraker and Klipper do not seem to be functional. Please check this!"
78 | elif [ ! -f /lib/ld-2.29.so ]; then
79 | error_msg "Make sure you're running latest firmware version!"
80 | elif [ ! -f "$KLIPPER_SHELL_FILE" ]; then
81 | error_msg "Klipper Gcode Shell Command is needed, please install it first!"
82 | elif [ -d "$IMP_SHAPERS_FOLDER" ]; then
83 | error_msg "Please remove Improved Shapers Calibrations first, Guppy Screen already use it!"
84 | else
85 | run "install_guppy_screen" "customize_menu_ui_k1"
86 | fi;;
87 | 6)
88 | if [ ! -d "$GUPPY_SCREEN_FOLDER" ]; then
89 | error_msg "Guppy Screen is not installed!"
90 | else
91 | run "remove_guppy_screen" "customize_menu_ui_k1"
92 | fi;;
93 | 7)
94 | if [ -f "$FLUIDD_LOGO_FILE" ]; then
95 | error_msg "Creality Dynamic Logos for Fluidd are already installed!"
96 | elif [ ! -d "$FLUIDD_FOLDER" ]; then
97 | error_msg "Fluidd is needed, please install it first!"
98 | else
99 | run "install_creality_dynamic_logos" "customize_menu_ui_k1"
100 | fi;;
101 | B|b)
102 | clear; main_menu; break;;
103 | Q|q)
104 | clear; exit 0;;
105 | *)
106 | error_msg "Please select a correct choice!";;
107 | esac
108 | done
109 | customize_menu_k1
110 | }
111 |
--------------------------------------------------------------------------------
/scripts/menu/K1/info_menu_K1.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function check_folder_k1() {
6 | local folder_path="$1"
7 | if [ -d "$folder_path" ]; then
8 | echo -e "${green}✓"
9 | else
10 | echo -e "${red}✗"
11 | fi
12 | }
13 |
14 | function check_file_k1() {
15 | local file_path="$1"
16 | if [ -f "$file_path" ]; then
17 | echo -e "${green}✓"
18 | else
19 | echo -e "${red}✗"
20 | fi
21 | }
22 |
23 | function check_simplyprint_k1() {
24 | if [ ! -f "$MOONRAKER_CFG" ]; then
25 | echo -e "${red}✗"
26 | elif grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
27 | echo -e "${green}✓"
28 | else
29 | echo -e "${red}✗"
30 | fi
31 | }
32 |
33 | function info_menu_ui_k1() {
34 | top_line
35 | title '[ INFORMATION MENU ]' "${yellow}"
36 | inner_line
37 | hr
38 | subtitle '•ESSENTIALS:'
39 | info_line "$(check_folder_k1 "$MOONRAKER_FOLDER")" 'Moonraker & Nginx'
40 | info_line "$(check_folder_k1 "$FLUIDD_FOLDER")" 'Fluidd'
41 | info_line "$(check_folder_k1 "$MAINSAIL_FOLDER")" 'Mainsail'
42 | hr
43 | subtitle '•UTILITIES:'
44 | info_line "$(check_file_k1 "$ENTWARE_FILE")" 'Entware'
45 | info_line "$(check_file_k1 "$KLIPPER_SHELL_FILE")" 'Klipper Gcode Shell Command'
46 | hr
47 | subtitle '•IMPROVEMENTS:'
48 | info_line "$(check_folder_k1 "$KAMP_FOLDER")" 'Klipper Adaptive Meshing & Purging'
49 | info_line "$(check_file_k1 "$BUZZER_FILE")" 'Buzzer Support'
50 | info_line "$(check_folder_k1 "$NOZZLE_CLEANING_FOLDER")" 'Nozzle Cleaning Fan Control'
51 | info_line "$(check_file_k1 "$FAN_CONTROLS_FILE")" 'Fans Control Macros'
52 | info_line "$(check_folder_k1 "$IMP_SHAPERS_FOLDER")" 'Improved Shapers Calibrations'
53 | info_line "$(check_file_k1 "$USEFUL_MACROS_FILE")" 'Useful Macros'
54 | info_line "$(check_file_k1 "$SAVE_ZOFFSET_FILE")" 'Save Z-Offset Macros'
55 | info_line "$(check_file_k1 "$SCREWS_ADJUST_FILE")" 'Screws Tilt Adjust Support'
56 | info_line "$(check_file_k1 "$M600_SUPPORT_FILE")" 'M600 Support'
57 | info_line "$(check_file_k1 "$GIT_BACKUP_FILE")" 'Git Backup'
58 | hr
59 | subtitle '•CAMERA:'
60 | info_line "$(check_file_k1 "$TIMELAPSE_FILE")" 'Moonraker Timelapse'
61 | info_line "$(check_file_k1 "$CAMERA_SETTINGS_FILE")" 'Camera Settings Control'
62 | info_line "$(check_file_k1 "$USB_CAMERA_FILE")" 'USB Camera Support'
63 | hr
64 | subtitle '•REMOTE ACCESS:'
65 | info_line "$(check_folder_k1 "$OCTOEVERYWHERE_FOLDER")" 'OctoEverywhere'
66 | info_line "$(check_folder_k1 "$MOONRAKER_OBICO_FOLDER")" 'Obico'
67 | info_line "$(check_folder_k1 "$GUPPYFLO_FOLDER")" 'GuppyFLO'
68 | info_line "$(check_folder_k1 "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion'
69 | info_line "$(check_folder_k1 "$OCTOAPP_COMPANION_FOLDER")" 'OctoApp Companion'
70 | info_line "$(check_simplyprint_k1)" 'SimplyPrint'
71 | hr
72 | subtitle '•CUSTOMIZATION:'
73 | info_line "$(check_file_k1 "$BOOT_DISPLAY_FILE")" 'Custom Boot Display'
74 | info_line "$(check_file_k1 "$CREALITY_WEB_FILE")" 'Creality Web Interface'
75 | info_line "$(check_folder_k1 "$GUPPY_SCREEN_FOLDER")" 'Guppy Screen'
76 | info_line "$(check_file_k1 "$FLUIDD_LOGO_FILE")" 'Creality Dynamic Logos for Fluidd'
77 | hr
78 | inner_line
79 | hr
80 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
81 | bottom_menu_option 'q' 'Exit' "${darkred}"
82 | hr
83 | version_line "$(get_script_version)"
84 | bottom_line
85 | }
86 |
87 | function info_menu_k1() {
88 | clear
89 | info_menu_ui_k1
90 | local info_menu_opt
91 | while true; do
92 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" info_menu_opt
93 | case "${info_menu_opt}" in
94 | B|b)
95 | clear; main_menu; break;;
96 | Q|q)
97 | clear; exit 0;;
98 | *)
99 | error_msg "Please select a correct choice!";;
100 | esac
101 | done
102 | info_menu_k1
103 | }
104 |
--------------------------------------------------------------------------------
/scripts/menu/K1/tools_menu_K1.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function tools_menu_ui_k1() {
6 | top_line
7 | title '[ TOOLS MENU ]' "${yellow}"
8 | inner_line
9 | hr
10 | menu_option ' 1' 'Prevent updating' 'Klipper configuration files'
11 | menu_option ' 2' 'Allow updating' 'Klipper configuration files'
12 | menu_option ' 3' 'Fix' 'printing Gcode files from folder'
13 | hr
14 | menu_option ' 4' 'Enable' 'camera settings in Moonraker'
15 | menu_option ' 5' 'Disable' 'camera settings in Moonraker'
16 | hr
17 | menu_option ' 6' 'Restart' 'Nginx service'
18 | menu_option ' 7' 'Restart' 'Moonraker service'
19 | menu_option ' 8' 'Restart' 'Klipper service'
20 | hr
21 | menu_option ' 9' 'Update' 'Entware packages'
22 | hr
23 | menu_option '10' 'Clear' 'cache'
24 | menu_option '11' 'Clear' 'logs files'
25 | hr
26 | menu_option '12' 'Restore' 'a previous firmware'
27 | hr
28 | menu_option '13' 'Reset' 'factory settings'
29 | hr
30 | inner_line
31 | hr
32 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
33 | bottom_menu_option 'q' 'Exit' "${darkred}"
34 | hr
35 | version_line "$(get_script_version)"
36 | bottom_line
37 | }
38 |
39 | function tools_menu_k1() {
40 | clear
41 | tools_menu_ui_k1
42 | local tools_menu_opt
43 | while true; do
44 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" tools_menu_opt
45 | case "${tools_menu_opt}" in
46 | 1)
47 | if [ -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then
48 | error_msg "Updating Klipper configuration files is already prevented!"
49 | else
50 | run "prevent_updating_klipper_files" "tools_menu_ui_k1"
51 | fi;;
52 | 2)
53 | if [ ! -f "$INITD_FOLDER"/disabled.S55klipper_service ]; then
54 | error_msg "Updating Klipper configuration files is already allowed!"
55 | else
56 | run "allow_updating_klipper_files" "tools_menu_ui_k1"
57 | fi;;
58 | 3)
59 | if [ -f "$KLIPPER_KLIPPY_FOLDER"/gcode.py ]; then
60 | run "printing_gcode_from_folder" "tools_menu_ui_k1"
61 | fi;;
62 | 4)
63 | if grep -q "^\[webcam Camera\]$" "$MOONRAKER_CFG"; then
64 | error_msg "Camera settings are alredy enabled in Moonraker!"
65 | else
66 | run "enable_camera_settings" "tools_menu_ui_k1"
67 | fi;;
68 | 5)
69 | if grep -q "^#\[webcam Camera\]" "$MOONRAKER_CFG"; then
70 | error_msg "Camera settings are alredy disabled in Moonraker!"
71 | else
72 | run "disable_camera_settings" "tools_menu_ui_k1"
73 | fi;;
74 | 6)
75 | if [ ! -d "$NGINX_FOLDER" ]; then
76 | error_msg "Nginx is not installed!"
77 | else
78 | run "restart_nginx_action" "tools_menu_ui_k1"
79 | fi;;
80 | 7)
81 | if [ ! -d "$MOONRAKER_FOLDER" ]; then
82 | error_msg "Moonraker is not installed!"
83 | else
84 | run "restart_moonraker_action" "tools_menu_ui_k1"
85 | fi;;
86 | 8)
87 | if [ ! -f "$INITD_FOLDER"/S55klipper_service ]; then
88 | error_msg "Klipper service is not present!"
89 | else
90 | run "restart_klipper_action" "tools_menu_ui_k1"
91 | fi;;
92 | 9)
93 | if [ ! -f "$ENTWARE_FILE" ]; then
94 | error_msg "Entware is not installed!"
95 | else
96 | run "update_entware_packages" "tools_menu_ui_k1"
97 | fi;;
98 | 10)
99 | run "clear_cache" "tools_menu_ui_k1";;
100 | 11)
101 | run "clear_logs" "tools_menu_ui_k1";;
102 | 12)
103 | run "restore_previous_firmware" "tools_menu_ui_k1";;
104 | 13)
105 | run "reset_factory_settings" "tools_menu_ui_k1";;
106 | B|b)
107 | clear; main_menu; break;;
108 | Q|q)
109 | clear; exit 0;;
110 | *)
111 | error_msg "Please select a correct choice!";;
112 | esac
113 | done
114 | tools_menu_k1
115 | }
116 |
--------------------------------------------------------------------------------
/scripts/menu/backup_restore_menu.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function backup_restore_menu_ui() {
6 | top_line
7 | title '[ BACKUP & RESTORE MENU ]' "${yellow}"
8 | inner_line
9 | hr
10 | menu_option '1' 'Backup' 'Klipper configuration files'
11 | menu_option '2' 'Restore' 'Klipper configuration files'
12 | hr
13 | menu_option '3' 'Backup' 'Moonraker database'
14 | menu_option '4' 'Restore' 'Moonraker database'
15 | hr
16 | inner_line
17 | hr
18 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
19 | bottom_menu_option 'q' 'Exit' "${darkred}"
20 | hr
21 | version_line "$(get_script_version)"
22 | bottom_line
23 | }
24 |
25 | function backup_restore_menu() {
26 | clear
27 | backup_restore_menu_ui
28 | local backup_restore_menu_opt
29 | while true; do
30 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" backup_restore_menu_opt
31 | case "${backup_restore_menu_opt}" in
32 | 1)
33 | run "backup_klipper_config_files" "backup_restore_menu_ui";;
34 | 2)
35 | if [ ! -f "$KLIPPER_CONFIG_FOLDER"/backup_config.tar.gz ]; then
36 | error_msg "Please backup Klipper configuration files before restore!"
37 | else
38 | run "restore_klipper_config_files" "backup_restore_menu_ui"
39 | fi;;
40 | 3)
41 | run "backup_moonraker_database" "backup_restore_menu_ui";;
42 | 4)
43 | if [ ! -f "$KLIPPER_CONFIG_FOLDER"/backup_database.tar.gz ]; then
44 | error_msg "Please backup Moonraker database before restore!"
45 | else
46 | run "restore_moonraker_database" "backup_restore_menu_ui"
47 | fi;;
48 | B|b)
49 | clear; main_menu; break;;
50 | Q|q)
51 | clear; exit 0;;
52 | *)
53 | error_msg "Please select a correct choice!";;
54 | esac
55 | done
56 | backup_restore_menu
57 | }
58 |
--------------------------------------------------------------------------------
/scripts/menu/main_menu.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | if [ ! -f /etc/init.d/S58factoryreset ]; then
6 | cp /usr/data/helper-script/files/services/S58factoryreset /etc/init.d/S58factoryreset
7 | chmod 755 /etc/init.d/S58factoryreset
8 | fi
9 |
10 | get_model=$( /usr/bin/get_sn_mac.sh model 2>&1 )
11 | if echo "$get_model" | grep -iq "K1"; then
12 | model="K1"
13 | elif echo "$get_model" | grep -iq "F001"; then
14 | model="3V3"
15 | elif echo "$get_model" | grep -iq "F002"; then
16 | model="3V3"
17 | elif echo "$get_model" | grep -iq "F005"; then
18 | model="3KE"
19 | elif echo "$get_model" | grep -iq "F003"; then
20 | model="10SE"
21 | elif echo "$get_model" | grep -iq "F004"; then
22 | model="E5M"
23 | fi
24 |
25 | function get_script_version() {
26 | local version
27 | cd "${HELPER_SCRIPT_FOLDER}"
28 | version="$(git describe HEAD --always --tags | sed 's/-.*//')"
29 | echo "${cyan}${version}${white}"
30 | }
31 |
32 | function version_line() {
33 | local content="$1"
34 | local content_length="${#content}"
35 | local width=$((75))
36 | local padding_length=$((width - content_length - 3))
37 | printf " │ %*s%s%s\n" $padding_length '' "$content" " │"
38 | }
39 |
40 | function script_title() {
41 | local title
42 | if [ "$model" = "K1" ]; then
43 | title="K1 SERIES"
44 | elif [ "$model" = "3V3" ]; then
45 | title="ENDER-3 V3 SERIES"
46 | elif [ "$model" = "3KE" ]; then
47 | title="ENDER-3 V3 KE"
48 | elif [ "$model" = "10SE" ]; then
49 | title="CR-10 SE"
50 | elif [ "$model" = "E5M" ]; then
51 | title="Ender-5 MAX"
52 | else
53 | title="PRINTERS"
54 | fi
55 | echo "${title}"
56 | }
57 |
58 | function main_menu_ui() {
59 | top_line
60 | title "• HELPER SCRIPT FOR CREALITY $(script_title) •" "${blue}"
61 | title "Copyright © Cyril Guislain (Guilouz)" "${white}"
62 | inner_line
63 | title "/!\\ ONLY USE THIS SCRIPT WITH LATEST FIRMWARE VERSION /!\\" "${darkred}"
64 | inner_line
65 | hr
66 | main_menu_option '1' '[Install]' 'Menu'
67 | main_menu_option '2' '[Remove]' 'Menu'
68 | main_menu_option '3' '[Customize]' 'Menu'
69 | main_menu_option '4' '[Backup & Restore]' 'Menu'
70 | main_menu_option '5' '[Tools]' 'Menu'
71 | main_menu_option '6' '[Information]' 'Menu'
72 | main_menu_option '7' '[System]' 'Menu'
73 | hr
74 | inner_line
75 | hr
76 | bottom_menu_option 'q' 'Exit' "${darkred}"
77 | hr
78 | version_line "$(get_script_version)"
79 | bottom_line
80 | }
81 |
82 | function main_menu() {
83 | clear
84 | main_menu_ui
85 | local main_menu_opt
86 | while true; do
87 | read -p "${white} Type your choice and validate with Enter: ${yellow}" main_menu_opt
88 | case "${main_menu_opt}" in
89 | 1) clear
90 | if [ "$model" = "K1" ]; then
91 | install_menu_k1
92 | elif [ "$model" = "3V3" ]; then
93 | install_menu_3v3
94 | elif [ "$model" = "3KE" ]; then
95 | install_menu_3ke
96 | elif [ "$model" = "E5M" ]; then
97 | install_menu_e5m
98 | else
99 | install_menu_10se
100 | fi
101 | break;;
102 | 2) clear
103 | if [ "$model" = "K1" ]; then
104 | remove_menu_k1
105 | elif [ "$model" = "3V3" ]; then
106 | remove_menu_3v3
107 | elif [ "$model" = "3KE" ]; then
108 | remove_menu_3ke
109 | elif [ "$model" = "E5M" ]; then
110 | remove_menu_e5m
111 | else
112 | remove_menu_10se
113 | fi
114 | break;;
115 | 3) clear
116 | if [ "$model" = "K1" ]; then
117 | customize_menu_k1
118 | elif [ "$model" = "3V3" ]; then
119 | customize_menu_3v3
120 | elif [ "$model" = "3KE" ]; then
121 | customize_menu_3ke
122 | elif [ "$model" = "E5M" ]; then
123 | customize_menu_e5m
124 | else
125 | customize_menu_10se
126 | fi
127 | break;;
128 | 4) clear
129 | backup_restore_menu
130 | break;;
131 | 5) clear
132 | if [ "$model" = "K1" ]; then
133 | tools_menu_k1
134 | elif [ "$model" = "3V3" ]; then
135 | tools_menu_3v3
136 | elif [ "$model" = "3KE" ]; then
137 | tools_menu_3ke
138 | elif [ "$model" = "E5M" ]; then
139 | tools_menu_e5m
140 | else
141 | tools_menu_10se
142 | fi
143 | main_ui;;
144 | 6) clear
145 | if [ "$model" = "K1" ]; then
146 | info_menu_k1
147 | elif [ "$model" = "3V3" ]; then
148 | info_menu_3v3
149 | elif [ "$model" = "3KE" ]; then
150 | info_menu_3ke
151 | elif [ "$model" = "E5M" ]; then
152 | info_menu_e5m
153 | else
154 | info_menu_10se
155 | fi
156 | break;;
157 | 7) clear
158 | system_menu
159 | break;;
160 | Q|q)
161 | clear; exit 0;;
162 | *)
163 | error_msg "Please select a correct choice!";;
164 | esac
165 | done
166 | main_menu
167 | }
168 |
--------------------------------------------------------------------------------
/scripts/menu/system_menu.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function check_fw_version() {
6 | file="/usr/data/creality/userdata/config/system_version.json"
7 | if [ -e "$file" ]; then
8 | cat "$file" | jq -r '.sys_version'
9 | else
10 | echo -e "N/A"
11 | fi
12 | }
13 |
14 | function check_connection() {
15 | eth0_ip=$(ip -4 addr show eth0 2>/dev/null | grep -o -E '(inet\s)([0-9]+\.){3}[0-9]+' | cut -d ' ' -f 2 | head -n 1)
16 | wlan0_ip=$(ip -4 addr show wlan0 | grep -o -E '(inet\s)([0-9]+\.){3}[0-9]+' | cut -d ' ' -f 2 | head -n 1)
17 | if [ -n "$eth0_ip" ]; then
18 | echo -e "$eth0_ip (ETHERNET)"
19 | elif [ -n "$wlan0_ip" ]; then
20 | echo -e "$wlan0_ip (WLAN)"
21 | else
22 | echo -e "xxx.xxx.xxx.xxx"
23 | fi
24 | }
25 |
26 | function format_uptime() {
27 | local uptime=$1
28 | local upDays=$((uptime / 60 / 60 / 24))
29 | local upHours=$((uptime / 60 / 60 % 24))
30 | local upMins=$((uptime / 60 % 60))
31 | local output=""
32 | if [ $upDays -gt 0 ]; then
33 | output="$output$upDays day"
34 | [ $upDays -gt 1 ] && output="${output}s"
35 | output="$output "
36 | fi
37 | if [ $upHours -gt 0 ]; then
38 | output="$output$upHours hour"
39 | [ $upHours -gt 1 ] && output="${output}s"
40 | output="$output "
41 | fi
42 | if [ $upMins -gt 0 ] || [ -z "$output" ]; then
43 | output="$output$upMins minute"
44 | [ $upMins -gt 1 ] && output="${output}s"
45 | fi
46 | echo "$output"
47 | }
48 |
49 | function system_menu_ui() {
50 | memfree=`cat /proc/meminfo | grep MemFree | awk {'print $2'}`
51 | memtotal=`cat /proc/meminfo | grep MemTotal | awk {'print $2'}`
52 | pourcent=$((($memfree * 100)/$memtotal))
53 | diskused=`df -h | grep /dev/mmcblk0p10 | awk {'print $3 " / " $2 " (" $4 " available)" '}`
54 | process=`ps ax | wc -l | tr -d " "`
55 | uptime=`cat /proc/uptime | cut -f1 -d.`
56 | formatted_uptime=$(format_uptime $uptime)
57 | load=`awk -v cpus=2 '{printf "%.2f%% (1 min) | %.2f%% (5 min) | %.2f%% (15 min)\n", $1*100/cpus, $2*100/cpus, $3*100/cpus}' /proc/loadavg`
58 | device_sn=$(cat /usr/data/creality/userdata/config/system_config.json | grep -o '"device_sn":"[^"]*' | awk -F '"' '{print $4}')
59 | mac_address=$(cat /usr/data/creality/userdata/config/system_config.json | grep -o '"device_mac":"[^"]*' | awk -F '"' '{print $4}' | sed 's/../&:/g; s/:$//')
60 | top_line
61 | title '[ SYSTEM MENU ]' "${yellow}"
62 | inner_line
63 | hr
64 | system_line " System" "$(uname -s) (Kernel $(uname -r))" "${green}"
65 | system_line " Firmware" "$(check_fw_version)"
66 | system_line " Hostname" "$(uname -n)"
67 | system_line " Device SN" "$device_sn"
68 | system_line " IP Address" "$(check_connection)"
69 | system_line "MAC Address" "$mac_address"
70 | system_line " CPU Usage" "$load"
71 | system_line " RAM Usage" "$(($memfree/1024)) MB / $(($memtotal/1024)) MB ($pourcent% available)"
72 | system_line " Disk Usage" "$diskused"
73 | system_line " Uptime" "$formatted_uptime"
74 | hr
75 | inner_line
76 | hr
77 | bottom_menu_option 'b' 'Back to [Main Menu]' "${yellow}"
78 | bottom_menu_option 'q' 'Exit' "${darkred}"
79 | hr
80 | version_line "$(get_script_version)"
81 | bottom_line
82 | }
83 |
84 | function system_menu() {
85 | clear
86 | system_menu_ui
87 | local system_menu_opt
88 | while true; do
89 | read -p " ${white}Type your choice and validate with Enter: ${yellow}" system_menu_opt
90 | case "${system_menu_opt}" in
91 | B|b)
92 | clear; main_menu; break;;
93 | Q|q)
94 | clear; exit 0;;
95 | *)
96 | error_msg "Please select a correct choice!";;
97 | esac
98 | done
99 | system_menu
100 | }
101 |
--------------------------------------------------------------------------------
/scripts/mobileraker_companion.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function mobileraker_companion_message(){
6 | top_line
7 | title 'Mobileraker Companion' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}Mobileraker Companion allows to push notification for ${white}│"
11 | echo -e " │ ${cyan}Klipper using Moonraker for Mobileraker phone App. ${white}│"
12 | hr
13 | bottom_line
14 | }
15 |
16 | function install_mobileraker_companion(){
17 | mobileraker_companion_message
18 | local yn
19 | while true; do
20 | install_msg "Mobileraker Companion" yn
21 | case "${yn}" in
22 | Y|y)
23 | echo -e "${white}"
24 | echo -e "Info: Downloading Mobileraker Companion..."
25 | git config --global http.sslVerify false
26 | git clone "$MOBILERAKER_COMPANION_URL" "$MOBILERAKER_COMPANION_FOLDER"
27 | echo -e "Info: Running Mobileraker Companion installer..."
28 | sh "$MOBILERAKER_COMPANION_FOLDER"/scripts/install.sh
29 | echo
30 | if grep -q "#\[update_manager mobileraker\]" "$MOONRAKER_CFG" ; then
31 | echo -e "Info: Enabling Mobileraker Companion configurations for Update Manager..."
32 | sed -i -e 's/^\s*#[[:space:]]*\[update_manager mobileraker\]/[update_manager mobileraker]/' -e '/^\[update_manager mobileraker\]/,/^\s*$/ s/^\(\s*\)#/\1/' "$MOONRAKER_CFG"
33 | else
34 | echo -e "Info: Mobileraker Companion configurations are already enabled for Update Manager..."
35 | fi
36 | echo -e "Info: Restarting Moonraker service..."
37 | stop_moonraker
38 | start_moonraker
39 | echo -e "Info: Restarting Klipper service..."
40 | restart_klipper
41 | ok_msg "Mobileraker Companion has been installed successfully!"
42 | return;;
43 | N|n)
44 | error_msg "Installation canceled!"
45 | return;;
46 | *)
47 | error_msg "Please select a correct choice!";;
48 | esac
49 | done
50 | }
51 |
52 | function remove_mobileraker_companion(){
53 | mobileraker_companion_message
54 | local yn
55 | while true; do
56 | remove_msg "Mobileraker Companion" yn
57 | case "${yn}" in
58 | Y|y)
59 | echo -e "${white}"
60 | echo -e "Info: Running Mobileraker Companion uninstaller..."
61 | sh "$MOBILERAKER_COMPANION_FOLDER"/scripts/install.sh -uninstall
62 | echo
63 | if grep -q "\[update_manager mobileraker\]" "$MOONRAKER_CFG" ; then
64 | echo -e "Info: Disabling Mobileraker Companion configurations for Update Manager..."
65 | sed -i '/^\[update_manager mobileraker\]/,/^\s*$/ s/^\(\s*\)\([^#]\)/#\1\2/' "$MOONRAKER_CFG"
66 | else
67 | echo -e "Info: Mobileraker Companion configurations are already disabled for Update Manager..."
68 | fi
69 | echo -e "Info: Restarting Moonraker service..."
70 | stop_moonraker
71 | start_moonraker
72 | echo -e "Info: Restarting Klipper service..."
73 | restart_klipper
74 | ok_msg "Mobileraker Companion has been removed successfully!"
75 | return;;
76 | N|n)
77 | error_msg "Deletion canceled!"
78 | return;;
79 | *)
80 | error_msg "Please select a correct choice!";;
81 | esac
82 | done
83 | }
--------------------------------------------------------------------------------
/scripts/moonraker_obico.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function moonraker_obico_message(){
6 | top_line
7 | title 'Moonraker Obico' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}Obico is a Moonraker plugin that allows you to monitor and ${white}│"
11 | echo -e " │ ${cyan}control your 3D printer from anywhere. ${white}│"
12 | hr
13 | bottom_line
14 | }
15 |
16 | function install_moonraker_obico(){
17 | moonraker_obico_message
18 | local yn
19 | while true; do
20 | install_msg "Moonraker Obico" yn
21 | case "${yn}" in
22 | Y|y)
23 | echo -e "${white}"
24 | if [ -d "$MOONRAKER_OBICO_FOLDER" ]; then
25 | echo -e "Info: Moonraker Obico is already installed. Download skipped."
26 | else
27 | echo -e "Info: Downloading Moonraker Obico..."
28 | git config --global http.sslVerify false
29 | git clone "$MOONRAKER_OBICO_URL" "$MOONRAKER_OBICO_FOLDER"
30 | fi
31 | echo -e "Info: Running Moonraker Obico installer..."
32 | pip3 uninstall virtualenv -y > /dev/null 2>&1
33 | cd "$MOONRAKER_OBICO_FOLDER"
34 | sh ./scripts/install_creality.sh -k
35 | ok_msg "Moonraker Obico has been installed successfully!"
36 | return;;
37 | N|n)
38 | error_msg "Installation canceled!"
39 | return;;
40 | *)
41 | error_msg "Please select a correct choice!";;
42 | esac
43 | done
44 | }
45 |
46 | function remove_moonraker_obico(){
47 | moonraker_obico_message
48 | local yn
49 | while true; do
50 | remove_msg "Moonraker Obico" yn
51 | case "${yn}" in
52 | Y|y)
53 | echo -e "${white}"
54 | if grep -q "include moonraker_obico_macros" "$PRINTER_CFG" ; then
55 | echo -e "Info: Removing Moonraker Obico configurations in printer.cfg file..."
56 | sed -i '/include moonraker_obico_macros\.cfg/d' "$PRINTER_CFG"
57 | else
58 | echo -e "Info: Moonraker Obico configurations are already removed in printer.cfg file..."
59 | fi
60 | if grep -q "\[include moonraker-obico-update.cfg\]" "$MOONRAKER_CFG" ; then
61 | echo -e "Info: Removing Moonraker Obico configurations in moonraker.conf file..."
62 | sed -i '/include moonraker-obico-update\.cfg/d' "$MOONRAKER_CFG"
63 | else
64 | echo -e "Info: Moonraker Obico configurations are already removed in moonraker.conf file..."
65 | fi
66 | echo -e "Info: Removing files..."
67 | rm -rf "$MOONRAKER_OBICO_FOLDER"
68 | rm -rf /usr/data/moonraker-obico-env
69 | rm -f "$KLIPPER_CONFIG_FOLDER"/moonraker-obico-update.cfg
70 | rm -f "$KLIPPER_CONFIG_FOLDER"/config/moonraker-obico.cfg
71 | rm -f "$INITD_FOLDER"/S99moonraker_obico
72 | echo -e "Info: Restarting Moonraker service..."
73 | stop_moonraker
74 | start_moonraker
75 | echo -e "Info: Restarting Klipper service..."
76 | restart_klipper
77 | ok_msg "Moonraker Obico has been removed successfully!"
78 | return;;
79 | N|n)
80 | error_msg "Deletion canceled!"
81 | return;;
82 | *)
83 | error_msg "Please select a correct choice!";;
84 | esac
85 | done
86 | }
--------------------------------------------------------------------------------
/scripts/moonraker_timelapse.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function moonraker_timelapse_message(){
6 | top_line
7 | title 'Moonraker Timelapse' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}Moonraker Timelapse is a 3rd party Moonraker component to ${white}│"
11 | echo -e " │ ${cyan}create timelapse of 3D prints. ${white}│"
12 | hr
13 | bottom_line
14 | }
15 |
16 | function install_moonraker_timelapse(){
17 | moonraker_timelapse_message
18 | local yn
19 | while true; do
20 | install_msg "Moonraker Timelapse" yn
21 | case "${yn}" in
22 | Y|y)
23 | echo -e "${white}"
24 | if [ -f "$HS_CONFIG_FOLDER"/timelapse.cfg ]; then
25 | rm -f "$HS_CONFIG_FOLDER"/timelapse.cfg
26 | fi
27 | if [ ! -d "$HS_CONFIG_FOLDER" ]; then
28 | mkdir -p "$HS_CONFIG_FOLDER"
29 | fi
30 | echo -e "Info: Linking file..."
31 | ln -sf "$TIMELAPSE_URL1" "$TIMELAPSE_FILE"
32 | ln -sf "$TIMELAPSE_URL2" "$HS_CONFIG_FOLDER"/timelapse.cfg
33 | if grep -q "include Helper-Script/timelapse" "$PRINTER_CFG" ; then
34 | echo -e "Info: Moonraker Timelapse configurations are already enabled in printer.cfg file..."
35 | else
36 | echo -e "Info: Adding Moonraker Timelapse configurations in printer.cfg file..."
37 | sed -i '/\[include printer_params\.cfg\]/a \[include Helper-Script/timelapse\.cfg\]' "$PRINTER_CFG"
38 | fi
39 | if grep -q "#\[timelapse\]" "$MOONRAKER_CFG" ; then
40 | echo -e "Info: Enabling Moonraker Timelapse configurations in moonraker.conf file..."
41 | sed -i -e 's/^\s*#[[:space:]]*\[timelapse\]/[timelapse]/' -e '/^\[timelapse\]/,/^\s*$/ s/^\(\s*\)#/\1/' "$MOONRAKER_CFG"
42 | else
43 | echo -e "Info: Moonraker Timelapse configurations are already enabled in moonraker.conf file..."
44 | fi
45 | echo -e "Info: Updating ffmpeg..."
46 | "$ENTWARE_FILE" update && "$ENTWARE_FILE" upgrade ffmpeg
47 | echo -e "Info: Restarting Klipper service..."
48 | restart_klipper
49 | ok_msg "Moonraker Timelapse has been installed successfully!"
50 | return;;
51 | N|n)
52 | error_msg "Installation canceled!"
53 | return;;
54 | *)
55 | error_msg "Please select a correct choice!";;
56 | esac
57 | done
58 | }
59 |
60 | function remove_moonraker_timelapse(){
61 | moonraker_timelapse_message
62 | local yn
63 | while true; do
64 | remove_msg "Moonraker Timelapse" yn
65 | case "${yn}" in
66 | Y|y)
67 | echo -e "${white}"
68 | echo -e "Info: Removing files..."
69 | rm -f "$HS_CONFIG_FOLDER"/timelapse.cfg
70 | rm -f /usr/data/moonraker/moonraker/moonraker/components/timelapse.py
71 | rm -f /usr/data/moonraker/moonraker/moonraker/components/timelapse.pyc
72 | if [ -f /opt/bin/ffmpeg ]; then
73 | set +e
74 | "$ENTWARE_FILE" --autoremove remove ffmpeg
75 | set -e
76 | fi
77 | if grep -q "include Helper-Script/timelapse" "$PRINTER_CFG" ; then
78 | echo -e "Info: Removing Moonraker Timelapse configurations in printer.cfg file..."
79 | sed -i '/include Helper-Script\/timelapse\.cfg/d' "$PRINTER_CFG"
80 | else
81 | echo -e "Info: Moonraker Timelapse configurations are already removed in printer.cfg file..."
82 | fi
83 | if grep -q "\[timelapse\]" "$MOONRAKER_CFG" ; then
84 | echo -e "Info: Disabling Moonraker Timelapse configurations in moonraker.conf file..."
85 | sed -i '/^\[timelapse\]/,/^\s*$/ s/^\(\s*\)\([^#]\)/#\1\2/' "$MOONRAKER_CFG"
86 | else
87 | echo -e "Info: Moonraker Timelapse configurations are already disabled in moonraker.conf file..."
88 | fi
89 | if [ ! -n "$(ls -A "$HS_CONFIG_FOLDER")" ]; then
90 | rm -rf "$HS_CONFIG_FOLDER"
91 | fi
92 | echo -e "Info: Restarting Klipper service..."
93 | restart_klipper
94 | ok_msg "Moonraker Timelapse has been removed successfully!"
95 | return;;
96 | N|n)
97 | error_msg "Deletion canceled!"
98 | return;;
99 | *)
100 | error_msg "Please select a correct choice!";;
101 | esac
102 | done
103 | }
--------------------------------------------------------------------------------
/scripts/nozzle_cleaning_fan_control.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function nozzle_cleaning_fan_control_message(){
6 | top_line
7 | title 'Nozzle Cleaning Fan Control' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}This is an Klipper extension to control fans during nozzle ${white}│"
11 | echo -e " │ ${cyan}cleaning. ${white}│"
12 | hr
13 | bottom_line
14 | }
15 |
16 | function install_nozzle_cleaning_fan_control(){
17 | nozzle_cleaning_fan_control_message
18 | local yn
19 | while true; do
20 | install_msg "Nozzle Cleaning Fan Control" yn
21 | case "${yn}" in
22 | Y|y)
23 | echo -e "${white}"
24 | if [ -d "NOZZLE_CLEANING_FOLDER" ]; then
25 | rm -rf "NOZZLE_CLEANING_FOLDER"
26 | fi
27 | mkdir -p "$NOZZLE_CLEANING_FOLDER"
28 | echo -e "Info: Linking files..."
29 | ln -sf "$NOZZLE_CLEANING_URL1" "$NOZZLE_CLEANING_FOLDER"/__init__.py
30 | ln -sf "$NOZZLE_CLEANING_URL2" "$NOZZLE_CLEANING_FOLDER"/prtouch_v2_fan.pyc
31 | if [ ! -d "$HS_CONFIG_FOLDER" ]; then
32 | mkdir -p "$HS_CONFIG_FOLDER"
33 | fi
34 | ln -sf "$NOZZLE_CLEANING_URL3" "$HS_CONFIG_FOLDER"/nozzle-cleaning-fan-control.cfg
35 | if grep -q "include Helper-Script/nozzle-cleaning-fan-control" "$PRINTER_CFG" ; then
36 | echo -e "Info: Nozzle Cleaning Fan Control configurations are already enabled in printer.cfg file..."
37 | else
38 | echo -e "Info: Adding Nozzle Cleaning Fan Control configurations in printer.cfg file..."
39 | sed -i '/\[include printer_params\.cfg\]/a \[include Helper-Script/nozzle-cleaning-fan-control\.cfg\]' "$PRINTER_CFG"
40 | fi
41 | echo -e "Info: Restarting Klipper service..."
42 | restart_klipper
43 | ok_msg "Nozzle Cleaning Fan Control has been installed successfully!"
44 | return;;
45 | N|n)
46 | error_msg "Installation canceled!"
47 | return;;
48 | *)
49 | error_msg "Please select a correct choice!";;
50 | esac
51 | done
52 | }
53 |
54 | function remove_nozzle_cleaning_fan_control(){
55 | nozzle_cleaning_fan_control_message
56 | local yn
57 | while true; do
58 | remove_msg "Nozzle Cleaning Fan Control" yn
59 | case "${yn}" in
60 | Y|y)
61 | echo -e "${white}"
62 | echo -e "Info: Removing files..."
63 | rm -rf "$NOZZLE_CLEANING_FOLDER"
64 | rm -f "$HS_CONFIG_FOLDER"/nozzle-cleaning-fan-control.cfg
65 | if grep -q "include Helper-Script/nozzle-cleaning-fan-control" "$PRINTER_CFG" ; then
66 | echo -e "Info: Removing Nozzle Cleaning Fan Control configurations in printer.cfg file..."
67 | sed -i '/include Helper-Script\/nozzle-cleaning-fan-control\.cfg/d' "$PRINTER_CFG"
68 | else
69 | echo -e "Info: Nozzle Cleaning Fan Control configurations are already removed in printer.cfg file..."
70 | fi
71 | if [ ! -n "$(ls -A "$HS_CONFIG_FOLDER")" ]; then
72 | rm -rf "$HS_CONFIG_FOLDER"
73 | fi
74 | echo -e "Info: Restarting Klipper service..."
75 | restart_klipper
76 | ok_msg "Nozzle Cleaning Fan Control has been removed successfully!"
77 | return;;
78 | N|n)
79 | error_msg "Deletion canceled!"
80 | return;;
81 | *)
82 | error_msg "Please select a correct choice!";;
83 | esac
84 | done
85 | }
--------------------------------------------------------------------------------
/scripts/octoapp_companion.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function octoapp_companion_message(){
6 | top_line
7 | title 'OctoApp Companion' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}OctoApp Companion allows you to control your printer from ${white}│"
11 | echo -e " │ ${cyan}OctoApp and get notifications for your prints. ${white}│"
12 | hr
13 | bottom_line
14 | }
15 |
16 | function install_octoapp_companion(){
17 | octoapp_companion_message
18 | local yn
19 | while true; do
20 | install_msg "OctoApp Companion" yn
21 | case "${yn}" in
22 | Y|y)
23 | echo -e "${white}"
24 | if [ -d "$OCTOAPP_COMPANION_FOLDER" ]; then
25 | echo -e "Info: OctoApp Companion is already installed. Download skipped."
26 | else
27 | echo -e "Info: Downloading OctoApp Companion..."
28 | git config --global http.sslVerify false
29 | git clone "$OCTOAPP_COMPANION_URL" "$OCTOAPP_COMPANION_FOLDER"
30 | fi
31 | echo -e "Info: Running OctoApp Companion installer..."
32 | cd "$OCTOAPP_COMPANION_FOLDER"
33 | sh ./install.sh
34 | ok_msg "OctoApp Companion has been installed successfully!"
35 | return;;
36 | N|n)
37 | error_msg "Installation canceled!"
38 | return;;
39 | *)
40 | error_msg "Please select a correct choice!";;
41 | esac
42 | done
43 | }
44 |
45 | function remove_octoapp_companion(){
46 | octoapp_companion_message
47 | local yn
48 | while true; do
49 | remove_msg "OctoApp Companion" yn
50 | case "${yn}" in
51 | Y|y)
52 | echo -e "${white}"
53 | echo -e "Info: Running OctoApp Companion uninstaller..."
54 | cd "$OCTOAPP_COMPANION_FOLDER"
55 | sh ./uninstall.sh
56 | rm -f /root/update-OctoApp.sh
57 | ok_msg "OctoApp Companion has been removed successfully!"
58 | return;;
59 | N|n)
60 | error_msg "Deletion canceled!"
61 | return;;
62 | *)
63 | error_msg "Please select a correct choice!";;
64 | esac
65 | done
66 | }
--------------------------------------------------------------------------------
/scripts/octoeverywhere.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function octoeverywhere_message(){
6 | top_line
7 | title 'OctoEverywhere' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}Cloud empower your Klipper printers with free, private, and ${white}│"
11 | echo -e " │ ${cyan}unlimited remote access to your full web control portal from ${white}│"
12 | echo -e " │ ${cyan}anywhere! ${white}│"
13 | hr
14 | bottom_line
15 | }
16 |
17 | function install_octoeverywhere(){
18 | octoeverywhere_message
19 | local yn
20 | while true; do
21 | install_msg "OctoEverywhere" yn
22 | case "${yn}" in
23 | Y|y)
24 | echo -e "${white}"
25 | if [ -d "$OCTOEVERYWHERE_FOLDER" ]; then
26 | echo -e "Info: OctoEverywhere is already installed. Download skipped."
27 | else
28 | echo -e "Info: Downloading OctoEverywhere..."
29 | git config --global http.sslVerify false
30 | git clone "$OCTOEVERYWHERE_URL" "$OCTOEVERYWHERE_FOLDER"
31 | fi
32 | echo -e "Info: Running OctoEverywhere installer..."
33 | cd "$OCTOEVERYWHERE_FOLDER"
34 | sh ./install.sh
35 | ok_msg "OctoEverywhere has been installed successfully!"
36 | return;;
37 | N|n)
38 | error_msg "Installation canceled!"
39 | return;;
40 | *)
41 | error_msg "Please select a correct choice!";;
42 | esac
43 | done
44 | }
45 |
46 | function remove_octoeverywhere(){
47 | octoeverywhere_message
48 | local yn
49 | while true; do
50 | remove_msg "OctoEverywhere" yn
51 | case "${yn}" in
52 | Y|y)
53 | echo -e "${white}"
54 | echo -e "Info: Running OctoEverywhere uninstaller..."
55 | cd "$OCTOEVERYWHERE_FOLDER"
56 | sh ./uninstall.sh
57 | if [ -f /root/update-octoeverywhere.sh ]; then
58 | rm -f /root/update-octoeverywhere.sh
59 | fi
60 | ok_msg "OctoEverywhere has been removed successfully!"
61 | return;;
62 | N|n)
63 | error_msg "Deletion canceled!"
64 | return;;
65 | *)
66 | error_msg "Please select a correct choice!";;
67 | esac
68 | done
69 | }
--------------------------------------------------------------------------------
/scripts/save_zoffset_macros.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function save_zoffset_macros_message(){
6 | top_line
7 | title 'Save Z-Offset Macros' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}It allows to save and load the the Z-Offset automatically. ${white}│"
11 | hr
12 | bottom_line
13 | }
14 |
15 | function install_save_zoffset_macros(){
16 | save_zoffset_macros_message
17 | local yn
18 | while true; do
19 | install_msg "Save Z-Offset Macros" yn
20 | case "${yn}" in
21 | Y|y)
22 | echo -e "${white}"
23 | if [ -f "$HS_CONFIG_FOLDER"/save-zoffset.cfg ]; then
24 | rm -f "$HS_CONFIG_FOLDER"/save-zoffset.cfg
25 | fi
26 | if [ ! -d "$HS_CONFIG_FOLDER" ]; then
27 | mkdir -p "$HS_CONFIG_FOLDER"
28 | fi
29 | echo -e "Info: Linking file..."
30 | ln -sf "$SAVE_ZOFFSET_URL" "$HS_CONFIG_FOLDER"/save-zoffset.cfg
31 | if grep -q "include Helper-Script/save-zoffset" "$PRINTER_CFG" ; then
32 | echo -e "Info: Save Z-Offset Macros configurations are already enabled in printer.cfg file..."
33 | else
34 | echo -e "Info: Adding Save Z-Offset Macros configurations in printer.cfg file..."
35 | sed -i '/\[include printer_params\.cfg\]/a \[include Helper-Script/save-zoffset\.cfg\]' "$PRINTER_CFG"
36 | fi
37 | echo -e "Info: Restarting Klipper service..."
38 | restart_klipper
39 | ok_msg "Save Z-Offset Macros have been installed successfully!"
40 | return;;
41 | N|n)
42 | error_msg "Installation canceled!"
43 | return;;
44 | *)
45 | error_msg "Please select a correct choice!";;
46 | esac
47 | done
48 | }
49 |
50 | function remove_save_zoffset_macros(){
51 | save_zoffset_macros_message
52 | local yn
53 | while true; do
54 | remove_msg "Save Z-Offset Macros" yn
55 | case "${yn}" in
56 | Y|y)
57 | echo -e "${white}"
58 | echo -e "Info: Removing file..."
59 | rm -f "$HS_CONFIG_FOLDER"/save-zoffset.cfg
60 | rm -f "$HS_CONFIG_FOLDER"/variables.cfg
61 | if grep -q "include Helper-Script/save-zoffset" "$PRINTER_CFG" ; then
62 | echo -e "Info: Removing Save Z-Offset Macros configurations in printer.cfg file..."
63 | sed -i '/include Helper-Script\/save-zoffset\.cfg/d' "$PRINTER_CFG"
64 | else
65 | echo -e "Info: Save Z-Offset Macros configurations are already removed in printer.cfg file..."
66 | fi
67 | if [ ! -n "$(ls -A "$HS_CONFIG_FOLDER")" ]; then
68 | rm -rf "$HS_CONFIG_FOLDER"
69 | fi
70 | echo -e "Info: Restarting Klipper service..."
71 | restart_klipper
72 | ok_msg "Save Z-Offset Macros have been removed successfully!"
73 | return;;
74 | N|n)
75 | error_msg "Deletion canceled!"
76 | return;;
77 | *)
78 | error_msg "Please select a correct choice!";;
79 | esac
80 | done
81 | }
--------------------------------------------------------------------------------
/scripts/simplyprint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function simplyprint_message(){
6 | top_line
7 | title 'SimplyPrint' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}SimplyPrint allows you to start those prints that you just ${white}│"
11 | echo -e " │ ${cyan}need to be done sooner rather than later. You can send print ${white}│"
12 | echo -e " │ ${cyan}jobs to your printer from anywhere in the world. ${white}│"
13 | hr
14 | bottom_line
15 | }
16 |
17 | function install_simplyprint(){
18 | simplyprint_message
19 | local yn
20 | while true; do
21 | install_msg "SimplyPrint" yn
22 | case "${yn}" in
23 | Y|y)
24 | echo -e "${white}"
25 | if ! grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
26 | echo -e "Info: Enabling SimplyPrint configurations in moonraker.conf file..."
27 | sed -i -e '/\[simplyprint\]/!{ $s/$/\n\n[simplyprint]/;}' "$MOONRAKER_CFG"
28 | else
29 | echo -e "Info: SimplyPrint configurations are already enabled in moonraker.conf file..."
30 | fi
31 | echo -e "Info: Restarting Moonraker service..."
32 | stop_moonraker
33 | start_moonraker
34 | ok_msg "SimplyPrint has been installed successfully!"
35 | return;;
36 | N|n)
37 | error_msg "Installation canceled!"
38 | return;;
39 | *)
40 | error_msg "Please select a correct choice!";;
41 | esac
42 | done
43 | }
44 |
45 | function remove_simplyprint(){
46 | simplyprint_message
47 | local yn
48 | while true; do
49 | remove_msg "SimplyPrint" yn
50 | case "${yn}" in
51 | Y|y)
52 | echo -e "${white}"
53 | if grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
54 | echo "Info: Removing SimplyPrint configurations in moonraker.conf file..."
55 | sed -i -e '/\[simplyprint\]/{x;d;};x' "$MOONRAKER_CFG"
56 | else
57 | echo "Info: SimplyPrint configurations are already removed in moonraker.conf file."
58 | fi
59 | echo -e "Info: Restarting Moonraker service..."
60 | stop_moonraker
61 | start_moonraker
62 | ok_msg "SimplyPrint has been removed successfully!"
63 | return;;
64 | N|n)
65 | error_msg "Deletion canceled!"
66 | return;;
67 | *)
68 | error_msg "Please select a correct choice!";;
69 | esac
70 | done
71 | }
--------------------------------------------------------------------------------
/scripts/usb_camera.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function usb_camera_message(){
6 | top_line
7 | title 'USB Camera Support' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}This allows to use third-party camera from your printer's ${white}│"
11 | echo -e " │ ${cyan}USB port. ${white}│"
12 | hr
13 | bottom_line
14 | }
15 |
16 | function install_usb_camera(){
17 | usb_camera_message
18 | local yn
19 | while true; do
20 | install_msg "USB Camera Support" yn
21 | case "${yn}" in
22 | Y|y)
23 | echo -e "${white}"
24 | echo -e "Info: Copying file..."
25 | if [ "$model" = "K1" ]; then
26 | cp "$USB_CAMERA_DUAL_URL" "$INITD_FOLDER"/S50usb_camera
27 | else
28 | cp "$USB_CAMERA_SINGLE_URL" "$INITD_FOLDER"/S50usb_camera
29 | echo
30 | echo -e " ${darkred}Be careful with the 1080p resolution!"
31 | echo -e " It takes more resources and timelapses are larger and take longer to convert.${white}"
32 | echo -e " 720p is a good compromise between quality and performance."
33 | echo -e " Make sure your camera is compatible with the chosen resolution."
34 | echo
35 | local resolution
36 | while true; do
37 | read -p " What camera resolution do you want to apply? (${yellow}480p${white}/${yellow}720p${white}/${yellow}1080p${white}): ${yellow}" resolution
38 | case "${resolution}" in
39 | 480p|480P)
40 | echo -e "${white}"
41 | echo -e "Info: Applying change..."
42 | sed -i 's/1280x720/640x480/g' "$INITD_FOLDER"/S50usb_camera
43 | break;;
44 | 720p|720P)
45 | echo -e "${white}"
46 | echo -e "Info: Applying change..."
47 | break;;
48 | 1080p|1080p)
49 | echo -e "${white}"
50 | echo -e "Info: Applying change..."
51 | sed -i 's/1280x720/1920x1080/g' "$INITD_FOLDER"/S50usb_camera
52 | break;;
53 | *)
54 | error_msg "Please select a correct choice!";;
55 | esac
56 | done
57 | fi
58 | chmod 755 "$INITD_FOLDER"/S50usb_camera
59 | echo -e "Info: Installing necessary packages..."
60 | "$ENTWARE_FILE" update && "$ENTWARE_FILE" install mjpg-streamer mjpg-streamer-input-http mjpg-streamer-input-uvc mjpg-streamer-output-http mjpg-streamer-www
61 | echo -e "Info: Starting service..."
62 | "$INITD_FOLDER"/S50usb_camera start
63 | ok_msg "USB Camera Support has been installed successfully!"
64 | return;;
65 | N|n)
66 | error_msg "Installation canceled!"
67 | return;;
68 | *)
69 | error_msg "Please select a correct choice!";;
70 | esac
71 | done
72 | }
73 |
74 | function remove_usb_camera(){
75 | usb_camera_message
76 | local yn
77 | while true; do
78 | remove_msg "USB Camera Support" yn
79 | case "${yn}" in
80 | Y|y)
81 | echo -e "${white}"
82 | echo -e "Info: Stopping service..."
83 | "$INITD_FOLDER"/S50usb_camera stop
84 | echo -e "Info: Removing file..."
85 | rm -f "$INITD_FOLDER"/S50usb_camera
86 | echo -e "Info: Removing packages..."
87 | set +e
88 | "$ENTWARE_FILE" --autoremove remove mjpg-streamer-www
89 | "$ENTWARE_FILE" --autoremove remove mjpg-streamer-output-http
90 | "$ENTWARE_FILE" --autoremove remove mjpg-streamer-input-uvc
91 | "$ENTWARE_FILE" --autoremove remove mjpg-streamer-input-http
92 | "$ENTWARE_FILE" --autoremove remove mjpg-streamer
93 | set -e
94 | ok_msg "USB Camera Support has been removed successfully!"
95 | echo -e " Please reboot your printer by using power switch on back!"
96 | return;;
97 | N|n)
98 | error_msg "Deletion canceled!"
99 | return;;
100 | *)
101 | error_msg "Please select a correct choice!";;
102 | esac
103 | done
104 | }
105 |
--------------------------------------------------------------------------------
/scripts/useful_macros.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | function useful_macros_message(){
6 | top_line
7 | title 'Useful Macros' "${yellow}"
8 | inner_line
9 | hr
10 | echo -e " │ ${cyan}It allows to use some usefull macros like Bed Leveling, PID, ${white}│"
11 | echo -e " │ ${cyan}stress test or backup and restore Klipper configurations ${white}│"
12 | echo -e " │ ${cyan}files and Moonraker database. ${white}│"
13 | hr
14 | bottom_line
15 | }
16 |
17 | function install_useful_macros(){
18 | useful_macros_message
19 | local yn
20 | while true; do
21 | install_msg "Useful Macros" yn
22 | case "${yn}" in
23 | Y|y)
24 | echo -e "${white}"
25 | if [ -f "$HS_CONFIG_FOLDER"/useful-macros.cfg ]; then
26 | rm -f "$HS_CONFIG_FOLDER"/useful-macros.cfg
27 | fi
28 | if [ ! -d "$HS_CONFIG_FOLDER" ]; then
29 | mkdir -p "$HS_CONFIG_FOLDER"
30 | fi
31 | echo -e "Info: Linking file..."
32 | if [ "$model" = "K1" ]; then
33 | ln -sf "$USEFUL_MACROS_URL" "$HS_CONFIG_FOLDER"/useful-macros.cfg
34 | else
35 | ln -sf "$USEFUL_MACROS_3V3_URL" "$HS_CONFIG_FOLDER"/useful-macros.cfg
36 | fi
37 | if grep -q "include Helper-Script/useful-macros" "$PRINTER_CFG" ; then
38 | echo -e "Info: Useful Macros configurations are already enabled in printer.cfg file..."
39 | else
40 | echo -e "Info: Adding Useful Macros configurations in printer.cfg file..."
41 | sed -i '/\[include printer_params\.cfg\]/a \[include Helper-Script/useful-macros\.cfg\]' "$PRINTER_CFG"
42 | fi
43 | echo -e "Info: Restarting Klipper service..."
44 | restart_klipper
45 | ok_msg "Useful Macros have been installed successfully!"
46 | return;;
47 | N|n)
48 | error_msg "Installation canceled!"
49 | return;;
50 | *)
51 | error_msg "Please select a correct choice!";;
52 | esac
53 | done
54 | }
55 |
56 | function remove_useful_macros(){
57 | useful_macros_message
58 | local yn
59 | while true; do
60 | remove_msg "Useful Macros" yn
61 | case "${yn}" in
62 | Y|y)
63 | echo -e "${white}"
64 | echo -e "Info: Removing file..."
65 | rm -f "$HS_CONFIG_FOLDER"/useful-macros.cfg
66 | if grep -q "include Helper-Script/useful-macros" "$PRINTER_CFG" ; then
67 | echo -e "Info: Removing Useful Macros configurations in printer.cfg file..."
68 | sed -i '/include Helper-Script\/useful-macros\.cfg/d' "$PRINTER_CFG"
69 | else
70 | echo -e "Info: Useful Macros configurations are already removed in printer.cfg file..."
71 | fi
72 | if [ ! -n "$(ls -A "$HS_CONFIG_FOLDER")" ]; then
73 | rm -rf "$HS_CONFIG_FOLDER"
74 | fi
75 | echo -e "Info: Restarting Klipper service..."
76 | restart_klipper
77 | ok_msg "Useful Macros have been removed successfully!"
78 | return;;
79 | N|n)
80 | error_msg "Deletion canceled!"
81 | return;;
82 | *)
83 | error_msg "Please select a correct choice!";;
84 | esac
85 | done
86 | }
--------------------------------------------------------------------------------