npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dev-belts/tui-pipew

v0.1.0

Published

TUI minimalista para gerenciar dispositivos de áudio PipeWire

Readme

@dev-belts/tui-pipew

TUI (Terminal User Interface) para gerenciar dispositivos de áudio PipeWire diretamente no terminal — sem mouse, sem GUI, sem frescura.

┌──────────────────────────────────────────────────────────────────────────────┐
│  🎵  PipeWire Audio Control                                                  │
└──────────────────────────────────────────────────────────────────────────────┘
 ┌──────────┐
 │ 🔊 Saída │  🎤 Entrada   📱 Apps
 ╰──────────╯
╭────────────────────────────────────────────────────────────────────────────╮
│                                                                            │
│  ►  🎧  Wireless Headset   PADRÃO                                          │
│     📺  HDMI Audio                                                         │
│     🔌  USB Audio Speakers                                                 │
│                                                                            │
╰────────────────────────────────────────────────────────────────────────────╯
  Tab/←→: alternar aba   ↑↓: navegar   Enter: padrão   d: ocultar   ESC: sair

O que faz

  • Saída — lista todos os sinks disponíveis, define o padrão com Enter
  • Entrada — lista todos os sources disponíveis, define o padrão com Enter
  • Apps — mostra quais apps estão reproduzindo áudio e em qual dispositivo; Enter abre um picker para redirecionar o stream em tempo real
  • Ocultar devices — tecla d esconde um device da lista (persistido em ~/.config/dev-belts/tui-pipew/config.json)
  • Tela de erro — se o PipeWire não estiver disponível, exibe uma tela explicativa no terminal em vez de travar

Dependências do sistema

Estas ferramentas precisam estar instaladas e rodando:

| Ferramenta | Pacote | Verificar | |---|---|---| | pipewire | pipewire | pipewire --version | | pw-dump | pipewire | pw-dump --help | | pw-metadata | pipewire | pw-metadata --help | | wpctl | wireplumber | wpctl status |

Arch / CachyOS

sudo pacman -S pipewire wireplumber
systemctl --user enable --now pipewire pipewire-pulse wireplumber

Debian / Ubuntu

sudo apt install pipewire wireplumber pipewire-audio-client-libraries
systemctl --user enable --now pipewire wireplumber

Fedora

sudo dnf install pipewire wireplumber
systemctl --user enable --now pipewire wireplumber

Instalação global

npm install -g @dev-belts/tui-pipew

Depois disso, use de qualquer lugar:

pipew           # abre com abas Saída e Entrada
pipew --apps    # abre com a aba Apps também

PATH: se pipew não for encontrado após a instalação, adicione o bin global do npm ao seu PATH:

export PATH="$PATH:$(npm prefix -g)/bin"

Coloque essa linha no seu ~/.bashrc ou ~/.zshrc.

Como usar localmente

git clone <repo>
cd tui-pipew
npm install
npm run dev
npm run dev -- --apps

Atalhos de teclado

| Tecla | Ação | |---|---| | Tab / | Próxima aba | | | Aba anterior | | / | Navegar na lista | | Enter | Definir como padrão (Saída/Entrada) · Abrir picker (Apps) | | d | Ocultar device selecionado | | ESC | Fechar picker · Sair |

Estrutura do projeto

src/
├── index.tsx               # Entry point — carrega dados e renderiza App
├── App.tsx                 # Orquestrador: estado + teclado (useInput)
├── types.ts                # AudioDevice, AppStream, Tab, PickerState
├── config.ts               # Lê/escreve ~/.config/dev-belts/tui-pipew/config.json
├── components/
│   ├── Header.tsx          # Barra de título
│   ├── Footer.tsx          # Barra de atalhos
│   ├── TabBar.tsx          # Abas com highlight
│   ├── DeviceList.tsx      # Lista de sinks/sources com badge PADRÃO
│   ├── AppStreamList.tsx   # Lista de streams com device atual
│   ├── DevicePicker.tsx    # Modal para redirecionar stream
│   └── ErrorScreen.tsx     # Tela de erro divertida (sem PipeWire)
└── pipewire/
    ├── types.ts            # Sink, Source, Stream, VolumeInfo, erros
    ├── command.ts          # run(cmd) — exec promisificado
    ├── dump.ts             # fetchDump() — parseia pw-dump JSON
    ├── sinks.ts            # listSinks, getDefaultSink, setDefaultSink
    ├── sources.ts          # listSources, getDefaultSource, setDefaultSource
    ├── streams.ts          # listStreams, moveStreamToSink
    ├── volume.ts           # getVolume, setVolume, mute, toggleMute
    ├── stubs.ts            # Adaptador TUI ↔ lib (mapeamento de tipos + ícones)
    └── index.ts            # Namespace PipeWire (API pública da lib)

Lib PipeWire (uso standalone)

A lib em src/pipewire/ é independente do TUI e pode ser usada em qualquer projeto Node.js/TypeScript:

import { PipeWire } from "./src/pipewire/index.js";

const sinks   = await PipeWire.sinks.list();
const default = await PipeWire.sinks.getDefault();
await PipeWire.sinks.setDefault(sinkId);

const sources = await PipeWire.sources.list();
await PipeWire.sources.setDefault(sourceId);

const streams = await PipeWire.streams.list();
await PipeWire.streams.moveTo(streamId, sinkId);

const vol = await PipeWire.volume.get(nodeId);
await PipeWire.volume.set(nodeId, "50%");
await PipeWire.volume.toggle(nodeId);

Referência de comandos CLI

Ver CLI-INSTRUCT.md para os comandos PipeWire usados internamente.