[dev] [st][general] replace dmenu and other X tools by st

From: Tobias Bengfort <tobias.bengfort_AT_posteo.de>
Date: Fri, 13 Mar 2020 09:51:44 +0100

Hi,

I am surely not the first to come up with this[1], but I think many X
tools could be replaced by TUIs running in st. Think about this quick
example (dmenu replacement):

```
tmpi=$(mktemp)
tmpo=$(mktemp)(font rendering
trap "rm -rf '$tmpi' '$tmpo'" EXIT

cat > "$tmpi"
st -i -g '60x12' -e sh -c "cat '$tmpi' | fzf --reverse > '$tmpo'"
cat "$tmpo"
```

The interesting thing about this is that you replace all the complexity
of X (e.g. font rendering) with all the complexities of the terminal
(e.g. ANSI escape codes).

I believe there could be changes to st that would make this kind of
usage simpler, e.g. an option for full-width or to automatically attach
stdin/stdout to the command (fzf in this case).

But the more important question at this point: Do you think this trade
of complexities is worth it?

tobias

[1]: https://medium.com/njiuko/using-fzf-instead-of-dmenu-2780d184753f
Received on Fri Mar 13 2020 - 09:51:44 CET

This archive was generated by hypermail 2.3.0 : Fri Mar 13 2020 - 10:00:10 CET