bspwm/show_windows.sh

25 lines
689 B
Bash
Raw Normal View History

2020-11-05 20:05:12 +00:00
#!/bin/sh
2020-11-08 20:30:27 +00:00
_ignore_desktop="$1"
2020-11-05 21:49:56 +00:00
_focused_node_id="$(bspc query -N -n .focused)"
2020-11-05 20:05:12 +00:00
bspc query -D -d .occupied | while read _desktop_id ; do
2020-11-08 20:30:27 +00:00
_desktop_name="$(bspc query -D -d $_desktop_id --names)"
2020-11-05 20:05:12 +00:00
2020-11-08 20:30:27 +00:00
if [ "$_ignore_desktop" != "$_desktop_name" ] ; then
bspc query -N -d "$_desktop_id" -n .window | while read _node_id ; do
_node_id="$(bspc query -N -n $_node_id)"
_title="$(xtitle $_node_id)"
_wm_class="$(xprop -id $_node_id | grep WM_CLASS | cut -d\" -f2)"
2020-12-30 12:07:04 +00:00
printf " %-6s %-15s " "$_desktop_name" "$_wm_class"
2020-11-08 20:30:27 +00:00
if [ "$_focused_node_id" = "$_node_id" ] ; then
printf "\033[0;31m"
fi
2020-11-08 20:36:03 +00:00
printf " %.55s\033[0m\n" "$_title"
2020-11-08 20:30:27 +00:00
_desktop_name=''
done
echo ""
fi
2020-11-05 21:49:56 +00:00
2020-11-05 20:05:12 +00:00
done