Rename to wl-pick

wlgrid described the shape of the thing rather than what it is for, and
the shape is the least interesting part now that it doesn't focus
anything: it shows you what is running and reports which one you pointed
at. wl-pick says that.

The wl- prefix rather than wlr- is deliberate. The capture path is
entirely upstream ext- protocols (ext-image-copy-capture,
ext-image-capture-source, ext-foreign-toplevel-list); the only
wlroots-flavoured piece is layer-shell, which KDE, niri and labwc
implement too. What actually keeps this from running on other
compositors is the sway IPC dependency, not wlroots, so wlr- would
promise a portability that isn't there. Hyphenated because the ecosystem
hyphenates when the suffix is a real word — wl-clipboard, wl-mirror,
wl-screenrec — and reserves the smushed form for coinages like wlsunset.

Also renames the layer-shell namespace and the memfd labels, which show
up in compositor debugging.
This commit is contained in:
Milad Alizadeh
2026-08-23 18:35:27 +01:00
parent 71ba77c989
commit 5b98615c41
5 changed files with 27 additions and 27 deletions
+8 -8
View File
@@ -1,4 +1,4 @@
# wlgrid
# wl-pick
A window switcher for wlroots compositors: a grid overlay of **live** window
previews that looks like a rofi theme, and tells you which one you picked.
@@ -35,7 +35,7 @@ is the one thing the rofi version had that this doesn't — see the roadmap.
## Usage
```
wlgrid [--print] [--verbose] [--hide-labels] [--font FAMILY] [--font-size PX]
wl-pick [--print] [--verbose] [--hide-labels] [--font FAMILY] [--font-size PX]
[--live all|current|none] [--fps N] [--timeout SECS]
```
@@ -48,17 +48,17 @@ wlgrid [--print] [--verbose] [--hide-labels] [--font FAMILY] [--font-size PX]
- `--timeout SECS` exits after a deadline (an escape hatch: the overlay takes an
exclusive keyboard grab)
wlgrid is a chooser: it reports what you picked and leaves acting on it to the
wl-pick is a chooser: it reports what you picked and leaves acting on it to the
caller. The pick goes to stdout, nothing does if you cancel, and the exit status
is 0 for a pick and 1 for a cancel.
wlgrid never acts on the choice — it has no idea what you want to do with it.
wl-pick never acts on the choice — it has no idea what you want to do with it.
Focusing on sway looks like this:
```sh
#!/usr/bin/env bash
# ~/.local/bin/winmenu, bound to $mod+Tab
IFS=$'\t' read -r type id toplevel app title < <(wlgrid) || exit 0
IFS=$'\t' read -r type id toplevel app title < <(wl-pick) || exit 0
case $type in
window) swaymsg "[con_id=$id] focus" ;;
output) swaymsg "focus output $id" ;;
@@ -68,7 +68,7 @@ esac
Windows only, as a one-liner:
```sh
swaymsg "[con_id=$(wlgrid --no-outputs | cut -f2)] focus"
swaymsg "[con_id=$(wl-pick --no-outputs | cut -f2)] focus"
```
Three formats, because the identifiers different consumers need differ:
@@ -80,13 +80,13 @@ Three formats, because the identifiers different consumers need differ:
| `portal` | `Monitor: NAME` or `Window: TOPLEVEL_ID` |
`portal` is exactly what xdg-desktop-portal-wlr's `simple` chooser reads, so
wlgrid can be the picker for `getDisplayMedia` and friends — with live previews
wl-pick can be the picker for `getDisplayMedia` and friends — with live previews
of both windows and displays:
```ini
[screencast]
chooser_type=simple
chooser_cmd=wlgrid --format portal
chooser_cmd=wl-pick --format portal
```
| key | |