Last active
January 13, 2023 09:32
-
-
Save lidgnulinux/b58b20865f5c8b1a539199b6ed8a30cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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