SW_DevShellCmd - fablab-wue/piTelex GitHub Wiki

Device Module "ShellCmd"

Module Information

System

System Comments
RPi OK
PC Linux OK
PC Windows ?
Mac OK

Dependencies

none

Command Line Arguments

-S | --shellcmd

Example: telex.py -S

Config File Parameter

Param Default type/range Description
LUT {} dict Look-up table of user defined commands to be executed in response to piTelex ESC commands

Description

This module allows you to execute a shell command on escape sequences. On occurrence of a command listed in the dictionary, the associated shell command will be executed. This can be used for existing escape commands as well as for new "creations". The normal effect of existing commands is not masked or changed, but extended by the execution of the additional shell command.

Example section in config file:

"shellcmd": {
      "type": "shellcmd",
      "enable": true,
      "LUT": {
        "KEY1": "command to be executed on <ESC>KEY1",
        "KEY2": "command to be executed on <ESC>KEY2",
        "TP1": "curl -s -o null http://fs200.fritz.box/cm?cmnd=Power%20On",
        "TP0": "curl -s -o null http://fs200.fritz.box/cm?cmnd=Power%20Off",
        "x": "explorer"
      }
    }

Note: The output of the commands is sent to the screen module, but not to the teleprinter

Implementation

TODO

⚠️ **GitHub.com Fallback** ⚠️