These are examples of useful macros that you can use within Klipper's printer.cfg file. You may not be able to use them verbatim, but it will get you started.