add option to ignore a desktop

This commit is contained in:
Ray Elliott 2020-11-08 20:30:27 +00:00
parent 543115ccc8
commit 224e96b603
1 changed files with 17 additions and 13 deletions

View File

@ -1,20 +1,24 @@
#!/bin/sh #!/bin/sh
_ignore_desktop="$1"
_focused_node_id="$(bspc query -N -n .focused)" _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)"
bspc query -N -d "$_desktop_id" -n .window | while read _node_id ; do if [ "$_ignore_desktop" != "$_desktop_name" ] ; then
_node_id="$(bspc query -N -n $_node_id)" bspc query -N -d "$_desktop_id" -n .window | while read _node_id ; do
_title="$(xtitle $_node_id)" _node_id="$(bspc query -N -n $_node_id)"
_wm_class="$(xprop -id $_node_id | grep WM_CLASS | cut -d\" -f2)" _title="$(xtitle $_node_id)"
printf "%-6s %-15s " "$_desktop_name" "$_wm_class" _wm_class="$(xprop -id $_node_id | grep WM_CLASS | cut -d\" -f2)"
if [ "$_focused_node_id" = "$_node_id" ] ; then printf "%-6s %-15s " "$_desktop_name:" "$_wm_class"
printf "\033[0;31m" if [ "$_focused_node_id" = "$_node_id" ] ; then
fi printf "\033[0;31m"
printf "%.55s\033[0m\n" "$_title" fi
_desktop_name='' printf "%.55s\033[0m\n" "$_title"
done _desktop_name=''
echo "" done
echo ""
fi
done done