Skip to content

Instantly share code, notes, and snippets.

@lidgnulinux
Last active January 13, 2023 09:32
Show Gist options
  • Save lidgnulinux/b58b20865f5c8b1a539199b6ed8a30cc to your computer and use it in GitHub Desktop.
Save lidgnulinux/b58b20865f5c8b1a539199b6ed8a30cc to your computer and use it in GitHub Desktop.
#!/bin/sh
jwq() {
jq -r 'recurse(.nodes[]?) | select(.name == "__i3_scratch").floating_nodes[].'$1', select(.name == "__i3_scratch").floating_nodes[].window_properties.title'
}
app_id=$(swaymsg -t get_tree | jwq app_id | grep -v null)
win_id=$(swaymsg -t get_tree | jwq id | grep -v null)
title=$(swaymsg -t get_tree | jwq name | grep -v null)
height=$(echo "$win_id" | wc -l)
selected=$(paste -d " " <(printf %s "$win_id") <(printf %s "$app_id") <(printf %s "$title") | wofi -d --lines $(expr $height + 1) -p "Minimized Window(s)" | cut -d ' ' -f 1)
swaymsg [con_id="$selected"] focus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment