Skip to content

Instantly share code, notes, and snippets.

@lidgnulinux
Created May 20, 2024 02:46
Show Gist options
  • Save lidgnulinux/3de0852a36f4dcb01800fc401c0b38a1 to your computer and use it in GitHub Desktop.
Save lidgnulinux/3de0852a36f4dcb01800fc401c0b38a1 to your computer and use it in GitHub Desktop.
Show list of window(s) for wayland compositor. The compositor may need to implement foreign-toplevel protocol.
#!/usr/bin/bash
window_list=$(wlrctl toplevel list | awk '{ print substr($0, index($0,$2)) }')
selected=$(echo "$window_list" | wofi -d)
wlrctl toplevel focus title:"$selected"
# Note :
# We need to use "title" rather than "app_id" to avoid window with same app_id.
# I made this when I'm using niri.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment