LogoLogo
MainsailMainsailOSCrowsnest
  • Welcome to Mainsail
  • Setup
    • Installation
      • MainsailOS
      • KIAUH
      • Docker
      • Manual setup
      • my.mainsail.xyz
    • Updates
      • Update Manager
      • Manual Update
    • Configuration
  • overview
    • Features
      • Bed Mesh
      • Console
      • Dashboard Organisation
      • Exclude Objects
      • Hide macros, outputs or fans
      • Localization
      • Macro Management
      • Macro Prompts
      • Presets
      • Print History and Statistics
      • Query devices
      • Built-in Themes
      • Custom Themes
        • Prepare
        • Backgrounds
        • Logos and Icons
        • Custom Navigation
        • Custom CSS
        • Community Themes
      • Thumbnails
      • Webcam
    • Settings
      • General
      • Console
      • Control
      • Dashboard
      • Editor
      • G-Code Viewer
      • Macros
      • Presets
      • Printers
      • UI-Settings
      • Webcams
    • Slicer
      • Cura
      • Ideamaker
      • PrusaSlicer
      • SuperSlicer
    • Quicktips
      • Slicer upload
      • Remote Access
      • Printer power switch
      • Additional Sensors
      • Disable Octoprint LCD menu
      • config.json
  • FAQ
    • Mainsail
    • Klipper warnings
      • Deprecated Values
      • Deprecated Options
      • Runtime Warning
    • Moonraker warnings
      • PolicyKit Permissions
    • Klipper errors
      • MCU Protocol error
    • Mainsail errors
      • Unauthorized
    • Getting Help
      • Discord
      • GitHub Discussions
  • About
    • Data Privacy
    • Sponsors
    • Development
      • Code standards
      • Contribute
      • Environment
      • Localization
    • Credits
  • 🔗Links
    • Github
    • Release Notes
    • Discord
    • Youtube
Powered by GitBook
On this page
  • Supported Macro prompt commands:
  • // action:prompt_begin <headline>
  • // action:prompt_text <text>
  • // action:prompt_button <label>|<gcode?>|<color?>
  • // action:prompt_button_group_start
  • // action:prompt_button_group_end
  • // action:prompt_footer_button <label>|<gcode?>|<color?>
  • // action:prompt_show
  • // action:prompt_end
  • Examples
  • Prompt with multiple Button-Groups
  • Simple question prompt

Was this helpful?

Edit on GitHub
  1. overview
  2. Features

Macro Prompts

It allows macros in Klipper to trigger dialog prompts to interact with the Firmware and will enable the user to choose between options or to close the dialog again in case it's no longer needed.

PreviousMacro ManagementNextPresets

Last updated 1 year ago

Was this helpful?

This feature needs the [respond] module of Klipper. So please check if this is enabled in your Klipper config.

This feature has been implemented since Mainsail v2.9.0. So, double-check your Mainsail version to be safe to use this feature.

Supported Macro prompt commands:

With these command, you can build your own Macro-Prompt:

// action:prompt_begin <headline>

This is the first command to define a prompt. The <headline>-Attribute will be the headline of the prompt dialog.

// action:prompt_text <text>

This command is to add a description text in the prompt.

// action:prompt_button <label>|<gcode?>|<color?>

With this command, you can add a button in the prompt.

  • <label>: Is the text inside of the button

  • <gcode?>: This attribute is optional to add a different G-Code to this button. (Default is the label text)

  • <color?>: This attribute is optional and will change the color of the button. Possible options are primary, secondary, info, warning, error. (Default is dark gray)

// action:prompt_button_group_start

With this command, you can start a "button group". This will allow you to display multiple buttons in the same row.

// action:prompt_button_group_end

With this command, you can close the current "button group"

// action:prompt_footer_button <label>|<gcode?>|<color?>

With this command, you can add a button in the footer of the prompt.

  • <label>: Is the text inside of the button

  • <gcode?>: This attribute is optional to add a different G-Code to this button. (Default is the label text)

  • <color?>: This attribute is optional and will change the color of the button. Possible options are primary, secondary, info, warning, error. (Default is white)

// action:prompt_show

With this command, the prompt dialog will be displayed

// action:prompt_end

This command will close/hide the prompt dialog.

Examples

Here some examples of Macro-Prompts

Prompt with multiple Button-Groups

[gcode_macro SHOW_PROMT_BUTTON_GROUPS]
gcode:
    RESPOND TYPE=command MSG="action:prompt_begin MacroPrompt"
    RESPOND TYPE=command MSG="action:prompt_text These are all button colors"
    RESPOND TYPE=command MSG="action:prompt_button default|TEST"
    RESPOND TYPE=command MSG="action:prompt_button_group_start"
    RESPOND TYPE=command MSG="action:prompt_button primary|TEST|primary"
    RESPOND TYPE=command MSG="action:prompt_button secondary|TEST|secondary"
    RESPOND TYPE=command MSG="action:prompt_button_group_end"
    RESPOND TYPE=command MSG="action:prompt_button_group_start"
    RESPOND TYPE=command MSG="action:prompt_button info|TEST|info"
    RESPOND TYPE=command MSG="action:prompt_button warning|TEST|warning"
    RESPOND TYPE=command MSG="action:prompt_button error|TEST|error"
    RESPOND TYPE=command MSG="action:prompt_button_group_end"
    RESPOND TYPE=command MSG="action:prompt_show"

Simple question prompt

[gcode_macro SHOW_PROMT]
gcode:
    RESPOND TYPE=command MSG="action:prompt_begin Question"
    RESPOND TYPE=command MSG="action:prompt_text Do you wont to cancel the print?"
    RESPOND TYPE=command MSG="action:prompt_footer_button continue|RESPOND TYPE=command MSG=action:prompt_end"
    RESPOND TYPE=command MSG="action:prompt_footer_button CANCEL|CANCEL_PRINT|error"
    RESPOND TYPE=command MSG="action:prompt_show"
Example: Filament runout prompt
Example of all button colors
Example of footer buttons
Example Filament Runout Prompt