From 0e98c37fefcd6888964259617c7f22d421dd5a60 Mon Sep 17 00:00:00 2001 From: ray Date: Thu, 5 Nov 2020 20:42:41 +0000 Subject: [PATCH] improve formatting --- show_windows.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/show_windows.sh b/show_windows.sh index ebc483c..12be25e 100755 --- a/show_windows.sh +++ b/show_windows.sh @@ -1,14 +1,13 @@ #!/bin/sh bspc query -D -d .occupied | while read _desktop_id ; do - bspc query -D -d $_desktop_id --names + _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)" - echo " $_wm_class: $_title" + printf "%-6s %-15s %.55s\n" "$_desktop_name" "$_wm_class" "$_title" + _desktop_name='' done - - echo done