master ohmu/wmutils / scripts / wmenu.sh
ohmu  ·  2026-07-25
 1#!/bin/sh
 2#
 3# fyr | 2019 (c) MIT
 4# dmenu wrapper to select windows based on their window title
 5# use xprop -id $wid WM_NAME or WM_CLASS for better matching
 6
 7LINES=$(lsw | wc -l)
 8
 9wid=$(\
10    for wid in $(lsw); do
11        printf '%s\n' "$wid | $(wname $wid)"
12    done | dmenu -p "Window:" | cut -d\  -f 1)
13
14test -n "$wid" && focus.sh "$wid"