#!/bin/bash

declare -A layout_symbols

layout_symbols[monocle]="mono"
layout_symbols[tiled]="tiled"

send_symbol() {
  echo ${layout_symbols[$1]}
}

# Optional, sends first output. This requires jq
send_symbol $(bspc query -T --desktop focused | jq -r '.layout')

bspc subscribe desktop_layout | while read -a msg ; do
  send_symbol ${msg[3]}
done