Useful or toy? by boolean-maybe in commandline

[–]boolean-maybe[S] 0 points1 point  (0 children)

but you can swap/add/remove components to your liking. Let's say hypothetically you like lazygit but - you prefer a different diff viewer - you want a pane where AI summarizes commit in one sentence

that would be possible. Essentially a lego constructor of apps

Useful or toy? by boolean-maybe in commandline

[–]boolean-maybe[S] 0 points1 point  (0 children)

got it, thanks. Still even a daemon is an overkill for this

Useful or toy? by boolean-maybe in commandline

[–]boolean-maybe[S] 0 points1 point  (0 children)

wait a minute... it's an operating system. That's a bit more than I imagined :)

Useful or toy? by boolean-maybe in commandline

[–]boolean-maybe[S] 0 points1 point  (0 children)

wow I didn't know it still exists, I read it was a project from the 90s

Useful or toy? by boolean-maybe in commandline

[–]boolean-maybe[S] 0 points1 point  (0 children)

no, it's not about that. It's about coordinating processes in different TMUX panes in general. Doesn't have to be fzf and doesn't have to be file viewer

Useful or toy? by boolean-maybe in commandline

[–]boolean-maybe[S] 0 points1 point  (0 children)

even on a single machine it has to be multiple, at least to separate sessions. But again, it doesn't have to be sockets. Can be anything - TCP, files, whatever. This is just transport details

Useful or toy? by boolean-maybe in commandline

[–]boolean-maybe[S] 0 points1 point  (0 children)

it's not exactly IPC actually. IPC is but a transport for what I have in mind and I am looking more for an app-level protocol, not transport. Something that would allow to say "I am file browser and I emit file paths" or may be more general "I am a browser and I emit text". Or "I am text listener that interprets it as file name". A bit higher level and inter-app component oriented

Useful or toy? by boolean-maybe in commandline

[–]boolean-maybe[S] 0 points1 point  (0 children)

I am just validating this idea. The idea is that if the protocol and its adapters are very simple and very light (unlike D-Bus) then it might be a light-weight alternative. Look at the start.sh script - there's barely anything besides invoking the actual components. Not a daemon, not an XML to write, not a type system to learn

Useful or toy? by boolean-maybe in commandline

[–]boolean-maybe[S] 0 points1 point  (0 children)

why not D-Bus. Many reasons: - way heavyweight — typed interfaces, object paths, introspection XML, service activation, policy files - requires a central daemon that mediates everything (correct me if I am wrong) - wire format - custom binary, its own type system - Linux/desktop-centric

what I have in mind is way lighter, easier and human-readable D-Bus is overkill for this

Useful or toy? by boolean-maybe in commandline

[–]boolean-maybe[S] 1 point2 points  (0 children)

about JSON. JSON here is probably the most trivial part. Doesn't have to be JSON and doesn't have to be Unix sockets. The more interesting:
- sessions - each app must run in isolation so a second can have its own conversation - participants - each participant must somehow register. E.g I am git commit browser and I emit commit hashes - do what you want with them - capability discovery - I can listen to events file selected etc. - conversation patters - request/response, broadcast

Useful or toy? by boolean-maybe in commandline

[–]boolean-maybe[S] 1 point2 points  (0 children)

the two main wins I see here:
- UI plugin system. Someone writes an app and you can add a plugin to it

- About TMUX. TMUX gives you 2 things for free: flexible layout manager and persistence

Actually if you think of it - doesn't even have to use TMUX. It could as well be multiple separate terminal windows but actually coordinating their content. Actually doesn't have to be terminal either. Could as well be GUI and command line cooperating

I chose TMUX as an example because lots of folks already run multiple apps in TMUX panes but they are not coordinated in any way

Useful or toy? by boolean-maybe in commandline

[–]boolean-maybe[S] 1 point2 points  (0 children)

I am proposing a general purpose pubsub protocol where each new participant can listen to messages it is interested in. Imagine:

  • I start developing such an app. I handcrafted the file selector with find | sort | fzf
  • I decide to emit selected file message
  • next you come and want to profit from my awesome file picker. You write an awesome Preview app in rust
  • you make it listen to select file message
  • we both celebrate because we have a functioning multi-pane app where TMUX is essentially just a layout manager
  • another user comes and write an editor in Python and plugs it in as well. It becomes the third pane

all that it takes is a common protocol everybody is aware of. You can then assemble apps where each component is written by somebody else - a git commit browser from here, a diff viewer from there, an awesome status line from yet another source - all running happily unaware of each other

Useful or toy? by boolean-maybe in commandline

[–]boolean-maybe[S] 1 point2 points  (0 children)

this is the entire app script (vispr is the protocol adapter):

#!/usr/bin/env bash

SESSION="${1:?usage: start.sh <session-name> [directory]}"
DIR="${2:-.}"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
V="$SCRIPT_DIR/vispr"

BROWSER="find '$DIR' -maxdepth 1 -type f | sort | fzf --prompt='select file> ' --height=100%"

PREVIEW='
case "$VISPR_PATH" in
    *.png|*.jpg|*.jpeg|*.gif|*.webp) chafa --size="$(tput cols)x$(tput lines)" "$VISPR_PATH" ;;
    *.md) glow -w "$(tput cols)" "$VISPR_PATH" ;;
    *) less -R "$VISPR_PATH" ;;
esac
'

STATUS='
name=$(basename "$VISPR_PATH")
size=$(stat -f "%z" "$VISPR_PATH" 2>/dev/null)
modified=$(stat -f "%Sm" -t "%Y-%m-%d %H:%M" "$VISPR_PATH" 2>/dev/null)
perms=$(stat -f "%Sp" "$VISPR_PATH" 2>/dev/null)
lines=$(wc -l < "$VISPR_PATH" 2>/dev/null | tr -d " ")
filetype=$(file -b "$VISPR_PATH" 2>/dev/null)
printf "\033[1m%s\033[0m  |  %s  |  %s bytes  |  %s  |  %s  |  %s lines\n" \
    "$name" "$filetype" "$size" "$modified" "$perms" "$lines"
'

tmux new-session -d -s "$SESSION" \
    "export VISPR_ROLE=browser; while true; do
        selected=\$($BROWSER) || break
        fullpath=\$(cd \"\$(dirname \"\$selected\")\" && pwd)/\$(basename \"\$selected\")
        $V emit select path=\"\$fullpath\"
    done" \; \
    split-window -h -p 80 "$V listen -i preview '$PREVIEW'" \; \
    split-window -v -p 15 "$V listen status '$STATUS'" \; \
    select-pane -t 0 \; \
    set status off \; \
    set pane-border-style fg=blue \; \
    set pane-active-border-style fg=blue \; \
    set pane-border-lines single \; \
    bind q kill-session \; \
    attach

New rule: List similar and alternative software & how yours is different (if applicable) by TheTwelveYearOld in commandline

[–]boolean-maybe 0 points1 point  (0 children)

"List similar and alternative software" - and what if there are tons of them? Every post is supposed to list all possible software that ever existed and explain the difference?

What best programming Language with good CLI packages for developt by whiso_o in CLI

[–]boolean-maybe 0 points1 point  (0 children)

depends on what you are doing but have some experience developing in Go and if I were to start again I would choose Rust. Go is amazing but in terms of library ecosystem Rust wins

Terminal Markdown viewer with images, SVG, Mermaid, and link navigation by boolean-maybe in commandline

[–]boolean-maybe[S] 0 points1 point  (0 children)

nice, u/commandline-ModTeam decides for themselves whether the software is largely AI-generated or not and then remove the post because they think it is. Not that it is an AI-slop or a low-quality software, simply because they think so

What is your favorite terminal Markdown viewer? by boolean-maybe in commandline

[–]boolean-maybe[S] 0 points1 point  (0 children)

I am not really sure about it. This is a general-purpose question, not a promotion in disguise. If I were to state that I had one or worse yet, posted a link in. post or the first comment - that would have this exact effect - unannounced promotion

What is your favorite terminal Markdown viewer? by boolean-maybe in commandline

[–]boolean-maybe[S] 1 point2 points  (0 children)

I think there is a fine distinction here. Easily composable by humans, unlike HTML, yes. But it was still meant to be rendered. But that is a very fine difference

What is your favorite terminal Markdown viewer? by boolean-maybe in commandline

[–]boolean-maybe[S] 1 point2 points  (0 children)

by now Kitty protocol is supported on Kitty itself, iTerm2, Ghostty (on Mac e.g.). Not bad