#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2026 The Dodobian authors
#
# Waybar for waybar.service (drop-in dodo.conf). Outside the Dodo session, or when the user
# has a Waybar config of their own, this is plain waybar. Otherwise it starts Waybar with the
# Dodo panel: a bar on every output, its desktop buttons for that output's desktops.
set -u
. /usr/share/dodo-session/common.sh

own=${XDG_CONFIG_HOME:-$HOME/.config}/waybar
if [ -z "${DODO_SESSION:-}" ] || [ -e "$own/config" ] || [ -e "$own/config.jsonc" ]; then
	exec waybar "$@"
fi

exec waybar -c "$DODO_DEFAULTS/waybar/config.json" -s "$DODO_DEFAULTS/waybar/style.css" "$@"
