diff --git a/scripts/functions.sh b/scripts/functions.sh index 264ede2..d2fb184 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -189,39 +189,43 @@ print_error(){ fi } -#remove_branding(){ -# echo -# top_border -# echo -e "| This action will remove the Voron brandings from |" -# echo -e "| your Mainsail installation. You have to perform |" -# echo -e "| this action again, everytime you updated Mainsail. |" -# bottom_border -# while true; do -# read -p "${cyan}###### Do you want to continue? (Y/n):${default} " yn -# case "$yn" in -# Y|y|Yes|yes|"") -# cd $MAINSAIL_DIR/css -# FILE=$(find -name "app.*.css" | cut -d"/" -f2) -# status_msg "Patching file '$FILE' ..." -# cp -n $KLIPPER_DIR/docs/img/klipper-logo-small.png $MAINSAIL_DIR/img/ -# #write extra lines to app.css -# echo >> "$FILE" -# cat < ${HOME}/kiauh/resources/app.css >> "$FILE" -# ok_msg "File '$FILE' patched!" -# status_msg "Setting new Favicon ..." -# #backup old favicon -# cp -n $MAINSAIL_DIR/favicon.ico $MAINSAIL_DIR/voron_favicon.ico -# cp ${HOME}/kiauh/resources/favicon.ico $MAINSAIL_DIR/favicon.ico -# ok_msg "Icon set!" -# echo -# ok_msg "Brandings removed!" -# ok_msg "Clear browser cache and reload Mainsail (F5)!" -# echo -# break;; -# N|n|No|no) break;; -# esac -# done -#} +remove_branding(){ + echo + top_border + echo -e "| This action will replace the Mainsail logo and |" + echo -e "| Favicon with the Klipper logo. Also the Voron |" + echo -e "| background image of the sidebar will be replaced by |" + echo -e "| a carbon fibre style CSS pattern. |" + hr + echo -e "| Note: You have to perform this action again, |" + echo -e "| everytime you update Mainsail. |" + bottom_border + while true; do + read -p "${cyan}###### Do you want to continue? (Y/n):${default} " yn + case "$yn" in + Y|y|Yes|yes|"") + cd $MAINSAIL_DIR/css + FILE=$(find -name "app.*.css" | cut -d"/" -f2) + status_msg "Patching file '$FILE' ..." + cp -n $KLIPPER_DIR/docs/img/klipper-logo-small.png $MAINSAIL_DIR/img/ + #write extra lines to app.css + echo >> "$FILE" + cat < ${HOME}/kiauh/resources/app.css >> "$FILE" + ok_msg "File '$FILE' patched!" + status_msg "Setting new Favicon ..." + #backup old favicon + cp -n $MAINSAIL_DIR/favicon.ico $MAINSAIL_DIR/voron_favicon.ico + cp ${HOME}/kiauh/resources/favicon.ico $MAINSAIL_DIR/favicon.ico + ok_msg "Icon set!" + echo + ok_msg "Brandings removed!" + ok_msg "Clear browser cache and reload Mainsail (F5)!" + echo + break;; + N|n|No|no) break;; + esac + done +} install_extension_shell_command(){ echo diff --git a/scripts/ui/advanced_menu.sh b/scripts/ui/advanced_menu.sh index 87d3967..2e92b71 100755 --- a/scripts/ui/advanced_menu.sh +++ b/scripts/ui/advanced_menu.sh @@ -8,11 +8,11 @@ advanced_ui(){ echo -e "| Klipper: | System: | " echo -e "| 1) [Switch Version] | 6) [Change hostname] | " echo -e "| 2) [Rollback] | | " - echo -e "| | Extensions: | " - echo -e "| Firmware: | 7) [Shell Command] | " + echo -e "| | Mainsail: | " + echo -e "| Firmware: | 7) [Remove branding] | " echo -e "| 3) [Build only] | | " - echo -e "| 4) [Build + Flash MCU] | | " - echo -e "| 5) [Get Printer-USB] | | " + echo -e "| 4) [Build + Flash MCU] | Extensions: | " + echo -e "| 5) [Get Printer-USB] | 8) [Shell Command] | " echo -e "| | | " quit_footer } @@ -76,13 +76,13 @@ advanced_menu(){ create_custom_hostname print_msg && clear_msg advanced_ui;; - #7) - # clear - # print_header - # remove_branding - # print_msg && clear_msg - # advanced_ui;; 7) + clear + print_header + remove_branding + print_msg && clear_msg + advanced_ui;; + 8) clear print_header install_extension_shell_command