#!/usr/bin/env bash

# Reload Waybar if running, otherwise start it
if pgrep -x waybar >/dev/null; then
    killall -SIGUSR2 waybar
else
    setsid waybar &>/dev/null &
fi

# Restart hyprpaper
pkill hyprpaper 2>/dev/null
setsid hyprpaper &>/dev/null &

# Restart wallpaper cycle script
pkill -f theme-cycle.sh 2>/dev/null
setsid ~/.config/hypr/theme-cycle.sh &>/dev/null &

# Reload Hyprland config
hyprctl reload