update monitor script

This commit is contained in:
Ray Elliott 2020-11-05 21:52:25 +00:00
parent e5adf7179f
commit 9051da1199
1 changed files with 2 additions and 17 deletions

View File

@ -1,22 +1,7 @@
#!/bin/sh
bspc subscribe node_focus desktop_focus | while read -a msg ; do
_output="$(show-windows)"
clear
_focused_node_id="$(bspc query -N -n .focused)"
bspc query -D -d .occupied | while read _desktop_id ; do
_desktop_name="$(bspc query -D -d $_desktop_id --names):"
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)"
printf "%-6s %-15s " "$_desktop_name" "$_wm_class"
if [ "$_focused_node_id" = "$_node_id" ] ; then
printf "\033[0;31m"
fi
printf "%.55s\033[0m\n" "$_title"
_desktop_name=''
done
echo ""
done
echo "$_output"
done