webcon
Control your computer through shell commands from a barebones web interface.
Example configuration: config.yaml
__variables__:
mpvfifo: ~/.local/share/mpv/fifo
mpv:
rewind: echo seek -5 > {mpvfifo}
play/pause: echo cycle pause > {mpvfifo}
fast forward: echo seek 5 > {mpvfifo}
announcer:
greet: say hello
part: say farewell
Installation
pip3 install webcon
Tab completion
sudo activate-global-python-argcomplete
If you installed via pip, you may need to run the following before autocompletion works:
grep 'PYTHON_ARGCOMPLETE_OK' "$(which webcon)" &>/dev/null || sudo sed -i "1a # PYTHON_ARGCOMPLETE_OK" "$(which webcon)"
Usage
usage: webcon [-h] [--host HOST] [-p PORT] [config_file]
Control your computer through shell commands from a barebones web interface.
Configuration goes in ~/.config/webcon/config.yaml, or an alternate location
may be provided by command line argument.
Configuration format:
- Throughout the configuration, order of each mapping is taken into account to
ensure the layout does not deviate from expectations.
- The top level of the configuration is a mapping.
- Variables in the top-level key `__variables__` will be substituted once via
`str.format` throughout the entire file. This may be used to extract long
constants, etc.
- Every other top-level key will define a service, and its value shall be a
mapping of the actions it supports.
- Each action shall define a label/command pair, in the the form of
`label: command`.
Example configuration:
__variables__:
mpvfifo: ~/.local/share/mpv/fifo
mpv:
rewind: echo seek -5 > {mpvfifo}
play/pause: echo cycle pause > {mpvfifo}
fast forward: echo seek 5 > {mpvfifo}
announcer:
greet: say hello
part: say farewell
Explanation:
- Define `mpvfifo` as a variable holding the location of a mpv fifo.
- Define a service `mpv`.
- This service exports the actions `rewind`, `play/pause`, and
`fast forward`. The actions are different echoes to `mpvffo`.
- Define a service `announcer`.
- This service exports the actions `greet` and `part`. The actions are
different phrases which will be synthesized through `say`.
positional arguments:
config_file The config file to use. Default:
/Users/echan/.config/webcon/config.yaml
optional arguments:
-h, --help show this help message and exit
--host HOST The server host. Default: 0.0.0.0
-p PORT, --port PORT The server port. Default: 8080
Metadata
Release files for webcon 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| webcon-1.0.2.tar.gz | 12.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| webcon-1.0.2-py36-none-any.whl | Python 3.6 | none | any | Details |
Total release size: 28.0 kB
Release files / webcon-1.0.2.tar.gz
| Download URL | webcon-1.0.2.tar.gz |
|---|---|
| Size | 12.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
174b4a93136907f558adfcbb0a1a759d2ca5be539b42564952a7c95d10e51e7e
|
|
BLAKE2b-256 checksum How to use checksums |
58114a22cdedac41e83e8c9b9f5d0023ae930eca70c4205f12fcceabdd063a61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / webcon-1.0.2-py36-none-any.whl
| Download URL | webcon-1.0.2-py36-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3.6 |
|
SHA-256 checksum How to use checksums |
7e11a614ab1302e066e5b8b73c31b668a44578eea17207e1391575c42211cbcd
|
|
BLAKE2b-256 checksum How to use checksums |
1bc941a8c0af0234ba7af889542686beeace6e414ac2b4dc80e2a9bc753fa19f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for webcon 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.