#!/bin/bash

# Function to get focused workspace
get_focused() {
    swaymsg -t get_workspaces | jq -r '.[] | select(.focused==true) | .num'
}

# Output initial state
get_focused

# Subscribe to workspace events and output updates
swaymsg -t subscribe -m '["workspace"]' | while read -r event; do
    get_focused
done
