Last active
August 15, 2024 04:01
-
-
Save ShinyZero0/f2989be4f2c00f323e6d32b2595c1bc2 to your computer and use it in GitHub Desktop.
i visualized bspwm tree with graphviz
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
| #!/usr/bin/env bash | |
| traverse() { | |
| curr=$1 | |
| parent=$2 | |
| echo "\"$curr\" [" \ | |
| $(bspc query -N -n $curr.window &>/dev/null && echo "label = \"$curr: $(xdotool getwindowclassname $curr)\";" 'style = filled; fillcolor = "#aaffe4";') \ | |
| $(bspc query -N -n $curr.focused &>/dev/null && echo "color = red;") \ | |
| "];" | |
| [[ -n $parent ]] && echo "\"$parent\" -> \"$curr\";" | |
| child=$(bspc query -N -n $curr#@1) && (traverse $child $curr) | |
| child=$(bspc query -N -n $curr#@2) && (traverse $child $curr) | |
| } | |
| echo "digraph {" | |
| traverse $(bspc query -N -n @/) | |
| echo "}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
