Skip to content

Instantly share code, notes, and snippets.

Shawn Bruce kantlivelong

Block or report user

Report or block kantlivelong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
import sys
import time
import yaml
from pynput import mouse, keyboard
from pynput.keyboard import Key
from pynput.mouse import Button
import struct
kb_controller = keyboard.Controller()
View gist:45c4d6aac2e34091707ad93a247271ac
Looking for help with a third party plugin? Are you the author of a third party plugin and want a centralized place to interact with the OctoPrint community? Have an idea for a new plugin? This is the right place for you.
Things that should go here:
Threads related to specific third party plugins. Be sure to prefix the thread title with the name of the plugin. (eg. "[MQTT Plugin] Am I doing this right?")
Ideas for new plugins that you’d like to see implemented (also use the like button on ideas that others posted!)
View gist:d14427d9b5dbb84be54dd13d97f6549b
OUTPUT=`gpio -1 read $GPIO_PIN 2> /dev/null`
if [ "$OUTPUT" -eq "0" ]
View gist:3cf26db3ff68c2510c8d8b03fb6e2e53
; Wait for bed to reach 80% of required temp then set to required temp
{% if printer_profile.heatedBed %}
M190 S{{ (plugins.preheat.bed * 0.8)|round }}
M140 S{{ plugins.preheat.bed }}
{% endif %}
; Set tool temps
{% for tool, temp in %}
M104 T{{ tool }} S{{ temp }}
View gist:00f66d0d733bb231f0ccb4953b17a6f1
if is_octoprint_compatible(">=1.3.7"):
return (None, None, self.temps)
prefix = textwrap.dedent(
{{% if plugins is not defined %}}
{{% set plugins = {{}} %}}
{{% endif %}}
View gist:8fec1fa9df1a2d8af42cd72f071e868e
p = subprocess.Popen(shlex.split(cmd_line), shell=True)
self._logger.debug("command executed. PID=%s, Command=%s" % (, cmd_line))
while p.poll() is None:
r = p.returncode
self._logger.debug("returned: %s" % r)
View gist:e88a42c9fb2d447bf051881926a2ce88
'bed': {
'actual': -1000.0,
'target': 0.0,
'offset': 0
'tool0': {
'actual': -669.63,
'target': 300.0,
'offset': 0
View gist:dda0ef3f8a410fbfd0af0b458bd0123a
'progress': {
'completion': 75.75757575757575,
'printTimeLeftOrigin': 'linear',
'printTime': 147,
'printTimeLeft': 178,
'filepos': 375
'state': {
'text': 'Printing',
View gist:833470e3632bb84f880bf0f23cd743bf
def _TEST(self, comm, script_type, script_name, *args, **kwargs):
if not script_type == "gcode":
return None
if script_name == "afterPrinterConnected":
prefix = "M117 prefix"
postfix = "M117 postfix"
return prefix, postfix
elif script_name == "beforePrinterDisconnected":
You can’t perform that action at this time.