#!/bin/bash

# omarchy:summary=Close all open windows

hyprctl clients -j | \
  jq -r ".[].address" | \
  while read -r addr; do
    hyprctl dispatch "hl.dsp.window.close({ window = \"address:$addr\" })" >/dev/null
  done

# Move to first workspace
hyprctl dispatch 'hl.dsp.focus({ workspace = "1" })' >/dev/null 2>&1 || hyprctl dispatch workspace 1
