thqm
takes its name from the arabic تحكم, pronounced tahakum, meaning control.
thqm
is a nifty little HTTP server. It dynamically generates a web page based on the provided stdin
and outputs any selected entry to stdout
.
In a sense, it functions similarly to dmenu
/rofi
but as a HTTP servers.
This makes it very flexible and script friendly.
See the examples folder for some example scripts.
To compile and install manually from this repo, you'll need rust
installed.
To compile the binary:
console
$ git clone https://github.com/loiccoyle/thqm.rs
$ cd thqm.rs
$ cargo build --release
The compiled binary will be located at ./target/release/thqm
.
Just place this binary somewhere in your $PATH
.
console
$ cargo install tba
Using your favourite AUR helper:
console
$ paru -S tba
thqm
has a few command line options, when in doubt see the --help
.
console
$ thqm --help
tba
thqm
will generate a web page based on the provided stdin
, the selected entry will be printed to stdout
.
For this behaviour to actually be useful, we'll need to do a bit of scripting.
A typical script will look something like this:
```bash
handler() { while IFS= read -r event; do case "$event" in "Option 1") # handle Option 1 ;; "Option 2") # handle Option 2 ;; *) # pass through echo "$event" ;; esac done }
printf "Option 1\nOption 2" | thqm "$@" | handler
```
See the examples folder for some example scripts.
thqm
comes with a few included menu styles, see the styles folder, they will be extracted to $XDG_DATA_DIR/thqm
when thqm
is first run.
You can add your own by following the same style structure as those already included.
Note: thqm
uses tera
templates to generate the menu.