#!/usr/bin/env bash

pid=$(pgrep -x quickshell)
[ -z "$pid" ] && exit 1

# for child in $(pgrep -P "$pid" 2>/dev/null); do
# 	kill "$child"
# done

children=$(pgrep -P "$pid" 2>/dev/null)

kill "$pid"

sleep 0.5

for child in $children; do
	kill "$child" || true
done
