nixos-config/common/home-manager/wayland/rofi/window.sh
2022-09-25 00:00:32 -04:00

15 lines
375 B
Bash
Executable file

#!/usr/bin/env bash
if [ $# -ne 0 ]; then
id=$(echo "$@" | cut -d ' ' -f1)
swaymsg "[con_id=$id]" focus
# Hack to get around weird bug
pkill rofi
exit 0
fi
swaymsg -t get_tree |
jq -r '.nodes[].nodes[] | if .nodes then [recurse(.nodes[])] else [] end + .floating_nodes |
.[] | select(.nodes==[]) | ((.id | tostring) + " " + .name)'