Skip to main content

thqm, WSGI server providing simple remote hotkey and command execution on host.

Project description

thqm

Remote command execution made easy.

thqm takes its name from the arabic تحكم, pronounced tahakum, meaning control.

thqm makes it very easy to setup a simple remote control interface on the host machine.

thqm is a nifty little HTTP server which reads from standard input. It dynamically generates a simple button menu based on the provided stdin and outputs any button the user presses to stdout. In a sense its kind of like the dmenu/rofi of HTTP servers.

This makes it very flexible and script friendly. See the examples folder for some scripts.

 

 

Installation

pip install thqm

thqm should work on linux, MacOS and Windows.

It usually is a good idea to use a virtual environment, or maybe consider using pipx.

Dependencies

thqm requires the following to run:

  • python3
  • jinja

Optional:

  • pyqrcode for qrcode generation.

Usage

Check the examples folder for some usage examples.

$thqm --help

usage: thqm [-h] [-p PORT] [-q] [-pw PASSWORD] [-u USERNAME] [-s SEPERATOR]
            [-o]

Remote command execution made easy.

optional arguments:
  -h, --help            show this help message and exit
  -p PORT, --port PORT  Port number. (default: 8888)
  -q, --qrcode          Show the qrcode and exits, requires "pyqrcode".
                        (default: False)
  -pw PASSWORD, --password PASSWORD
                        Authentication password. (default: None)
  -u USERNAME, --username USERNAME
                        Authentication username, only used if a PASSWORD is
                        provided. (default: thqm)
  -s SEPERATOR, --seperator SEPERATOR
                        Entry seperator pattern. (default: )
  -o, --oneshot         Shutdown server after first click. (default: False)

Use the -u and -pw arguments to set a username and password to restrict access. The authentication is handled with HTTP basic authentication.

With the -s argument you can define the pattern on which to split stdin.

The -o flag will stop the server after the first button press.

The -q (requires pyqrcode) flag will print a qr-code in the terminal, this qr-code contains the credentials so it will bypass any authentication, the same is true for the in browser qr-code. This makes it particularly easy to share access with others.

TODO

  • remove external css/JS dependencies
  • allow for custom index.html template and index.css

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thqm-1.1.0.tar.gz (11.5 kB view hashes)

Uploaded Source

Built Distribution

thqm-1.1.0-py3-none-any.whl (11.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page