#!/usr/bin/env bash

wlist=$(wmctrl -lpx)

IFS=$'\n' read -ra ADDR -d $'\0' <<< "$wlist"

for win in "${ADDR[@]}"
do
    id=$win | awk '{print $1}'
    desktop=$win | awk '{print $2}'
    pid=$win | awk '{print $3}'
    name=$win | awk '{print $4}'
    host=$win | awk '{print $5}'
    title=$win | awk '{print $6}'

    echo $win | awk '{print $6}'
done