Package: thqm
thqmRemote command execution made easy.thqmtakes its name from the arabic تحكم, pronounced tahakum, meaning control.thqmmakes it very easy to setup a simple remote control interface on the host machine.thqmis a nifty little HTTP server which reads from standard input. It dynamically generates a simple button menu based on the providedstdinand outputs any button the user presses tostdout.
In a sense its kind of like thedmenu/rofiof HTTP servers.This makes it very flexible and script friendly. See theexamplesfolder for some scripts.Installationpipinstallthqmor withpyqrcodepipinstall'thqm[qrcode]'thqmshould work on linux, MacOS and Windows.It usually is a good idea to use a virtual environment, or maybe consider usingpipx.Dependenciesthqmrequires the following to run:python3jinjaOptional:pyqrcodefor qrcode generation.Configurationthqmwill create a config folder:Linux:$XDG_CONFIG_HOME/thqm(or$HOME/.config/thqmif$XDG_CONFIG_HOMEis not set)MacOS:~/Library/Application Support/thqmWindows:%LOCALAPPDATA%/thqm(or~/thqm)This folder holdsthqm's custom styles. A bare bone example,pure_html, will be created.To add your own custom style, follow the folder structure of the provided example. Maybe have a look at thedefaultstyle.Note:the base folder of the server will the style's folder. So to access files in thestaticfolder from yourindex.html:<linkrel="stylesheet"type="text/css"href="static/index.css"/>UsageCheck theexamplesfolder for some usage examples.usage: thqm [-h] [-p PORT] [-u USERNAME] [-pw PASSWORD] [-s SEPERATOR] [-t TITLE] [--interface INTERFACE]
            [--style {fa-grid,default,pure_html}] [--extra-template-args JSON] [-q] [-sq PATH] [-l] [-o] [--no-shutdown]
            [--no-qrcode] [--custom-event-input] [--version]

Remote command execution made easy.

Custom styles should be added to /home/lcoyle/.config/thqm

options:
  -h, --help            show this help message and exit
  -p PORT, --port PORT  Port number. (default: 8901)
  -u USERNAME, --username USERNAME
                        Authentication username, only used if a PASSWORD is provided. (default: 'thqm')
  -pw PASSWORD, --password PASSWORD
                        Authentication password. (default: None)
  -s SEPERATOR, --seperator SEPERATOR
                        Entry seperator pattern. (default: '\n')
  -t TITLE, --title TITLE
                        Page title. (default: 'thqm')
  --interface INTERFACE
                        Network interface to use to find the local ip. If not provided, will try to infer the appropriate network interface. (default: None)
  --style {fa-grid,default,pure_html}
                        Page style. (default: 'default')
  --extra-template-args JSON
                        Extra template arguments, json string. (default: '{}')
  -q, --show-qrcode     Show the qrcode in terminal, requires "pyqrcode". (default: False)
  -sq PATH, --save-qrcode PATH
                        Save the qrcode png to the provided path, requires "pyqrcode". (default: None)
  -l, --show-url        Show the page url. (default: False)
  -o, --oneshot         Shutdown server after first click. (default: False)
  --no-shutdown         Remove server shutdown button. (default: False)
  --no-qrcode           Remove qrcode button. (default: False)
  --custom-event-input  Add a text field input. (default: False)
  --version             Show version and exit. (default: False)Use the-uand-pwarguments to set a username and password to restrict access. The authentication is handled withHTTP basic authentication.With the-sargument you can define the pattern on which to splitstdin.The-oflag will stop the server after the first button press.The-q(requirespyqrcode) 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.Use-tto change the page title.--no-shutdownremoves the shutdown server button.--no-qrcoderemoves the qrcode button.Select the page style using the--styleargument. You can add custom styles inthqm's config folder.