Skip to content

Instantly share code, notes, and snippets.

@markallenpark
Created March 7, 2022 18:10
Show Gist options
  • Save markallenpark/29bed197313714577b4acc68e6f6bb91 to your computer and use it in GitHub Desktop.
Save markallenpark/29bed197313714577b4acc68e6f6bb91 to your computer and use it in GitHub Desktop.
Send commands to paper controlled by screen
#!/bin/env python3
import os
import sys
def sendCommand(command):
os.system('/usr/bin/screen -p 0 -S paper -X stuff "' + command + '"')
def getCommand():
commandParts = sys.argv[1:]
command = ''
for part in commandParts:
command = command + part + " "
return command.rstrip()
sendCommand(getCommand())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment