nixos-config/home-manager/wayland/rofi/window.sh

15 lines
375 B
Bash
Raw Normal View History

2022-09-23 23:33:11 -04:00
#!/usr/bin/env bash
if [ $# -ne 0 ]; then
2022-09-24 23:30:38 -04:00
id=$(echo "$@" | cut -d ' ' -f1)
2022-09-23 23:33:11 -04:00
swaymsg "[con_id=$id]" focus
2022-09-24 23:30:38 -04:00
# Hack to get around weird bug
pkill rofi
2022-09-23 23:33:11 -04:00
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)'