Created
March 7, 2022 18:10
-
-
Save markallenpark/29bed197313714577b4acc68e6f6bb91 to your computer and use it in GitHub Desktop.
Send commands to paper controlled by screen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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