Skip to content
postsondePublic

About

⚡term-⇄-link▸ 🔮 Smart Terminal URL 🔀 Router and Stateless Unix-Style URL 🎛️ Dispatcher & terminal omnibox for Newsboat, w3m, mpv, ddgr, wiki-tui, etc and shell workflows. Unix Philosophy: term-⇄-link▸ acts strictly as a stateless, zero-overhead link dispatcer—---📡

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

⚡ RAW INTERFACE // postsonde

⚡term-⇄-link ▸ 🔮

term-link Demo

Smart Terminal URL Router 🔮 Omnibox & Newsboat Suite

⚡ RAW INTERFACE // postsonde
Stateless Unix-style URL dispatcher & terminal omnibox for Newsboat, w3m, mpv, etc. and shell workflows. Unix Philosophy: term-⇄-link▸ acts strictly as a stateless, zero-overhead link dispatcher—it opens papers directly in Zathura or pdftotext rather than piping into heavyweight literature workspaces (like papr), keeping your tools fast, modular,

License: GPL v3 Built for Linux Shell: Bash Theme: Dracula


🎯 Why ⚡term-⇄-link▸ 🌑 ?

Stateless Unix Philosophy: Unlike classic URL openers (urlview, urlscan) that simply dump every link into one browser—or bloated all-in-one suites that lock your data into proprietary databases—⚡term-⇄-link▸ is a zero-state dispatcher. It inspects each URL and routes it straight to the best lightweight Unix tool for the job (mpv, wiki-tui, w3m, zathura, or piper), keeping every tool modular, fast, and decoupled.

Keep your entire reading, search, and media workflow inside the terminal—without ever touching a bloated GUI browser.

Modern web browsing is slow, noisy, and full of trackers. ⚡term-⇄-link▸ acts as an intelligent Unix-style dispatcher between your terminal apps (Newsboat, w3m, or your shell) and specialized lightweight CLI/TUI tools:

  • 🧠 Zero-Click Smart Routing: Videos and podcasts launch straight into mpv with pre-buffering, Wikipedia articles open natively in wiki-tui, GitHub & GitLab repo links render their README.md right in the terminal, ArXiv papers & .pdf links open in your PDF viewer (or pdftotext), and standard web articles land in a clean rdrview + w3m Reader View.
  • 🦆 Built-In Terminal Omnibox: No URL on hand? Type keywords into tm—term-link searches DuckDuckGo (ddgr) right inside your terminal, lets you pick a result, and returns you cleanly to the search list when you're done.
  • 🔒 Privacy & Offline First: Reads input privately without polluting ~/.bash_history, strips tracking parameters automatically, opens Private/Incognito windows on demand, exports clean text-only Markdown or PDFs, and reads articles aloud offline using neural Piper TTS voices.

🔀 How It Works

  [ Newsboat ('o') ]  ──┐
  [ w3m ('M' / Alt+M)]  ┼──▶   ⚡term-⇄-link▸ (Strip Trackers)
  [ tm (Omnibox)   ]  ──┘          │
       │                           ├──▶  *.wikipedia.org     ──▶  📚 wiki-tui
       ▼ (Keywords)                ├──▶  github / gitlab.com ──▶  🐙 Rendered README (w3m)
  🦆 DuckDuckGo (ddgr) ────────────┼──▶  ArXiv / .pdf        ──▶  📄 PDF Viewer | pdftotext
                                   ├──▶  Video / Audio       ──▶  🎬 mpv (yt-dlp + 150MB cache)
                                   └──▶  Web / Articles      ──▶  ⌨️  Numpad Action Menu

✨ Key Features

🔍 Search & Smart Auto-Routing

  • 🔮 Private Omnibox (tm): Enter URLs or search queries without leaving traces in ~/.bash_history—or press Enter to grab your clipboard automatically.
  • 🦆 DuckDuckGo Terminal Search (ddgr): Type regular search terms instead of a URL to browse the top 9 results right inside your terminal (with automatic w3m HTML fallback).
  • 📚 Wikipedia Auto-Router (wiki-tui): Automatically detects *.wikipedia.org/wiki/... links, parses the language code and article title, and opens them directly in wiki-tui.
  • 🐙 GitHub & GitLab Repo README Preview: Opening a ://github.com<user>/<repo> or ://gitlab.com<user>/<repo> link fetches README.md directly and renders it cleanly via pandoc + w3m (or less) in your terminal.
  • 📄 ArXiv & Direct PDF Reader (PDF_VIEWER / pdftotext): Automatically converts arxiv.org/abs/... links to .pdf, downloads the file temporarily, and opens it in your configured * 📄 ArXiv & Direct PDF Reader (pdftotext / PDF_VIEWER): Automatically converts arxiv.org/abs/... links to .pdf and extracts readable layout text into less via pdftotext (poppler-utils, installed by install.sh). Recommended upgrade: Install Zathura (sudo apt install zathura zathura-pdf-poppler) and set PDF_VIEWER="zathura" in your config—⚡term-⇄-link▸ will then download PDFs temporarily, open them natively in Zathura, and auto-clean them on exit.
  • 👽 Reddit & Newsboat RSS: Rewrites reddit.com links to ://reddit.com automatically. (Note: Reddit blocks most unauthenticated web/search requests—for reliable terminal reading without an account, subscribe to subreddits via RSS directly in Newsboat, e.g. https://reddit.com.)
  • 🧹 Tracking Stripper: Removes utm_*, fbclid, gclid, dclid, msclkid, igshid, si, and ref=rss before opening or copying any URL.

🎬 High-Speed Media Engine (mpv + yt-dlp)

  • ⚡ Instant Fast-Path: Direct media files (.mp4, .mp3, .m3u8, .flac, .opus) and major platforms (YouTube, Arte, ZDF, ARD, Vimeo, Odysee, Twitch, Dailymotion) bypass slow simulation checks and launch immediately.
  • 🚀 Direct Stream Resolving & Cache: Resolves streams via yt-dlp -g with unthrottled client options and a 150 MB / 60s read-ahead cache for smooth, stutter-free playback.
  • 🎞️ Clean Alternate-Screen Player (MPV_SPINNER): Runs mpv in an isolated alternate terminal buffer (smcup/rmcup) with an animated top spinner & bottom AV: status bar—leaving zero terminal residue on exit. Run MPV_SPINNER=0 tm anytime for raw, unmodified mpv console logs.
  • 🛡️ Autoplay Ad-Blocker & HD Fallback: Disables yt-dlp's generic extractor (--ies "default,-generic") so news articles with embedded ad clips still open in Reader View, while extracting hidden og:video HD streams (e.g. tagesschau.de).

⌨️ Interactive Numpad Menu

For standard web articles and links, ⚡term-⇄-link▸ renders a centered, adaptive Dracula TUI Numpad Menu (Enter triggers 1 Reader View by default):

Key Action Description
1 📖 Reader View (w3m) (Default) Distraction-free article reading via rdrview + w3m.
2 🌐 Full w3m Opens the complete webpage in w3m with full link & external browser support.
3 🕵️ Browser (Private) Opens in Incognito/Private mode (Brave, Firefox, LibreWolf, Chrome, Chromium, Vivaldi, Zen, Floorp, Edge).
4 📋 Copy URL Copies the cleaned, tracker-free URL to your clipboard (wl-copy, xclip, or xsel).
5 📝 Save minimal MD Exports a clean, image-free GitHub-Flavored Markdown file to SAVE_DIR.
6 🌍 Browser (Normal) Opens the link in your default desktop browser.
7 🔊 Read aloud (TTS) Auto-detects the article language (26+ languages) and reads it aloud offline via Piper TTS.
8 📄 Save clean PDF Generates a clean, text-only PDF with table of contents via pandoc + weasyprint in SAVE_DIR.
9 ▶️ Play in mpv Forces any URL or embedded media stream straight into mpv.
0 ❌ Back Exits cleanly back to search results, Newsboat, w3m, or the input prompt.

🌐 Seamless w3m Integration & Shortcuts

When browsing inside w3m (opened via Option 2 Full w3m), pipe pages or individual links back into ⚡term-⇄-link▸—or straight to your GUI browser:

Shortcut in w3m Action Notes
Shift + M Send current page to ⚡term-⇄-link▸ Works in Full w3m (2). (In Reader View 1, w3m reads from stdin.)
Alt + Shift + M (or Esc → Shift + M) Send link under cursor to ⚡term-⇄-link▸ Ideal for browsing lists and opening individual papers, repos, or videos.
9 + Shift + M Open current page in GUI browser Uses w3m's extbrowser9 slot (xdg-open).

📚 Research Paper Workflow (arXiv.org)

Why no heavy literature manager pipe? Following the Unix philosophy, ⚡term-⇄-link▸ opens papers directly in Zathura or pdftotext rather than piping into full workspace apps (like papr), keeping your reading flow instant and stateless.

  1. Direct Search: Type arxiv Attention Is All You Need in tm to jump straight into a paper's PDF.
  2. Browsing New Submissions: Open a category feed such as arxiv.org/list/cs.AI/recent and pick 2 (Full w3m) in the Numpad menu.
  3. Navigate to any paper's [html] link and press Alt + Shift + M (or Esc → Shift + M) to send it to ⚡term-⇄-link▸—from there you can read it cleanly (1), listen to it (7), or export a formatted PDF with table of contents (8).

⚙️ Configuration (~/.config/term-link/config)

Customize behavior persistently without editing the script itself by creating ~/.config/term-link/config (see config.example):

# ~/.config/term-link/config
MPV_SPINNER=1                        # 1 = clean alternate screen + spinner, 0 = raw mpv console logs
SAVE_DIR="$HOME/Downloads/Articles"  # Target folder for Markdown & PDF exports
# PDF_VIEWER="zathura"               # Recommended: lightweight Vim-key PDF viewer (press Ctrl+R in Zathura for Dark Mode)
# Recommended optional PDF viewer (instead of terminal pdftotext | less):
# Install via: sudo nala install zathura zathura-pdf-poppler  (Tip: press Ctrl+R inside Zathura for Dark Mode)
# PDF_VIEWER="zathura"

💻 Usage

  1. Reload shell config once after setup:
    source ~/.bashrc
  2. Newsboat (nb): Launch Newsboat with the rainbow banner and press o on any article to open it in ⚡term-⇄-link▸. (Multiple ⚡term-⇄-link▸ instances can run simultaneously alongside Newsboat.)
  3. Private Omnibox (tm):
    • tm → Paste a URL, press Enter for clipboard, or type keywords to search DuckDuckGo.
    • MPV_SPINNER=0 tm → Temporarily disable the alternate player screen to inspect raw mpv logs.

🍓 Raspberry Pi, SSH & Low-Resource Mode

Built to run effortlessly on low-spec hardware—including Raspberry Pi (even Pi 3 / Zero 2 W) and headless SSH sessions:

  • ⚡ Ultra-Low Footprint: Core tools (bash, w3m, rdrview, pdftotext, ddgr) consume only a few megabytes of RAM—no bloated browser engine required.
  • 🎧 Automatic Headless / SSH Audio Mode: When running over SSH or on a displayless system ($DISPLAY and $WAYLAND_DISPLAY unset), ⚡term-⇄-link▸ automatically passes --no-video to mpv and requests audio-only streams (bestaudio/best), saving CPU, RAM, and bandwidth.
  • 🎚️ Manual Audio-Only Override (MPV_NO_VIDEO=1): Force audio-only playback anytime—even on a desktop—via MPV_NO_VIDEO=1 tm or persistently in ~/.config/term-link/config.
  • 🗣️ ARM-Optimized Offline TTS: Powered by Piper TTS, designed specifically for fast neural voice synthesis on Raspberry Pi / ARM boards.

🚀 Quick Start

Make sure Newsboat is closed, open your terminal, and run:

bash <(curl -fsSL https://raw.githubusercontent.com/postsonde/term-link/main/install.sh)

Note: Uses bash <(...) so interactive prompts work properly. Do not run with sudo—the installer prompts for sudo automatically when needed. Press Enter for defaults or 0 to abort anytime.

Local Clone & Installer CLI Options

git clone https://://github.com/postsonde/term-link.git && cd term-link && ./install.sh
USAGE: ./install.sh [OPTION]

  (no option)       Interactive setup: deps, voices, newsboat, w3m & aliases.
  -s, --status      Check binaries, piper voices, newsboat & bashrc.
  -u, --uninstall   Remove term-link, newsboat/w3m hooks & bashrc aliases.
  -h, --help        Show help message and exit.

📁 Repository Structure & License

  • term-link — Main URL router & omnibox script (installed to ~/.local/bin/term-link).
  • install.sh — Interactive installer, dependency checker & uninstaller.
  • config.example — Sample configuration file for ~/.config/term-link/config.

📝 License


[Status: Active | postsonde.github.io | License: GNU GPLv3 | Simulated Gemini/Web Hybrid]

About

⚡term-⇄-link▸ 🔮 Smart Terminal URL 🔀 Router and Stateless Unix-Style URL 🎛️ Dispatcher & terminal omnibox for Newsboat, w3m, mpv, ddgr, wiki-tui, etc and shell workflows. Unix Philosophy: term-⇄-link▸ acts strictly as a stateless, zero-overhead link dispatcer—---📡

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages