Skip to content

Instantly share code, notes, and snippets.

@millancore
Created February 26, 2026 08:48
Show Gist options
  • Select an option

  • Save millancore/e1809f17fba7a684a38da10e75bb241c to your computer and use it in GitHub Desktop.

Select an option

Save millancore/e1809f17fba7a684a38da10e75bb241c to your computer and use it in GitHub Desktop.
#!/bin/bash
tabs=$(curl -s http://localhost:9222/json | jq -r '.[] | select(.type == "page") | "\(.title)\t\(.id)"')
selected=$(echo "$tabs" | cut -f1 | fuzzel --dmenu -p "Tab: ")
[ -z "$selected" ] && exit 0
tab_id=$(echo "$tabs" | grep -F "$selected" | head -1 | cut -f2)
# Activar pestaña via CDP
curl -s "http://localhost:9222/json/activate/$tab_id" > /dev/null
# Dar focus a la ventana de Vivaldi cuyo título contiene el nombre de la pestaña
sleep 0.15
niri msg action focus-window --id "$(niri msg --json windows \
| jq -r --arg title "$selected" \
'[.[] | select(.app_id == "vivaldi-stable" and (.title | contains($title)))] | first | .id')"
@millancore
Copy link
Copy Markdown
Author

millancore commented Feb 26, 2026

Vivaldi Tab Switcher for Niri (via CDP + fuzzel)

image

A bash script that lets you search and switch between Vivaldi browser tabs using fuzzel as a dmenu-style picker, powered by Chrome DevTools Protocol (CDP). Designed for the Niri Wayland compositor.

What It Does

  1. Queries Vivaldi's remote debugging endpoint for all open tabs.
  2. Presents tab titles in a fuzzel popup so you can fuzzy-search.
  3. Activates the selected tab via CDP.
  4. Focuses the correct Vivaldi window using niri msg.

Prerequisites

Dependency Purpose
Vivaldi Browser with CDP remote debugging enabled
curl HTTP requests to the CDP endpoint
jq JSON parsing
fuzzel Wayland-native dmenu alternative
niri Wayland compositor (scroll tiling)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment