Compare commits

..

3 Commits

Author SHA1 Message Date
Ray Elliott 9051da1199 update monitor script 2020-11-05 21:52:25 +00:00
Ray Elliott e5adf7179f improve output 2020-11-05 21:49:56 +00:00
Ray Elliott a02d2ef34c improve monitorin 2020-11-05 21:46:55 +00:00
2 changed files with 14 additions and 1 deletions

7
monitor_windows.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
bspc subscribe node_focus desktop_focus | while read -a msg ; do
_output="$(show-windows)"
clear
echo "$_output"
done

View File

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
_focused_node_id="$(bspc query -N -n .focused)"
bspc query -D -d .occupied | while read _desktop_id ; do bspc query -D -d .occupied | while read _desktop_id ; do
_desktop_name="$(bspc query -D -d $_desktop_id --names):" _desktop_name="$(bspc query -D -d $_desktop_id --names):"
@ -7,8 +8,13 @@ bspc query -D -d .occupied | while read _desktop_id ; do
_node_id="$(bspc query -N -n $_node_id)" _node_id="$(bspc query -N -n $_node_id)"
_title="$(xtitle $_node_id)" _title="$(xtitle $_node_id)"
_wm_class="$(xprop -id $_node_id | grep WM_CLASS | cut -d\" -f2)" _wm_class="$(xprop -id $_node_id | grep WM_CLASS | cut -d\" -f2)"
printf "%-6s %-15s %.55s\n" "$_desktop_name" "$_wm_class" "$_title" 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='' _desktop_name=''
done done
echo "" echo ""
done done