#!/bin/bash
# Companion to ~/.config/hypr/tiling-only.lua: Omarchy's layout toggle saves the
# requested layout right after applying it, so wait, then drop every saved
# layout (tiling is the default) and correct the bar and the notification.
sleep 0.5
rm -f "${XDG_STATE_HOME:-$HOME/.local/state}"/omarchy/workspace-layouts/*.lua
omarchy-shell -q omarchy.workspaces refresh
omarchy-shell -q omarchy.dock refresh
[[ $1 == quiet ]] && exit 0
state="${XDG_STATE_HOME:-$HOME/.local/state}/omarchy/workspace-layout-notification"
last=0
[[ -r $state ]] && read -r last <"$state"
omarchy-notification-send -p -r "${last:-0}" -g 󱂬 "Tiling only: other layouts are disabled" >/dev/null
